|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.drools.common.AbstractRuleBase
public abstract class AbstractRuleBase
Implementation of RuleBase.
| Field Summary | |
|---|---|
protected RuleBaseConfiguration |
config
|
protected FactHandleFactory |
factHandleFactory
The fact handle factory. |
protected java.util.Map |
globals
|
protected CompositePackageClassLoader |
packageClassLoader
|
protected java.util.Map |
pkgs
|
protected static java.lang.Object |
PRESENT
Special value when adding to the underlying map. |
protected java.util.Map |
workingMemories
WeakHashMap to keep references of WorkingMemories but allow them to be garbage collected |
| Fields inherited from interface org.drools.RuleBase |
|---|
LEAPS, RETEOO |
| Constructor Summary | |
|---|---|
AbstractRuleBase(RuleBaseConfiguration config,
FactHandleFactory factHandleFactory)
Construct. |
|
| Method Summary | |
|---|---|
void |
addPackage(Package newPkg)
Add a Package to the network. |
protected void |
addRule(Rule rule)
|
protected void |
addWorkingMemory(WorkingMemory workingMemory,
boolean keepReference)
|
void |
disposeWorkingMemory(WorkingMemory workingMemory)
|
void |
doReadExternal(java.io.ObjectInput stream,
java.lang.Object[] objects)
Handles the read serialization of the Package. |
void |
doWriteExternal(java.io.ObjectOutput stream,
java.lang.Object[] objects)
Handles the write serialization of the Package. |
RuleBaseConfiguration |
getConfiguration()
|
FactHandleFactory |
getFactHandleFactory()
|
java.util.Map |
getGlobals()
|
Package[] |
getPackages()
|
java.util.Set |
getWorkingMemories()
|
FactHandleFactory |
newFactHandleFactory()
|
WorkingMemory |
newWorkingMemory()
Create a new WorkingMemory session for this
RuleBase. |
abstract WorkingMemory |
newWorkingMemory(boolean keepReference)
Create a new WorkingMemory session for this
RuleBase. |
WorkingMemory |
newWorkingMemory(java.io.InputStream stream)
RuleBases handle the returning of a Serialized WorkingMemory pass as an InputStream. |
WorkingMemory |
newWorkingMemory(java.io.InputStream stream,
boolean keepReference)
RuleBases handle the returning of a Serialized WorkingMemory pass as an InputStream. |
void |
removePackage(java.lang.String packageName)
|
protected abstract void |
removeRule(Rule rule)
|
void |
removeRule(java.lang.String packageName,
java.lang.String ruleName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.drools.common.InternalRuleBase |
|---|
assertObject, modifyObject, retractObject |
| Methods inherited from interface java.io.Externalizable |
|---|
readExternal, writeExternal |
| Field Detail |
|---|
protected RuleBaseConfiguration config
protected java.util.Map pkgs
protected transient CompositePackageClassLoader packageClassLoader
protected FactHandleFactory factHandleFactory
protected java.util.Map globals
protected transient java.util.Map workingMemories
protected static final java.lang.Object PRESENT
| Constructor Detail |
|---|
public AbstractRuleBase(RuleBaseConfiguration config, FactHandleFactory factHandleFactory)
rete - The rete network.| Method Detail |
|---|
public void doWriteExternal(java.io.ObjectOutput stream,
java.lang.Object[] objects)
throws java.io.IOException
java.io.IOException
public void doReadExternal(java.io.ObjectInput stream,
java.lang.Object[] objects)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundExceptionpublic WorkingMemory newWorkingMemory()
RuleBaseWorkingMemory session for this
RuleBase. By default the RuleBase retains a
weak reference to returned WorkingMemory.
The created WorkingMemory uses the default conflict
resolution strategy.
newWorkingMemory in interface RuleBaseWorkingMemory.RuleBasepublic abstract WorkingMemory newWorkingMemory(boolean keepReference)
RuleBaseWorkingMemory session for this
RuleBase. Optionally the RuleBase retains a
weak reference to returned WorkingMemory.
The created WorkingMemory uses the default conflict
resolution strategy.
newWorkingMemory in interface RuleBaseWorkingMemory.RuleBasepublic void disposeWorkingMemory(WorkingMemory workingMemory)
disposeWorkingMemory in interface InternalRuleBasepublic FactHandleFactory getFactHandleFactory()
RuleBasepublic FactHandleFactory newFactHandleFactory()
newFactHandleFactory in interface InternalRuleBasepublic Package[] getPackages()
getPackages in interface RuleBasepublic java.util.Map getGlobals()
getGlobals in interface InternalRuleBasepublic void addPackage(Package newPkg) throws PackageIntegrationException
Package to the network. Iterates through the
Package adding Each individual Rule to the
network. Before update network each referenced WorkingMemory
is locked.
addPackage in interface RuleBasepkg - The package to add.
PackageIntegrationException
RuleIntegrationException - if an error prevents complete construction of the network for
the Rule.
FactException
InvalidPatternExceptionprotected void addRule(Rule rule) throws InvalidPatternException
InvalidPatternExceptionpublic void removePackage(java.lang.String packageName)
removePackage in interface RuleBase
public void removeRule(java.lang.String packageName,
java.lang.String ruleName)
removeRule in interface RuleBaseprotected abstract void removeRule(Rule rule)
protected void addWorkingMemory(WorkingMemory workingMemory, boolean keepReference)
public java.util.Set getWorkingMemories()
getWorkingMemories in interface RuleBasepublic RuleBaseConfiguration getConfiguration()
getConfiguration in interface InternalRuleBasepublic WorkingMemory newWorkingMemory(java.io.InputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException
RuleBase
The created WorkingMemory uses the default conflict
resolution strategy.
newWorkingMemory in interface RuleBaseWorkingMemory.
java.io.IOException
java.lang.ClassNotFoundExceptionWorkingMemory,
DefaultConflictResolverpublic WorkingMemory newWorkingMemory(java.io.InputStream stream, boolean keepReference) throws java.io.IOException, java.lang.ClassNotFoundException
RuleBase
The created WorkingMemory uses the default conflict
resolution strategy.
newWorkingMemory in interface RuleBaseWorkingMemory.
java.io.IOException
java.lang.ClassNotFoundExceptionWorkingMemory,
DefaultConflictResolver
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||