|
|||||||
| PREV CLASS NEXT CLASS | NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--com.haley.haleyrules.jsr94.HaleyRuleSession
|
+--com.haley.haleyrules.jsr94.StatefulRuleSessionImpl
This class implements StatefulRuleSession interface. For Haley rules engine, there can be only one thread to access a StatefulRuleSession at any one time.
The StatefulRuleSession 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.
| Method Summary | |
javax.rules.Handle |
addObject(java.lang.Object object)
Adds a given object to the rule session state of this rule session. |
java.util.List |
addObjects(java.util.List objList)
Adds a List of Objects to the rule session state of this rule session. |
boolean |
containsObject(javax.rules.Handle objectHandle)
|
void |
executeRules()
Executes the rules in the bound rule execution set using the objects present in the rule session state. |
java.util.List |
getHandles()
Returns a List of the Handles being used for object identity. |
java.lang.Object |
getObject(javax.rules.Handle handle)
Returns the Object within the StatefulRuleSession associated with a Handle. |
java.util.List |
getObjects()
Returns a List of all objects in the rule session state of this rule session. |
java.util.List |
getObjects(javax.rules.ObjectFilter filter)
Returns a List over the objects in rule session state of this rule session. |
int |
getType()
Gets the type identifier for this RuleSession. |
void |
release()
Releases all resources used by this rule session. |
void |
removeObject(javax.rules.Handle handle)
Removes a given object from the rule session state of this rule session. |
void |
reset()
Resets this rule session. |
void |
updateObject(javax.rules.Handle objectHandle,
java.lang.Object newObject)
Notifies the rules engine that a given object in the rule session state has changed. |
| Methods inherited from class com.haley.haleyrules.jsr94.HaleyRuleSession |
getRuleExecutionSetMetadata |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.rules.RuleSession |
getRuleExecutionSetMetadata |
| Method Detail |
public boolean containsObject(javax.rules.Handle objectHandle)
throws javax.rules.InvalidRuleSessionException,
javax.rules.InvalidHandleException
containsObject in interface javax.rules.StatefulRuleSessionobjectHandle - the handle to the target object.javax.rules.InvalidRuleSessionException - on illegal rule session state.javax.rules.InvalidHandleException -
public javax.rules.Handle addObject(java.lang.Object object)
throws javax.rules.InvalidRuleSessionException
addObject in interface javax.rules.StatefulRuleSessionobject - the object to be added.InvalidRuleSessionExceptionAdds - on illegal rule session state.
public java.util.List addObjects(java.util.List objList)
throws javax.rules.InvalidRuleSessionException
addObjects in interface javax.rules.StatefulRuleSessionobjList - the objects to be added.javax.rules.InvalidRuleSessionException - on illegal rule session state.
public void updateObject(javax.rules.Handle objectHandle,
java.lang.Object newObject)
throws javax.rules.InvalidRuleSessionException,
javax.rules.InvalidHandleException
updateObject in interface javax.rules.StatefulRuleSessionobjectHandle - Handle - the handle to the original object.newObject - the new object to bind to the handle.javax.rules.InvalidRuleSessionException - on illegal rule session state.javax.rules.InvalidHandleException - if the input Handle is no longer valid
public void removeObject(javax.rules.Handle handle)
throws javax.rules.InvalidHandleException,
javax.rules.InvalidRuleSessionException
removeObject in interface javax.rules.StatefulRuleSessionhandle - the handle to the object to be removed from the rule session state.javax.rules.InvalidHandleException - if the input Handle is no longer validjavax.rules.InvalidRuleSessionException - on illegal rule session state.
public java.util.List getObjects()
throws javax.rules.InvalidRuleSessionException
getObjects in interface javax.rules.StatefulRuleSessionjavax.rules.InvalidRuleSessionException - on illegal rule session state.
public java.util.List getHandles()
throws javax.rules.InvalidRuleSessionException
getHandles in interface javax.rules.StatefulRuleSessionjavax.rules.InvalidRuleSessionException -
public java.util.List getObjects(javax.rules.ObjectFilter filter)
throws javax.rules.InvalidRuleSessionException
getObjects in interface javax.rules.StatefulRuleSessionfilter - the object filter.javax.rules.InvalidRuleSessionException - on illegal rule session state.
public void executeRules()
throws javax.rules.InvalidRuleSessionException
executeRules in interface javax.rules.StatefulRuleSessionjavax.rules.InvalidRuleSessionException - -
on illegal rule session state.
public void reset()
throws javax.rules.InvalidRuleSessionException
reset in interface javax.rules.StatefulRuleSessionjavax.rules.InvalidRuleSessionException - on illegal rule session state.
public java.lang.Object getObject(javax.rules.Handle handle)
throws javax.rules.InvalidHandleException,
javax.rules.InvalidRuleSessionException
getObject in interface javax.rules.StatefulRuleSessionhandle - Handlejavax.rules.InvalidHandleException - if the Handle is no longer valid for this StatefulRuleSessionjavax.rules.InvalidRuleSessionException -
public int getType()
throws javax.rules.InvalidRuleSessionException
getType in interface javax.rules.RuleSessiongetType in class HaleyRuleSessionjavax.rules.InvalidRuleSessionException - on illegal rule session state
public void release()
throws javax.rules.InvalidRuleSessionException
release in interface javax.rules.RuleSessionrelease in class HaleyRuleSessionjavax.rules.InvalidRuleSessionException -
|
|||||||
| PREV CLASS NEXT CLASS | NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||