站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

StatelessRuleSessionImpl (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.jsr94.rules
Class StatelessRuleSessionImpl

java.lang.Object
  extended by org.drools.jsr94.rules.StatelessRuleSessionImpl
All Implemented Interfaces:
javax.rules.RuleSession, javax.rules.StatelessRuleSession

public class StatelessRuleSessionImpl
extends Object
implements javax.rules.StatelessRuleSession

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.

Author:
thomas diesler
See Also:
StatelessRuleSession

Method Summary
protected  void checkRuleSessionValidity()
          Ensures this RuleSession is not in an illegal rule session state.
 List executeRules(List objects)
          Executes the rules in the bound rule execution set using the supplied list of objects.
 List executeRules(List objects, javax.rules.ObjectFilter filter)
          Executes the rules in the bound rule execution set using the supplied list of objects.
protected  Map getProperties()
          Returns the additional properties used to create this RuleSession.
protected  RuleExecutionSetImpl getRuleExecutionSet()
          Returns the Drools RuleExecutionSet associated with this RuleSession.
 javax.rules.RuleExecutionSetMetadata getRuleExecutionSetMetadata()
          Returns the meta data for the rule execution set bound to this rule session.
 int getType()
           
protected  StatelessSession newStatelessSession()
          Initialize this RuleSession with a new WorkingMemory.
 void release()
          Releases all resources used by this rule session.
protected  void setProperties(Map properties)
          Sets additional properties used to create this RuleSession.
protected  void setRuleExecutionSet(RuleExecutionSetImpl ruleExecutionSet)
          Sets the Drools RuleExecutionSet associated with this RuleSession.
 
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, release
 

Method Detail

newStatelessSession

protected StatelessSession newStatelessSession()
Initialize this RuleSession with a new WorkingMemory.


executeRules

public List executeRules(List objects)
                  throws javax.rules.InvalidRuleSessionException
Executes the rules in the bound rule execution set using the supplied list of objects. A 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 Objects 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.

Specified by:
executeRules in interface javax.rules.StatelessRuleSession
Parameters:
objects - the objects used to execute rules.
Returns:
a List containing the objects as a result of executing the rules.
Throws:
javax.rules.InvalidRuleSessionException - on illegal rule session state.

executeRules

public List executeRules(List objects,
                         javax.rules.ObjectFilter filter)
                  throws javax.rules.InvalidRuleSessionException
Executes the rules in the bound rule execution set using the supplied list of objects. A 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 Objects 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.

Specified by:
executeRules in interface javax.rules.StatelessRuleSession
Parameters:
objects - the objects used to execute rules.
filter - the object filter.
Returns:
a List containing the objects as a result of executing rules, after passing through the supplied object filter.
Throws:
javax.rules.InvalidRuleSessionException - on illegal rule session state.

getType

public int getType()
            throws javax.rules.InvalidRuleSessionException
Specified by:
getType in interface javax.rules.RuleSession
Throws:
javax.rules.InvalidRuleSessionException

checkRuleSessionValidity

protected void checkRuleSessionValidity()
                                 throws javax.rules.InvalidRuleSessionException
Ensures this RuleSession is not in an illegal rule session state.

Throws:
javax.rules.InvalidRuleSessionException - on illegal rule session state.

setProperties

protected void setProperties(Map properties)
Sets additional properties used to create this RuleSession.

Parameters:
properties - additional properties used to create the RuleSession implementation.

getProperties

protected Map getProperties()
Returns the additional properties used to create this RuleSession.

Returns:
the additional properties used to create this RuleSession.

setRuleExecutionSet

protected void setRuleExecutionSet(RuleExecutionSetImpl ruleExecutionSet)
Sets the Drools RuleExecutionSet associated with this RuleSession.

Parameters:
ruleExecutionSet - the Drools RuleExecutionSet to associate with this RuleSession.

getRuleExecutionSet

protected RuleExecutionSetImpl getRuleExecutionSet()
Returns the Drools RuleExecutionSet associated with this RuleSession.

Returns:
the Drools RuleExecutionSet associated with this RuleSession.

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
Returns:
the RuleExecutionSetMetaData bound to this rule session.

release

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

Specified by:
release in interface javax.rules.RuleSession


Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.