org.drools.jsr94.rules
Class StatefulRuleSessionImpl

java.lang.Object
  |
  +--org.drools.jsr94.rules.RuleSessionImpl
        |
        +--org.drools.jsr94.rules.StatefulRuleSessionImpl
All Implemented Interfaces:
javax.rules.RuleSession, java.io.Serializable, javax.rules.StatefulRuleSession

public class StatefulRuleSessionImpl
extends org.drools.jsr94.rules.RuleSessionImpl
implements javax.rules.StatefulRuleSession

This interface 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 working memory of the associated rules engine. Additionally, objects currently in the working memory may be updated, and the working memory itself can be iterated.

Author:
thomas diesler
See Also:
StatefulRuleSession, Serialized Form

Method Summary
 javax.rules.Handle addObject(java.lang.Object object)
           
 java.util.List addObjects(java.util.List objects)
           
protected  void applyFilter(java.util.List objects, javax.rules.ObjectFilter objectFilter)
           
protected  void checkRuleSessionValidity()
           
 boolean containsObject(javax.rules.Handle handle)
           
 void executeRules()
           
 java.lang.Object getObject(javax.rules.Handle handle)
           
 java.util.List getObjects()
           
 java.util.List getObjects(javax.rules.ObjectFilter objectFilter)
           
protected  java.util.Map getProperties()
           
protected  RuleExecutionSetImpl getRuleExecutionSet()
           
 javax.rules.RuleExecutionSetMetadata getRuleExecutionSetMetadata()
          Returns the meta data for the rule execution set bound to this rule session.
 int getType()
          Returns the type identifier for this RuleSession.
protected  WorkingMemory getWorkingMemory()
           
protected  void initWorkingMemory()
           
protected  WorkingMemory newWorkingMemory()
           
 void release()
           
 void removeObject(javax.rules.Handle handle)
           
 void reset()
           
protected  void setProperties(java.util.Map properties)
           
protected  void setRuleExecutionSet(RuleExecutionSetImpl ruleSet)
           
protected  void setWorkingMemory(WorkingMemory workingMemory)
           
 void updateObject(javax.rules.Handle handle, java.lang.Object object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.rules.StatefulRuleSession
reset
 
Methods inherited from interface javax.rules.RuleSession
getRuleExecutionSetMetadata, getType, release
 

Method Detail

containsObject

public boolean containsObject(javax.rules.Handle handle)
Specified by:
containsObject in interface javax.rules.StatefulRuleSession
See Also:
StatefulRuleSessionImpl

addObject

public javax.rules.Handle addObject(java.lang.Object object)
                             throws javax.rules.InvalidRuleSessionException
Specified by:
addObject in interface javax.rules.StatefulRuleSession
javax.rules.InvalidRuleSessionException
See Also:
StatefulRuleSessionImpl

addObjects

public java.util.List addObjects(java.util.List objects)
                          throws javax.rules.InvalidRuleSessionException
Specified by:
addObjects in interface javax.rules.StatefulRuleSession
javax.rules.InvalidRuleSessionException
See Also:
StatefulRuleSessionImpl

updateObject

public void updateObject(javax.rules.Handle handle,
                         java.lang.Object object)
                  throws javax.rules.InvalidRuleSessionException,
                         javax.rules.InvalidHandleException
Specified by:
updateObject in interface javax.rules.StatefulRuleSession
javax.rules.InvalidRuleSessionException
javax.rules.InvalidHandleException
See Also:
StatefulRuleSessionImpl

removeObject

public void removeObject(javax.rules.Handle handle)
                  throws javax.rules.InvalidRuleSessionException,
                         javax.rules.InvalidHandleException
Specified by:
removeObject in interface javax.rules.StatefulRuleSession
javax.rules.InvalidRuleSessionException
javax.rules.InvalidHandleException
See Also:
StatefulRuleSessionImpl

getObjects

public java.util.List getObjects()
                          throws javax.rules.InvalidRuleSessionException
Specified by:
getObjects in interface javax.rules.StatefulRuleSession
javax.rules.InvalidRuleSessionException
See Also:
StatefulRuleSessionImpl

getObjects

public java.util.List getObjects(javax.rules.ObjectFilter objectFilter)
                          throws javax.rules.InvalidRuleSessionException
Specified by:
getObjects in interface javax.rules.StatefulRuleSession
javax.rules.InvalidRuleSessionException
See Also:
StatefulRuleSessionImpl

executeRules

public void executeRules()
                  throws javax.rules.InvalidRuleSessionException
Specified by:
executeRules in interface javax.rules.StatefulRuleSession
javax.rules.InvalidRuleSessionException
See Also:
StatefulRuleSessionImpl

getObject

public java.lang.Object getObject(javax.rules.Handle handle)
                           throws javax.rules.InvalidRuleSessionException,
                                  javax.rules.InvalidHandleException
Specified by:
getObject in interface javax.rules.StatefulRuleSession
javax.rules.InvalidRuleSessionException
javax.rules.InvalidHandleException
See Also:
StatefulRuleSessionImpl

initWorkingMemory

protected void initWorkingMemory()

newWorkingMemory

protected WorkingMemory newWorkingMemory()

setProperties

protected void setProperties(java.util.Map properties)

getProperties

protected java.util.Map getProperties()

setWorkingMemory

protected void setWorkingMemory(WorkingMemory workingMemory)

getWorkingMemory

protected WorkingMemory getWorkingMemory()

setRuleExecutionSet

protected void setRuleExecutionSet(RuleExecutionSetImpl ruleSet)

getRuleExecutionSet

protected RuleExecutionSetImpl getRuleExecutionSet()

checkRuleSessionValidity

protected void checkRuleSessionValidity()
                                 throws javax.rules.InvalidRuleSessionException
javax.rules.InvalidRuleSessionException

getRuleExecutionSetMetadata

public javax.rules.RuleExecutionSetMetadata getRuleExecutionSetMetadata()
Returns the meta data for the rule execution set bound to this rule session.

Specified by:
getRuleExecutionSetMetadata in interface javax.rules.RuleSession

getType

public int getType()
            throws javax.rules.InvalidRuleSessionException
Returns the type identifier for this RuleSession. The type identifiers are defined in the RuleRuntime interface.

Specified by:
getType in interface javax.rules.RuleSession
javax.rules.InvalidRuleSessionException

reset

public void reset()

release

public void release()
Specified by:
release in interface javax.rules.RuleSession

applyFilter

protected void applyFilter(java.util.List objects,
                           javax.rules.ObjectFilter objectFilter)