Package org.drools.core.reteoo
Class EntryPointNode
java.lang.Object
org.drools.core.common.BaseNode
org.drools.core.reteoo.ObjectSource
org.drools.core.reteoo.EntryPointNode
- All Implemented Interfaces:
Serializable,NetworkNode,ObjectSink,Sink
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerprotected Map<ObjectType,ObjectTypeNode> The object type nodes under this nodeprotected ObjectTypeNodeFields inherited from class org.drools.core.reteoo.ObjectSource
alphaNodeHashingThreshold, alphaNodeRangeIndexThreshold, declaredMask, inferredMask, sink, sourceFields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId -
Constructor Summary
ConstructorsConstructorDescriptionEntryPointNode(int id, RuleBasePartitionId partitionId, ObjectSource objectSource, EntryPointId entryPoint) EntryPointNode(int id, ObjectSource objectSource, BuildContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObjectSink(ObjectSink objectSink) Adds theObjectSinkso that it may receiveObjectspropagated from thisObjectSource.voidassertActivation(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator) voidassertObject(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator) This is the entry point into the network for all asserted Facts.voidassertObject(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator) voidattach()voidbyPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) org.drools.util.bitmask.BitMaskcalculateDeclaredMask(Pattern pattern, ObjectType modifiedType, List<String> settableProperties) voiddoAttach(BuildContext context) protected booleandoRemove(RuleRemovalContext context, ReteooBuilder builder) Removes the node from the network.booleanintgetType()voidimmediateDeleteObject(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator) voidmodifyActivation(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator) voidmodifyObject(InternalFactHandle handle, PropagationContext pctx, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator) voidmodifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) voidpropagateRetract(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator) voidremoveObjectSink(ObjectSink objectSink) Removes theObjectSinkvoidremoveObjectType(ObjectType objectType) static voidremoveRightTuplesMatchingOTN(PropagationContext pctx, ReteEvaluator reteEvaluator, ModifyPreviousTuples modifyPreviousTuples, ObjectTypeNode node, int partition) voidretractActivation(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator) voidretractObject(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator) Retract a fact object from thisRuleBaseand the specifiedWorkingMemory.voidtoString()voidupdateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory) Methods inherited from class org.drools.core.reteoo.ObjectSource
getDeclaredMask, getObjectSinkPropagator, getObjectTypeNode, getParentObjectSource, getRuleBase, initDeclaredMask, isInUse, networkUpdated, resetInferredMask, setObjectSinkPropagator, setParentObjectSource, setPartitionId, setPartitionIdWithSinks, setSourcePartitionId, updateMaskMethods inherited from class org.drools.core.common.BaseNode
addAssociatedTerminal, addAssociation, addAssociation, attach, getAssociatedRules, getAssociatedTerminalsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hasAssociatedTerminal, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociatedTerminal, removeAssociation, setId, setStreamModeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.drools.base.common.NetworkNode
addAssociatedTerminal, getAssociatedRules, getAssociatedTerminalsSize, getId, getPartitionId, getSinks, hasAssociatedTerminal, isAssociatedWith, isRightInputIsRiaNode, removeAssociatedTerminal
-
Field Details
-
log
protected static final transient org.slf4j.Logger log -
objectTypeNodes
The object type nodes under this node -
queryNode
-
-
Constructor Details
-
EntryPointNode
public EntryPointNode() -
EntryPointNode
-
EntryPointNode
public EntryPointNode(int id, RuleBasePartitionId partitionId, ObjectSource objectSource, EntryPointId entryPoint)
-
-
Method Details
-
setupParallelExecution
-
getTypeConfReg
-
getType
public int getType()- Specified by:
getTypein interfaceNetworkNode
-
getEntryPoint
- Returns:
- the entryPoint
-
getQueryNode
-
assertActivation
public void assertActivation(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator) -
retractActivation
public void retractActivation(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator) -
modifyActivation
public void modifyActivation(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator) -
assertObject
public void assertObject(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator) -
modifyObject
public void modifyObject(InternalFactHandle handle, PropagationContext pctx, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator) -
removeRightTuplesMatchingOTN
public static void removeRightTuplesMatchingOTN(PropagationContext pctx, ReteEvaluator reteEvaluator, ModifyPreviousTuples modifyPreviousTuples, ObjectTypeNode node, int partition) -
modifyObject
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
modifyObjectin interfaceObjectSink
-
assertObject
public void assertObject(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator) This is the entry point into the network for all asserted Facts. Iterates a cache of matchingObjectTypdeNodes asserting the Fact. If the cache does not exist it first iterates and builds the cache.- Specified by:
assertObjectin interfaceObjectSink- Parameters:
factHandle- The FactHandle of the fact to assertcontext- ThePropagationContextof theWorkingMemoryactionreteEvaluator- The working memory session.
-
retractObject
public void retractObject(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator) Retract a fact object from thisRuleBaseand the specifiedWorkingMemory.- Parameters:
handle- The handle of the fact to retract.reteEvaluator- The working memory session.
-
immediateDeleteObject
public void immediateDeleteObject(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator) -
propagateRetract
public void propagateRetract(InternalFactHandle handle, PropagationContext context, ObjectTypeConf objectTypeConf, ReteEvaluator reteEvaluator) -
addObjectSink
Adds theObjectSinkso that it may receiveObjectspropagated from thisObjectSource.- Overrides:
addObjectSinkin classObjectSource- Parameters:
objectSink- TheObjectSinkto receive propagatedObjects. Rete only acceptsObjectTypeNodes as parameters to this method, though.
-
removeObjectSink
Description copied from class:ObjectSourceRemoves theObjectSink- Overrides:
removeObjectSinkin classObjectSource- Parameters:
objectSink- TheObjectSinkto remove
-
removeObjectType
-
attach
public void attach() -
doAttach
-
doRemove
Description copied from class:BaseNodeRemoves the node from the network. Usually from the parentObjectSourceorTupleSource- Overrides:
doRemovein classObjectSource
-
getObjectTypeNodes
-
equals
-
updateSink
public void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory) - Specified by:
updateSinkin classObjectSource
-
toString
-
byPassModifyToBetaNode
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
byPassModifyToBetaNodein interfaceObjectSink
-
calculateDeclaredMask
public org.drools.util.bitmask.BitMask calculateDeclaredMask(Pattern pattern, ObjectType modifiedType, List<String> settableProperties) - Specified by:
calculateDeclaredMaskin classObjectSource
-