Java Doc for StatefulRuleSessionImpl.java in  » Rule-Engine » drolls-Rule-Engine » org » drools » jsr94 » rules » 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.jsr94.rules 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.drools.jsr94.rules.AbstractRuleSessionImpl
      org.drools.jsr94.rules.StatefulRuleSessionImpl

StatefulRuleSessionImpl
public class StatefulRuleSessionImpl extends AbstractRuleSessionImpl implements StatefulRuleSession(Code)
The Drools implementation of the StatefulRuleSession interface which is a representation of a stateful rules engine session. A stateful rules engine session exposes a stateful rule execution API to an underlying rules engine. The session allows arbitrary objects to be added and removed to and from the rule session state. Additionally, objects currently part of the rule session state may be updated.

There are inherently side-effects to adding objects to the rule session state. The execution of a RuleExecutionSet can add, remove and update objects in the rule session state. The objects in the rule session state are therefore dependent on the rules within the RuleExecutionSet as well as the rule engine vendor's specific rule engine behavior.

Handle instances are used by the rule engine vendor to track Objects added to the rule session state. This allows multiple instances of equivalent Objects to be added to the session state and identified, even after serialization.
See Also:   StatefulRuleSession
author:
   N. Alex Rupp (n_alex codehaus.org)
author:
   thomas diesler




Constructor Summary
 StatefulRuleSessionImpl(String bindUri, Map properties, RuleExecutionSetRepository repository)
     Gets the RuleExecutionSet for this URI and associates it with a RuleBase.

Method Summary
public  HandleaddObject(Object object)
     Adds a given object to the rule session state of this rule session.
public  ListaddObjects(List objList)
     Adds a List of Objects to the rule session state of this rule session.
Parameters:
  objList - the objects to be added.
protected  voidcheckRuleSessionValidity()
     Ensures this RuleSession is not in an illegal rule session state.
public  booleancontainsObject(Handle objectHandle)
     Returns true if the given object is contained within rulesession state of this rule session.
Parameters:
  objectHandle - the handle to the target object.
public  voidexecuteRules()
     Executes the rules in the bound rule execution set using the objects present in the rule session state.
public  ListgetHandles()
     Returns a List of the Handles being used for object identity.
public  ObjectgetObject(Handle handle)
    
public  ListgetObjects()
     Returns a List of all objects in the rule session state of this rule session.
public  ListgetObjects(ObjectFilter filter)
     Returns a List over the objects in rule session state of this rule session.
public  intgetType()
    
protected  voidinitSession(boolean keepReference)
     Initialize this RuleSession with a new WorkingMemory.
public  voidrelease()
     Releases all resources used by this rule session.
public  voidremoveObject(Handle handleObject)
     Removes a given object from the rule session state of this rule session.
public  voidreset()
     Resets this rule session.
public  voidupdateObject(Handle objectHandle, Object newObject)
     Notifies the rules engine that a given object in the rule session state has changed.


Constructor Detail
StatefulRuleSessionImpl
StatefulRuleSessionImpl(String bindUri, Map properties, RuleExecutionSetRepository repository) throws RuleExecutionSetNotFoundException(Code)
Gets the RuleExecutionSet for this URI and associates it with a RuleBase.
Parameters:
  bindUri - the URI the RuleExecutionSet has been bound to
Parameters:
  properties - additional properties used to create theRuleSession implementation.
throws:
  RuleExecutionSetNotFoundException - if there is no rule set under the given URI




Method Detail
addObject
public Handle addObject(Object object) throws InvalidRuleSessionException(Code)
Adds a given object to the rule session state of this rule session. The argument to this method is Object because in the non-managed env. not all objects should have to implement Serializable. If the RuleSession is Serializable and it contains non-serializable fields a runtime exception will be thrown.
Parameters:
  object - the object to be added. the Handle for the newly added Object
throws:
  InvalidRuleSessionException - on illegal rule session state.



addObjects
public List addObjects(List objList) throws InvalidRuleSessionException(Code)
Adds a List of Objects to the rule session state of this rule session.
Parameters:
  objList - the objects to be added. a List of Handles, one for eachadded Object. The List must beordered in the same order as the input objList.
throws:
  InvalidRuleSessionException - on illegal rule session state.



checkRuleSessionValidity
protected void checkRuleSessionValidity() throws InvalidRuleSessionException(Code)
Ensures this RuleSession is not in an illegal rule session state.
throws:
  InvalidRuleSessionException - on illegal rule session state.



