|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.drools.common.BaseNode
org.drools.reteoo.ObjectSource
org.drools.reteoo.Rete
public class Rete
The Rete-OO network.
The Rete class is the root Object. All objects are asserted into
the Rete node where it propagates to all matching ObjectTypeNodes.
The first time an instance of a Class type is asserted it does a full
iteration of all ObjectTyppeNodes looking for matches, any matches are
then cached in a HashMap which is used for future assertions.
While Rete extends ObjectSource nad implements ObjectSink it nulls the
methods attach(), remove() and updateNewNode() as this is the root node
they are no applicable
ObjectTypeNode,
Serialized Form| Field Summary |
|---|
| Fields inherited from class org.drools.reteoo.ObjectSource |
|---|
declaredMask, inferredMask, sink, source |
| Fields inherited from class org.drools.common.BaseNode |
|---|
associations, id, partitionId, partitionsEnabled |
| Constructor Summary | |
|---|---|
Rete()
|
|
Rete(InternalRuleBase ruleBase)
|
|
| Method Summary | |
|---|---|
void |
addObjectSink(ObjectSink objectSink)
Adds the ObjectSink so that it may receive
Objects propagated from this ObjectSource. |
void |
assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
This is the entry point into the network for all asserted Facts. |
void |
attach(BuildContext context)
Attaches the node into the network. |
void |
byPassModifyToBetaNode(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
long |
calculateDeclaredMask(List<String> settableProperties)
|
protected void |
doCollectAncestors(NodeSet nodeSet)
|
protected void |
doRemove(RuleRemovalContext context,
ReteooBuilder builder,
InternalWorkingMemory[] workingMemories)
Removes the node from teh network. |
boolean |
equals(Object object)
|
EntryPointNode |
getEntryPointNode(EntryPoint entryPoint)
|
Map<EntryPoint,EntryPointNode> |
getEntryPointNodes()
|
List<ObjectTypeNode> |
getObjectTypeNodes()
|
Map<ObjectType,ObjectTypeNode> |
getObjectTypeNodes(EntryPoint entryPoint)
|
InternalRuleBase |
getRuleBase()
|
short |
getType()
|
int |
hashCode()
The hashCode return is simply the unique id of the node. |
boolean |
isObjectMemoryEnabled()
|
void |
modifyObject(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
networkUpdated(UpdateContext updateContext)
A method that is called for all nodes whose network below them changed, after the change is complete, providing them with an oportunity for state update |
void |
readExternal(ObjectInput in)
|
protected void |
removeObjectSink(ObjectSink objectSink)
Removes the ObjectSink |
void |
retractObject(InternalFactHandle handle,
PropagationContext context,
InternalWorkingMemory workingMemory)
Retract a fact object from this RuleBase and the specified
WorkingMemory. |
void |
setObjectMemoryEnabled(boolean objectMemoryEnabled)
|
void |
updateSink(ObjectSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
updateSinkOnAttach(BuildContext context,
PropagationContext propagationContext,
InternalWorkingMemory workingMemory)
|
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class org.drools.reteoo.ObjectSource |
|---|
getDeclaredMask, getObjectTypeNode, getParentObjectSource, getSinkPropagator, initDeclaredMask, isInUse, needsMaskUpdate, resetInferredMask, updateMask |
| Methods inherited from class org.drools.common.BaseNode |
|---|
addAssociation, attach, collectAncestors, getAssociations, getId, getPartitionId, remove, removeAssociation, setPartitionId, toString, updateSinkOnAttach |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.drools.common.NetworkNode |
|---|
getId, getPartitionId |
| Constructor Detail |
|---|
public Rete()
public Rete(InternalRuleBase ruleBase)
| Method Detail |
|---|
public void assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
ObjectTypdeNodes asserting the Fact. If the cache does not
exist it first iteraes and builds the cache.
assertObject in interface ObjectSinkfactHandle - The FactHandle of the fact to assertcontext - The PropagationContext of the WorkingMemory actionworkingMemory - The working memory session.
public void retractObject(InternalFactHandle handle,
PropagationContext context,
InternalWorkingMemory workingMemory)
RuleBase and the specified
WorkingMemory.
handle - The handle of the fact to retract.workingMemory - The working memory session.
public void modifyObject(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory)
modifyObject in interface ObjectSinkpublic void addObjectSink(ObjectSink objectSink)
ObjectSink so that it may receive
Objects propagated from this ObjectSource.
addObjectSink in class ObjectSourceobjectSink - The ObjectSink to receive propagated
Objects. Rete only accepts ObjectTypeNodes
as parameters to this method, though.protected void removeObjectSink(ObjectSink objectSink)
ObjectSourceObjectSink
removeObjectSink in class ObjectSourceobjectSink - The ObjectSink to removepublic void attach(BuildContext context)
BaseNodeObjectSource or TupleSource
attach in class BaseNode
public void updateSinkOnAttach(BuildContext context,
PropagationContext propagationContext,
InternalWorkingMemory workingMemory)
updateSinkOnAttach in class BaseNodepublic void networkUpdated(UpdateContext updateContext)
BaseNode
networkUpdated in class ObjectSource
protected void doRemove(RuleRemovalContext context,
ReteooBuilder builder,
InternalWorkingMemory[] workingMemories)
BaseNodeObjectSource or TupleSource
doRemove in class ObjectSourceprotected void doCollectAncestors(NodeSet nodeSet)
doCollectAncestors in class ObjectSourcepublic EntryPointNode getEntryPointNode(EntryPoint entryPoint)
public List<ObjectTypeNode> getObjectTypeNodes()
public Map<ObjectType,ObjectTypeNode> getObjectTypeNodes(EntryPoint entryPoint)
public InternalRuleBase getRuleBase()
public int hashCode()
BaseNode
hashCode in class BaseNodepublic boolean equals(Object object)
equals in class Object
public void updateSink(ObjectSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
updateSink in class ObjectSourcepublic boolean isObjectMemoryEnabled()
public void setObjectMemoryEnabled(boolean objectMemoryEnabled)
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizablewriteExternal in class ObjectSourceIOException
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class ObjectSourceIOException
ClassNotFoundExceptionpublic Map<EntryPoint,EntryPointNode> getEntryPointNodes()
public void byPassModifyToBetaNode(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory)
byPassModifyToBetaNode in interface ObjectSinkpublic long calculateDeclaredMask(List<String> settableProperties)
calculateDeclaredMask in class ObjectSourcepublic short getType()
getType in interface NetworkNode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||