Source Code Cross Referenced for ActivationLogEvent.java in  » Rule-Engine » drolls-Rule-Engine » org » drools » audit » event » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Rule Engine » drolls Rule Engine » org.drools.audit.event 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.drools.audit.event;
002:
003:        /*
004:         * Copyright 2005 JBoss Inc
005:         * 
006:         * Licensed under the Apache License, Version 2.0 (the "License");
007:         * you may not use this file except in compliance with the License.
008:         * You may obtain a copy of the License at
009:         * 
010:         *      http://www.apache.org/licenses/LICENSE-2.0
011:         * 
012:         * Unless required by applicable law or agreed to in writing, software
013:         * distributed under the License is distributed on an "AS IS" BASIS,
014:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License.
017:         */
018:
019:        /**
020:         * An activation event logged by the WorkingMemoryLogger.
021:         * It is a snapshot of the event as it was thrown by the working memory.
022:         * It contains the activation id, the name of the rule and a String
023:         * representing the declarations of the activation, which is a list of
024:         * name-value-pairs for each of the declarations in the tuple of the
025:         * activation.  The name is the identifier (=name) of the
026:         * declaration, and the value is a toString of the value of the
027:         * parameter, followed by the id of the fact between parentheses.
028:         * e.g. param1=10; param2=Person[John Doe]
029:         * 
030:         * Such a String representation is used to create a snapshot of the
031:         * current state of the activation by storing a toString of the facts
032:         * bound in the activation.  If necessary, this event could be extended
033:         * to contain a map of declarations too.
034:         * 
035:         * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen </a>
036:         */
037:        public class ActivationLogEvent extends LogEvent {
038:
039:            private String activationId;
040:            private String rule;
041:            private String declarations;
042:            private String ruleFlowGroup;
043:
044:            /**
045:             * Create a new activation log event.
046:             * 
047:             * @param type The type of event.  This can only be ACTIVATION_CREATED, ACTIVATION_CANCELLED,
048:             * BEFORE_ACTIVATION_FIRE or AFTER_ACTIVATION_FIRE.
049:             * @param activationId The id of the activation
050:             * @param rule The name of the rule of the activation
051:             * @param declarations A String representation of the declarations in the
052:             * activation.
053:             */
054:            public ActivationLogEvent(final int type,
055:                    final String activationId, final String rule,
056:                    final String declarations, final String ruleFlowGroup) {
057:                super (type);
058:                this .activationId = activationId;
059:                this .rule = rule;
060:                this .declarations = declarations;
061:                this .ruleFlowGroup = ruleFlowGroup;
062:            }
063:
064:            /**
065:             * Returns a unique id for the activation.
066:             * 
067:             * @return The id of the activation
068:             */
069:            public String getActivationId() {
070:                return this .activationId;
071:            }
072:
073:            /**
074:             * Returns the name of the rule of the activation.
075:             * 
076:             * @return The name of the rule
077:             */
078:            public String getRule() {
079:                return this .rule;
080:            }
081:
082:            /**
083:             * Returns a String representation of the declarations in the
084:             * activation.
085:             * 
086:             * @return A String representation of the declarations.
087:             */
088:            public String getDeclarations() {
089:                return this .declarations;
090:            }
091:
092:            public String getRuleFlowGroup() {
093:                return ruleFlowGroup;
094:            }
095:
096:            public String toString() {
097:
098:                String msg = null;
099:                switch (this .getType()) {
100:                case ACTIVATION_CANCELLED:
101:                    msg = "ACTIVATION CANCELLED";
102:                    break;
103:                case ACTIVATION_CREATED:
104:                    msg = "ACTIVATION CREATED";
105:                    break;
106:
107:                case AFTER_ACTIVATION_FIRE:
108:                    msg = "AFTER ACTIVATION FIRED";
109:                    break;
110:                case BEFORE_ACTIVATION_FIRE:
111:                    msg = "BEFORE ACTIVATION FIRED";
112:                    break;
113:                }
114:                return msg
115:                        + " rule:"
116:                        + this .rule
117:                        + " activationId:"
118:                        + this .activationId
119:                        + " declarations: "
120:                        + this .declarations
121:                        + (ruleFlowGroup == null ? "" : " ruleflow-group: "
122:                                + ruleFlowGroup);
123:            }
124:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.