org.drools.reteoo
Class EntryPointNode
java.lang.Object
org.drools.common.BaseNode
org.drools.reteoo.ObjectSource
org.drools.reteoo.EntryPointNode
- All Implemented Interfaces:
- Externalizable, Serializable, NetworkNode, ObjectSink, Sink
public class EntryPointNode
- extends ObjectSource
- implements Externalizable, ObjectSink
A node that is an entry point into the Rete network.
As we move the design to support network partitions and concurrent processing
of parts of the network, we also need to support multiple, independent entry
points and this class represents that.
It replaces the function of the Rete Node class in previous designs.
- See Also:
ObjectTypeNode,
Serialized Form
|
Method Summary |
void |
addObjectSink(ObjectSink objectSink)
Adds the ObjectSink so that it may receive
Objects propagated from this ObjectSource. |
void |
assertActivation(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
This is the entry point into the network for all asserted Facts. |
void |
assertObject(InternalFactHandle handle,
PropagationContext context,
ObjectTypeConf objectTypeConf,
InternalWorkingMemory workingMemory)
|
void |
assertQuery(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
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)
|
EntryPoint |
getEntryPoint()
|
Map<ObjectType,ObjectTypeNode> |
getObjectTypeNodes()
|
short |
getType()
|
int |
hashCode()
The hashCode return is simply the unique id of the node. |
boolean |
isObjectMemoryEnabled()
|
void |
modifyActivation(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
modifyObject(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
modifyObject(InternalFactHandle handle,
PropagationContext context,
ObjectTypeConf objectTypeConf,
InternalWorkingMemory workingMemory)
|
void |
modifyQuery(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
readExternal(ObjectInput in)
|
protected void |
removeObjectSink(ObjectSink objectSink)
Removes the ObjectSink |
void |
retractActivation(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
retractObject(InternalFactHandle handle,
PropagationContext context,
ObjectTypeConf objectTypeConf,
InternalWorkingMemory workingMemory)
Retract a fact object from this RuleBase and the specified
WorkingMemory. |
void |
retractQuery(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
setObjectMemoryEnabled(boolean objectMemoryEnabled)
|
String |
toString()
|
void |
updateSink(ObjectSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
updateSinkOnAttach(BuildContext context,
PropagationContext propagationContext,
InternalWorkingMemory workingMemory)
|
void |
writeExternal(ObjectOutput out)
|
EntryPointNode
public EntryPointNode()
EntryPointNode
public EntryPointNode(int id,
ObjectSource objectSource,
BuildContext context)
EntryPointNode
public EntryPointNode(int id,
RuleBasePartitionId partitionId,
boolean partitionsEnabled,
ObjectSource objectSource,
EntryPoint entryPoint)
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
- Specified by:
readExternal in interface Externalizable- Overrides:
readExternal in class ObjectSource
- Throws:
IOException
ClassNotFoundException
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
- Specified by:
writeExternal in interface Externalizable- Overrides:
writeExternal in class ObjectSource
- Throws:
IOException
getType
public short getType()
- Specified by:
getType in interface NetworkNode
getEntryPoint
public EntryPoint getEntryPoint()
- Returns:
- the entryPoint
assertQuery
public void assertQuery(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
retractQuery
public void retractQuery(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
modifyQuery
public void modifyQuery(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
assertActivation
public void assertActivation(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
retractActivation
public void retractActivation(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
modifyActivation
public void modifyActivation(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
assertObject
public void assertObject(InternalFactHandle handle,
PropagationContext context,
ObjectTypeConf objectTypeConf,
InternalWorkingMemory workingMemory)
modifyObject
public void modifyObject(InternalFactHandle handle,
PropagationContext context,
ObjectTypeConf objectTypeConf,
InternalWorkingMemory workingMemory)
modifyObject
public void modifyObject(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
modifyObject in interface ObjectSink
assertObject
public void assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
- This is the entry point into the network for all asserted Facts. Iterates a cache
of matching
ObjectTypdeNodes asserting the Fact. If the cache does not
exist it first iterates and builds the cache.
- Specified by:
assertObject in interface ObjectSink
- Parameters:
factHandle - The FactHandle of the fact to assertcontext - The PropagationContext of the WorkingMemory actionworkingMemory - The working memory session.
retractObject
public void retractObject(InternalFactHandle handle,
PropagationContext context,
ObjectTypeConf objectTypeConf,
InternalWorkingMemory workingMemory)
- Retract a fact object from this
RuleBase and the specified
WorkingMemory.
- Parameters:
handle - The handle of the fact to retract.workingMemory - The working memory session.
addObjectSink
public void addObjectSink(ObjectSink objectSink)
- Adds the
ObjectSink so that it may receive
Objects propagated from this ObjectSource.
- Overrides:
addObjectSink in class ObjectSource
- Parameters:
objectSink - The ObjectSink to receive propagated
Objects. Rete only accepts ObjectTypeNodes
as parameters to this method, though.
removeObjectSink
protected void removeObjectSink(ObjectSink objectSink)
- Description copied from class:
ObjectSource
- Removes the
ObjectSink
- Overrides:
removeObjectSink in class ObjectSource
- Parameters:
objectSink - The ObjectSink to remove
attach
public void attach(BuildContext context)
- Description copied from class:
BaseNode
- Attaches the node into the network. Usually to the parent
ObjectSource or TupleSource
- Specified by:
attach in class BaseNode
updateSinkOnAttach
public void updateSinkOnAttach(BuildContext context,
PropagationContext propagationContext,
InternalWorkingMemory workingMemory)
- Specified by:
updateSinkOnAttach in class BaseNode
doRemove
protected void doRemove(RuleRemovalContext context,
ReteooBuilder builder,
InternalWorkingMemory[] workingMemories)
- Description copied from class:
BaseNode
- Removes the node from teh network. Usually from the parent
ObjectSource or TupleSource
- Overrides:
doRemove in class ObjectSource
doCollectAncestors
protected void doCollectAncestors(NodeSet nodeSet)
- Overrides:
doCollectAncestors in class ObjectSource
getObjectTypeNodes
public Map<ObjectType,ObjectTypeNode> getObjectTypeNodes()
hashCode
public int hashCode()
- Description copied from class:
BaseNode
- The hashCode return is simply the unique id of the node. It is expected that base classes will also implement equals(Object object).
- Overrides:
hashCode in class BaseNode
equals
public boolean equals(Object object)
- Overrides:
equals in class Object
updateSink
public void updateSink(ObjectSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
updateSink in class ObjectSource
isObjectMemoryEnabled
public boolean isObjectMemoryEnabled()
setObjectMemoryEnabled
public void setObjectMemoryEnabled(boolean objectMemoryEnabled)
toString
public String toString()
- Overrides:
toString in class BaseNode
byPassModifyToBetaNode
public void byPassModifyToBetaNode(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
byPassModifyToBetaNode in interface ObjectSink
calculateDeclaredMask
public long calculateDeclaredMask(List<String> settableProperties)
- Specified by:
calculateDeclaredMask in class ObjectSource
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.