containsObject
public boolean containsObject(Handle objectHandle)(Code)
Returns true if the given object is contained within rulesession state of this rule session.
Parameters:
  objectHandle - the handle to the target object. true if the given object is contained within therule session state of this rule session.



executeRules
public void executeRules() throws InvalidRuleSessionException(Code)
Executes the rules in the bound rule execution set using the objects present in the rule session state. This will typically modify the rule session state - and may add, remove or update Objects bound to Handles.
throws:
  InvalidRuleSessionException - on illegal rule session state.



getHandles
public List getHandles()(Code)
Returns a List of the Handles being used for object identity. a List of Handles present in thecurrect state of the rule session.



getObject
public Object getObject(Handle handle) throws InvalidRuleSessionException, InvalidHandleException(Code)

See Also:   StatefulRuleSessionImpl



getObjects
public List getObjects() throws InvalidRuleSessionException(Code)
Returns a List of all objects in the rule session state of this rule session. The objects should pass the default filter test of the default RuleExecutionSet filter (if present).

This may not neccessarily include all objects added by calls to addObject, and may include Objects created by side-effects. The execution of a RuleExecutionSet can add, remove and update objects as part of the rule session state. Therefore the rule session state is dependent on the rules that are part of the executed RuleExecutionSet as well as the rule vendor's specific rule engine behavior. a List of all objects part of the rule sessionstate.
throws:
  InvalidRuleSessionException - on illegal rule session state.




getObjects
public List getObjects(ObjectFilter filter) throws InvalidRuleSessionException(Code)
Returns a List over the objects in rule session state of this rule session. The objects should pass the filter test on the specified ObjectFilter.

This may not neccessarily include all objects added by calls to addObject, and may include Objects created by side-effects. The execution of a RuleExecutionSet can add, remove and update objects as part of the rule session state. Therefore the rule session state is dependent on the rules that are part of the executed RuleExecutionSet as well as the rule vendor's specific rule engine behavior.
Parameters:
  filter - the object filter. a List of all the objects in the rule sessionstate of this rule session based upon the given object filter.
throws:
  InvalidRuleSessionException - on illegal rule session state.




getType
public int getType() throws InvalidRuleSessionException(Code)



initSession
protected void initSession(boolean keepReference)(Code)
Initialize this RuleSession with a new WorkingMemory.



release
public void release()(Code)
Releases all resources used by this rule session. This method renders this rule session unusable until it is reacquired through the RuleRuntime.



removeObject
public void removeObject(Handle handleObject) throws InvalidRuleSessionException, InvalidHandleException(Code)
Removes a given object from the rule session state of this rule session.
Parameters:
  handleObject - the handle to the object to be removed from the rule sessionstate.
throws:
  InvalidRuleSessionException - on illegal rule session state.
throws:
  InvalidHandleException - if the input Handle is no longer valid



reset
public void reset()(Code)
Resets this rule session. Calling this method will bring the rule session state to its initial state for this rule session and will reset any other state associated with this rule session.

A reset will not reset the state on the default object filter for a RuleExecutionSet.




updateObject
public void updateObject(Handle objectHandle, Object newObject) throws InvalidRuleSessionException, InvalidHandleException(Code)
Notifies the rules engine that a given object in the rule session state has changed.

The semantics of this call are equivalent to calling removeObject followed by addObject. The original Handle is rebound to the new value for the Object however.
Parameters:
  objectHandle - the handle to the original object.
Parameters:
  newObject - the new object to bind to the handle.
throws:
  InvalidRuleSessionException - on illegal rule session state.
throws:
  InvalidHandleException - if the input Handle is no longer valid




Methods inherited from org.drools.jsr94.rules.AbstractRuleSessionImpl
abstract protected void checkRuleSessionValidity() throws InvalidRuleSessionException(Code)(Java Doc)
protected Map getProperties()(Code)(Java Doc)
protected RuleExecutionSetImpl getRuleExecutionSet()(Code)(Java Doc)
public RuleExecutionSetMetadata getRuleExecutionSetMetadata()(Code)(Java Doc)
public void release()(Code)(Java Doc)
protected void setProperties(Map properties)(Code)(Java Doc)
protected void setRuleExecutionSet(RuleExecutionSetImpl ruleExecutionSet)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.