|
||||||||||
| 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 Map |
globals
|
protected String |
id
|
protected CompositePackageClassLoader |
packageClassLoader
|
protected Map |
pkgs
|
protected Map |
processes
|
protected ObjectHashSet |
statefulSessions
WeakHashMap to keep references of WorkingMemories but allow them to be garbage collected |
protected int |
workingMemoryCounter
|
| Fields inherited from interface org.drools.RuleBase |
|---|
LEAPS, RETEOO |
| Constructor Summary | |
|---|---|
AbstractRuleBase()
Default constructor - for Externalizable. |
|
AbstractRuleBase(String id,
RuleBaseConfiguration config,
FactHandleFactory factHandleFactory)
Construct. |
|
| Method Summary | |
|---|---|
void |
addPackage(Package newPkg)
Add a Package to the network. |
void |
addProcess(IProcess process)
|
protected void |
addRule(Rule rule)
|
protected void |
addStatefulSession(StatefulSession statefulSession)
|
void |
disposeStatefulSession(StatefulSession statefulSession)
|
void |
doReadExternal(ObjectInput stream,
Object[] objects)
Handles the read serialization of the Package. |
void |
doWriteExternal(ObjectOutput stream,
Object[] objects)
Handles the write serialization of the Package. |
RuleBaseConfiguration |
getConfiguration()
|
FactHandleFactory |
getFactHandleFactory()
|
Map |
getGlobals()
|
String |
getId()
|
Package[] |
getPackages()
|
IProcess |
getProcess(String id)
|
IProcess[] |
getProcesses()
|
StatefulSession[] |
getStatefulSessions()
|
InternalWorkingMemory[] |
getWorkingMemories()
|
FactHandleFactory |
newFactHandleFactory()
|
StatefulSession |
newStatefulSession()
Create a new WorkingMemory session for this
RuleBase. |
abstract StatefulSession |
newStatefulSession(boolean keepReference)
Create a new WorkingMemory session for this
RuleBase. |
StatefulSession |
newStatefulSession(InputStream stream)
RuleBases handle the returning of a Serialized WorkingMemory pass as an InputStream. |
StatefulSession |
newStatefulSession(InputStream stream,
boolean keepReference)
RuleBases handle the returning of a Serialized WorkingMemory pass as an InputStream. |
void |
removePackage(String packageName)
|
void |
removeProcess(String id)
|
protected abstract void |
removeRule(Rule rule)
|
void |
removeRule(String packageName,
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, retractObject |
| Methods inherited from interface org.drools.RuleBase |
|---|
newStatelessSession |
| Methods inherited from interface java.io.Externalizable |
|---|
readExternal, writeExternal |
| Field Detail |
|---|
protected String id
protected int workingMemoryCounter
protected RuleBaseConfiguration config
protected Map pkgs
protected Map processes
protected transient CompositePackageClassLoader packageClassLoader
protected FactHandleFactory factHandleFactory
protected Map globals
protected transient ObjectHashSet statefulSessions
| Constructor Detail |
|---|
public AbstractRuleBase()
public AbstractRuleBase(String id, RuleBaseConfiguration config, FactHandleFactory factHandleFactory)
rete - The rete network.| Method Detail |
|---|
public void doWriteExternal(ObjectOutput stream, Object[] objects) throws IOException
IOExceptionpublic void doReadExternal(ObjectInput stream, Object[] objects) throws IOException, ClassNotFoundException
IOException
ClassNotFoundExceptionpublic String getId()
getId in interface InternalRuleBasepublic StatefulSession newStatefulSession()
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.
newStatefulSession in interface RuleBaseWorkingMemory.RuleBasepublic abstract StatefulSession newStatefulSession(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.
newStatefulSession in interface RuleBaseWorkingMemory.RuleBasepublic void disposeStatefulSession(StatefulSession statefulSession)
disposeStatefulSession in interface InternalRuleBasepublic FactHandleFactory getFactHandleFactory()
RuleBasepublic FactHandleFactory newFactHandleFactory()
newFactHandleFactory in interface InternalRuleBasepublic IProcess[] getProcesses()
public Package[] getPackages()
getPackages in interface RuleBasepublic 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(String packageName)
removePackage in interface RuleBasepublic void removeRule(String packageName, String ruleName)
removeRule in interface RuleBaseprotected abstract void removeRule(Rule rule)
public void addProcess(IProcess process)
addProcess in interface RuleBasepublic void removeProcess(String id)
removeProcess in interface RuleBasepublic IProcess getProcess(String id)
getProcess in interface RuleBaseprotected void addStatefulSession(StatefulSession statefulSession)
public StatefulSession[] getStatefulSessions()
getStatefulSessions in interface RuleBasepublic InternalWorkingMemory[] getWorkingMemories()
public RuleBaseConfiguration getConfiguration()
getConfiguration in interface InternalRuleBasepublic StatefulSession newStatefulSession(InputStream stream) throws IOException, ClassNotFoundException
RuleBase
The created WorkingMemory uses the default conflict
resolution strategy.
newStatefulSession in interface RuleBaseWorkingMemory.
IOException
ClassNotFoundExceptionWorkingMemory,
DefaultConflictResolverpublic StatefulSession newStatefulSession(InputStream stream, boolean keepReference) throws IOException, ClassNotFoundException
RuleBase
The created WorkingMemory uses the default conflict
resolution strategy.
newStatefulSession in interface RuleBaseWorkingMemory.
IOException
ClassNotFoundExceptionWorkingMemory,
DefaultConflictResolver
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||