|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.jsr94.rules.StatelessRuleSessionImpl
public class StatelessRuleSessionImpl
The Drools implementation of the StatelessRuleSession
interface which is a representation of a stateless rules engine session. A
stateless rules engine session exposes a stateless rule execution API to an
underlying rules engine.
StatelessRuleSession
Method Summary | |
---|---|
protected void |
applyFilter(java.util.List objects,
ObjectFilter objectFilter)
Applies the given ObjectFilter to the List of
Object s, removing all Object s from the given
List that do not pass the filter. |
protected void |
checkRuleSessionValidity()
Ensures this RuleSession is not
in an illegal rule session state. |
java.util.List |
executeRules(java.util.List objects)
Executes the rules in the bound rule execution set using the supplied list of objects. |
java.util.List |
executeRules(java.util.List objects,
ObjectFilter filter)
Executes the rules in the bound rule execution set using the supplied list of objects. |
protected java.util.Map |
getProperties()
Returns the additional properties used to create this RuleSession . |
protected RuleExecutionSetImpl |
getRuleExecutionSet()
Returns the Drools RuleExecutionSet associated
with this RuleSession . |
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()
Returns the Drools WorkingMemory associated
with this RuleSession . |
protected void |
initWorkingMemory()
Initialize this RuleSession
with a new WorkingMemory . |
protected WorkingMemory |
newWorkingMemory()
Creates a new WorkingMemory for this
RuleSession . |
void |
release()
Releases all resources used by this rule session. |
void |
reset()
Resets this rule session. |
protected void |
setProperties(java.util.Map properties)
Sets additional properties used to create this RuleSession . |
protected void |
setRuleExecutionSet(RuleExecutionSetImpl ruleExecutionSet)
Sets the Drools RuleExecutionSet associated
with this RuleSession . |
protected void |
setWorkingMemory(WorkingMemory workingMemory)
Sets the Drools WorkingMemory associated
with this RuleSession . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.util.List executeRules(java.util.List objects) throws InvalidRuleSessionException
List
is returned containing the objects
created by (or passed into the rule session) the executed rules that pass
the filter test of the default RuleExecutionSet
ObjectFilter
(if present). The returned list may not neccessarily include all
objects passed, and may include Object
s created by
side-effects. The execution of a RuleExecutionSet
can add,
remove and update objects. Therefore the returned object list is
dependent on the rules that are part of the executed
RuleExecutionSet
as well as Drools specific rule engine
behavior.
objects
- the objects used to execute rules.
List
containing the objects as a result of
executing the rules.
InvalidRuleSessionException
- on illegal rule session state.public java.util.List executeRules(java.util.List objects, ObjectFilter filter) throws InvalidRuleSessionException
List
is returned containing the objects
created by (or passed into the rule engine) the executed rules and
filtered with the supplied object filter. The returned list may not
neccessarily include all objects passed, and may include
Object
s created by side-effects. The execution of a
RuleExecutionSet
can add, remove and update objects.
Therefore the returned object list is dependent on the rules that are
part of the executed RuleExecutionSet
as well as Drools
specific rule engine behavior.
objects
- the objects used to execute rules.filter
- the object filter.
List
containing the objects as a result of
executing rules, after passing through the supplied object
filter.
InvalidRuleSessionException
- on illegal rule session state.protected void initWorkingMemory()
RuleSession
with a new WorkingMemory
.
newWorkingMemory()
protected WorkingMemory newWorkingMemory()
WorkingMemory
for this
RuleSession
. All properties set prior to calling this method
are added as application data to the new WorkingMemory
.
The created WorkingMemory
uses the default conflict
resolution strategy.
WorkingMemory
.setProperties(Map)
,
WorkingMemory.setApplicationData(String, Object)
protected void setProperties(java.util.Map properties)
RuleSession
.
properties
- additional properties used to create the
RuleSession
implementation.protected java.util.Map getProperties()
RuleSession
.
RuleSession
.protected void setWorkingMemory(WorkingMemory workingMemory)
WorkingMemory
associated
with this RuleSession
.
workingMemory
- the WorkingMemory
to associate
with this RuleSession
.protected WorkingMemory getWorkingMemory()
WorkingMemory
associated
with this RuleSession
.
WorkingMemory
to associate
with this RuleSession
.protected void setRuleExecutionSet(RuleExecutionSetImpl ruleExecutionSet)
RuleExecutionSet
associated
with this RuleSession
.
ruleExecutionSet
- the Drools RuleExecutionSet
to associate
with this RuleSession
.protected RuleExecutionSetImpl getRuleExecutionSet()
RuleExecutionSet
associated
with this RuleSession
.
RuleExecutionSet
associated
with this RuleSession
.protected void checkRuleSessionValidity() throws InvalidRuleSessionException
RuleSession
is not
in an illegal rule session state.
InvalidRuleSessionException
- on illegal rule session state.protected void applyFilter(java.util.List objects, ObjectFilter objectFilter)
ObjectFilter
to the List
of
Object
s, removing all Object
s from the given
List
that do not pass the filter.
objects
- List
of Object
s to be filteredobjectFilter
- the ObjectFilter
to be appliedpublic RuleExecutionSetMetadata getRuleExecutionSetMetadata()
public int getType() throws InvalidRuleSessionException
RuleSession
. The
type identifiers are defined in the RuleRuntime
interface.
RuleSession
InvalidRuleSessionException
- on illegal rule session state.RuleRuntime#STATEFUL_SESSION_TYPE
,
RuleRuntime#STATELESS_SESSION_TYPE
public void release()
RuleRuntime
.
public void reset()
RuleExecutionSet
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |