|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.jsr94.rules.RuleSessionImpl
The Drools implementation of the RuleSession
interface which is
a representation of a client session with a rules engine. A rules engine
session serves as an entry point into an underlying rules engine. The
RuleSession
is bound to a rules engine instance and exposes a
vendor-neutral rule processing API for executing Rule
s within a
bound RuleExecutionSet
.
release
method must be called to clean up all
resources used by the RuleSession
. Calling release
may make the RuleSession
eligible to be returned to a
RuleSession
pool.
RuleSession
Constructor Summary | |
(package private) |
RuleSessionImpl()
|
Method Summary | |
protected void |
applyFilter(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. |
protected 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(Map properties)
Sets additional properties used to create this RuleSession . |
protected void |
setRuleExecutionSet(RuleExecutionSetImpl ruleSet)
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 |
Constructor Detail |
RuleSessionImpl()
Method Detail |
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)
,
DefaultConflictResolver
protected void setProperties(Map properties)
RuleSession
.
properties
- additional properties used to create the
RuleSession
implementation.protected 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 ruleSet)
RuleExecutionSet
associated
with this RuleSession
.
ruleSet
- 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(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()
getRuleExecutionSetMetadata
in interface RuleSession
public int getType() throws InvalidRuleSessionException
RuleSession
. The
type identifiers are defined in the RuleRuntime
interface.
getType
in interface RuleSession
RuleSession
InvalidRuleSessionException
- on illegal rule session state.RuleRuntime.STATEFUL_SESSION_TYPE
,
RuleRuntime.STATELESS_SESSION_TYPE
public void release()
RuleRuntime
.
release
in interface RuleSession
public void reset()
RuleExecutionSet
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |