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

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


org.drools.reteoo
Class ReteooRuleBase

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

public class ReteooRuleBase
extends AbstractRuleBase

Implementation of RuleBase.

Version:
$Id: RuleBaseImpl.java,v 1.5 2005/08/14 22:44:12 mproctor Exp $
Author:
bob mcwhirter, Mark Proctor
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.drools.common.AbstractRuleBase
config, factHandleFactory, globals, id, packageClassLoader, pkgs, processes, statefulSessions, workingMemoryCounter
 
Fields inherited from interface org.drools.RuleBase
LEAPS, RETEOO
 
Constructor Summary
ReteooRuleBase()
          Default constructor - for Externalizable.
ReteooRuleBase(RuleBaseConfiguration config)
           
ReteooRuleBase(String id)
          Construct.
ReteooRuleBase(String id, FactHandleFactory factHandleFactory)
           
ReteooRuleBase(String id, RuleBaseConfiguration config)
           
ReteooRuleBase(String id, RuleBaseConfiguration config, FactHandleFactory factHandleFactory)
          Construct.
 
Method Summary
protected  void addRule(Rule rule)
           
 void assertObject(FactHandle handle, Object object, PropagationContext context, ReteooWorkingMemory workingMemory)
          Assert a fact object.
 Rete getRete()
          Retrieve the Rete-OO network for this RuleBase.
 StatefulSession newStatefulSession(boolean keepReference)
          Create a new WorkingMemory session for this RuleBase.
 StatelessSession newStatelessSession()
           
 void readExternal(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(ObjectOutput stream)
          Handles the write serialization of the Package.
 
Methods inherited from class org.drools.common.AbstractRuleBase
addPackage, addProcess, addStatefulSession, disposeStatefulSession, doReadExternal, doWriteExternal, getConfiguration, getFactHandleFactory, getGlobals, getId, getPackages, getProcess, getProcesses, getStatefulSessions, getWorkingMemories, newFactHandleFactory, newStatefulSession, newStatefulSession, newStatefulSession, removePackage, removeProcess, removeRule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReteooRuleBase

public ReteooRuleBase()
Default constructor - for Externalizable. This should never be used by a user, as it will result in an invalid state for the instance.


ReteooRuleBase

public ReteooRuleBase(String id)
Construct.

Parameters:
rete - The rete network.

ReteooRuleBase

public ReteooRuleBase(String id,
                      FactHandleFactory factHandleFactory)
Parameters:
factHandleFactory -

ReteooRuleBase

public ReteooRuleBase(String id,
                      RuleBaseConfiguration config)

ReteooRuleBase

public ReteooRuleBase(RuleBaseConfiguration config)
Parameters:
config -

ReteooRuleBase

public ReteooRuleBase(String id,
                      RuleBaseConfiguration config,
                      FactHandleFactory factHandleFactory)
Construct.

Parameters:
rete - The rete network.
Method Detail

writeExternal

public void writeExternal(ObjectOutput stream)
                   throws 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:
IOException

readExternal

public void readExternal(ObjectInput stream)
                  throws IOException,
                         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:
IOException
ClassNotFoundException

getRete

public Rete getRete()
Retrieve the Rete-OO network for this RuleBase.

Returns:
The RETE-OO network.

assertObject

public void assertObject(FactHandle handle,
                         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.

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.

newStatefulSession

public StatefulSession newStatefulSession(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:
newStatefulSession in interface RuleBase
Specified by:
newStatefulSession in class AbstractRuleBase
Returns:
A newly initialized WorkingMemory.
See Also:
RuleBase

newStatelessSession

public StatelessSession newStatelessSession()

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


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