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

LeapsRuleBase - JBoss RULES 3.0.6 API 英文版文档


org.drools.leaps
Class LeapsRuleBase

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

public class LeapsRuleBase
extends AbstractRuleBase

This base class for the engine and analogous to Drool's RuleBase class. It has a similar interface adapted to the Leaps algorithm

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
LeapsRuleBase()
          Construct.
LeapsRuleBase(RuleBaseConfiguration config, FactHandleFactory factHandleFactory)
          Construct.
 
Method Summary
 void addRule(Rule rule)
          Creates leaps rule wrappers and propagate rule to the working memories
 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()
          Create a new WorkingMemory session for this RuleBase.
 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.
 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, removePackage, removeRule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeapsRuleBase

public LeapsRuleBase()
              throws PackageIntegrationException
Construct.

Parameters:
rete - The rete network.
Throws:
PackageIntegrationException

LeapsRuleBase

public LeapsRuleBase(RuleBaseConfiguration config,
                     FactHandleFactory factHandleFactory)
Construct.

Parameters:
rete - The rete network.
conflictResolver - The conflict resolver.
factHandleFactory - The fact handle factory.
pkgs -
applicationData -
Throws:
PackageIntegrationException
java.lang.Exception
Method Detail

newWorkingMemory

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

The created WorkingMemory uses the default conflict resolution strategy.

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

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

public void addRule(Rule rule)
             throws FactException,
                    InvalidPatternException
Creates leaps rule wrappers and propagate rule to the working memories

Overrides:
addRule in class AbstractRuleBase
Parameters:
rule -
Throws:
FactException
InvalidPatternException

removeRule

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

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
Description copied from interface: InternalRuleBase
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
Description copied from interface: InternalRuleBase
Retract a fact object.

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