|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 |
---|
objectSource, sink |
Fields inherited from class org.drools.common.BaseNode |
---|
hasMemory, id, sharedCount |
Constructor Summary | |
---|---|
Rete()
|
Method Summary | |
---|---|
protected void |
addObjectSink(ObjectSink objectSink)
Adds the TupleSink so that it may receive
Tuples propagated from this TupleSource . |
void |
assertObject(InternalFactHandle handle,
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)
|
Object |
createMemory(RuleBaseConfiguration config)
|
boolean |
equals(Object object)
|
ObjectHashMap |
getObjectTypeNodes()
|
int |
hashCode()
The hashCode return is simply the unique id of the node. |
void |
remove(BaseNode node,
InternalWorkingMemory[] workingMemories)
Removes the node from teh network. |
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 |
updateSink(ObjectSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
Methods inherited from class org.drools.reteoo.ObjectSource |
---|
getSinkPropagator |
Methods inherited from class org.drools.common.BaseNode |
---|
addShare, getId, getSharedCount, hasMemory, isInUse, isShared, removeShare, setHasMemory, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.drools.common.NodeMemory |
---|
getId |
Constructor Detail |
---|
public Rete()
Method Detail |
---|
public void assertObject(InternalFactHandle handle, 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
handle
- 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
.
retractObject
in interface ObjectSink
handle
- The handle of the fact to retract.workingMemory
- The working memory session.context
- The PropagationContext
of the WorkingMemory action.
protected void addObjectSink(ObjectSink objectSink)
TupleSink
so that it may receive
Tuples
propagated from this TupleSource
.
addObjectSink
in class ObjectSource
tupleSink
- The TupleSink
to receive propagated
Tuples
.protected void removeObjectSink(ObjectSink objectSink)
ObjectSource
ObjectSink
removeObjectSink
in class ObjectSource
objectSink
- The ObjectSink
to removepublic void attach()
BaseNode
ObjectSource
or TupleSource
public void attach(InternalWorkingMemory[] workingMemories)
public void remove(BaseNode node, InternalWorkingMemory[] workingMemories)
BaseNode
ObjectSource
or TupleSource
public ObjectHashMap getObjectTypeNodes()
public Object createMemory(RuleBaseConfiguration config)
createMemory
in interface NodeMemory
public int hashCode()
BaseNode
public boolean equals(Object object)
public void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
updateSink
in class ObjectSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |