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

ReteooRuleBase - JBoss RULES 3.0.6 API 英文版文档


org.drools.reteoo
Class ReteooRuleBase

java.lang.Object
  extended by org.drools.common.AbstractRuleBase
      extended by org.drools.reteoo.ReteooRuleBase
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, InternalRuleBase, RuleBase

public class ReteooRuleBase
extends AbstractRuleBase

Implementation of RuleBase.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.drools.common.AbstractRuleBase
config, factHandleFactory, globals, packageClassLoader, pkgs, PRESENT, workingMemories
 
Fields inherited from interface org.drools.RuleBase
LEAPS, RETEOO
 
Constructor Summary
ReteooRuleBase()
          Construct.
ReteooRuleBase(FactHandleFactory factHandleFactory)
           
ReteooRuleBase(RuleBaseConfiguration config)
           
ReteooRuleBase(RuleBaseConfiguration config, FactHandleFactory factHandleFactory)
          Construct.
 
Method Summary
protected  void addRule(Rule rule)
           
 void assertObject(FactHandle handle, java.lang.Object object, PropagationContext context, ReteooWorkingMemory workingMemory)
          Assert a fact object.
 void modifyObject(FactHandle handle, PropagationContext context, ReteooWorkingMemory workingMemory)
           
 WorkingMemory newWorkingMemory(boolean keepReference)
          Create a new WorkingMemory session for this RuleBase.
 void readExternal(java.io.ObjectInput stream)
          Handles the read serialization of the Package.
protected  void removeRule(Rule rule)
           
 void retractObject(FactHandle handle, PropagationContext context, ReteooWorkingMemory workingMemory)
          Retract a fact object.
 void writeExternal(java.io.ObjectOutput stream)
          Handles the write serialization of the Package.
 
Methods inherited from class org.drools.common.AbstractRuleBase
addPackage, addWorkingMemory, disposeWorkingMemory, doReadExternal, doWriteExternal, getConfiguration, getFactHandleFactory, getGlobals, getPackages, getWorkingMemories, newFactHandleFactory, newWorkingMemory, newWorkingMemory, newWorkingMemory, removePackage, removeRule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReteooRuleBase

public ReteooRuleBase()
Construct.

Parameters:
rete - The rete network.

ReteooRuleBase

public ReteooRuleBase(FactHandleFactory factHandleFactory)
Parameters:
factHandleFactory -

ReteooRuleBase

public ReteooRuleBase(RuleBaseConfiguration config)
Parameters:
config -

ReteooRuleBase

public ReteooRuleBase(RuleBaseConfiguration config,
                      FactHandleFactory factHandleFactory)
Construct.

Parameters:
rete - The rete network.
Method Detail

writeExternal

public void writeExternal(java.io.ObjectOutput stream)
                   throws java.io.IOException
Handles the write serialization of the Package. Patterns in Rules may reference generated data which cannot be serialized by default methods. The Package uses PackageCompilationData to hold a reference to the generated bytecode. The generated bytecode must be restored before any Rules.

Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput stream)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Handles the read serialization of the Package. Patterns in Rules may reference generated data which cannot be serialized by default methods. The Package uses PackageCompilationData to hold a reference to the generated bytecode; which must be restored before any Rules. A custom ObjectInputStream, able to resolve classes against the bytecode in the PackageCompilationData, is used to restore the Rules.

Throws:
java.io.IOException
java.lang.ClassNotFoundException

assertObject

public void assertObject(FactHandle handle,
                         java.lang.Object object,
                         PropagationContext context,
                         ReteooWorkingMemory workingMemory)
                  throws FactException
Assert a fact object.

Parameters:
handle - The handle.
object - The fact.
workingMemory - The working-memory.
Throws:
FactException - If an error occurs while performing the assertion.

modifyObject

public void modifyObject(FactHandle handle,
                         PropagationContext context,
                         ReteooWorkingMemory workingMemory)
                  throws FactException
Throws:
FactException

retractObject

public void retractObject(FactHandle handle,
                          PropagationContext context,
                          ReteooWorkingMemory workingMemory)
                   throws FactException
Retract a fact object.

Parameters:
handle - The handle.
workingMemory - The working-memory.
Throws:
FactException - If an error occurs while performing the retraction.

newWorkingMemory

public WorkingMemory newWorkingMemory(boolean keepReference)
Description copied from interface: RuleBase
Create a new WorkingMemory session for this RuleBase. Optionally the RuleBase retains a weak reference to returned WorkingMemory.

The created WorkingMemory uses the default conflict resolution strategy.

Specified by:
newWorkingMemory in interface RuleBase
Specified by:
newWorkingMemory in class AbstractRuleBase
Returns:
A newly initialized WorkingMemory.
See Also:
RuleBase

addRule

protected void addRule(Rule rule)
                throws InvalidPatternException
Overrides:
addRule in class AbstractRuleBase
Throws:
InvalidPatternException

removeRule

protected void removeRule(Rule rule)
Specified by:
removeRule in class AbstractRuleBase