|
||||||||||
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 FormField Summary |
---|
Fields inherited from class org.drools.reteoo.ObjectSource |
---|
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()
Attaches the node into the network. |
void |
attach(InternalWorkingMemory[] workingMemories)
|
protected void |
doRemove(RuleRemovalContext context,
ReteooBuilder builder,
BaseNode node,
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()
|
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()
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 |
writeExternal(ObjectOutput out)
|
Methods inherited from class org.drools.reteoo.ObjectSource |
---|
getParentObjectSource, getSinkPropagator, isInUse |
Methods inherited from class org.drools.common.BaseNode |
---|
addAssociation, getAssociations, getId, getPartitionId, remove, removeAssociation, setPartitionId, toString |
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)
ObjectTypdeNode
s asserting the Fact. If the cache does not
exist it first iteraes and builds the cache.
assertObject
in interface ObjectSink
factHandle
- 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 ObjectSink
public void addObjectSink(ObjectSink objectSink)
ObjectSink
so that it may receive
Objects
propagated from this ObjectSource
.
addObjectSink
in class ObjectSource
objectSink
- The ObjectSink
to receive propagated
Objects
. Rete only accepts ObjectTypeNode
s
as parameters to this method, though.protected void removeObjectSink(ObjectSink objectSink)
ObjectSource
ObjectSink
removeObjectSink
in class ObjectSource
objectSink
- The ObjectSink
to removepublic void attach()
BaseNode
ObjectSource
or TupleSource
attach
in class BaseNode
public void attach(InternalWorkingMemory[] workingMemories)
attach
in class BaseNode
public void networkUpdated()
BaseNode
networkUpdated
in class ObjectSource
protected void doRemove(RuleRemovalContext context, ReteooBuilder builder, BaseNode node, InternalWorkingMemory[] workingMemories)
BaseNode
ObjectSource
or TupleSource
doRemove
in class ObjectSource
public 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 BaseNode
public boolean equals(Object object)
equals
in class Object
public void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
updateSink
in class ObjectSource
public boolean isObjectMemoryEnabled()
public void setObjectMemoryEnabled(boolean objectMemoryEnabled)
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class ObjectSource
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class ObjectSource
IOException
ClassNotFoundException
public Map<EntryPoint,EntryPointNode> getEntryPointNodes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |