Package org.drools.core.reteoo
Class LeftInputAdapterNode
java.lang.Object
org.drools.core.common.BaseNode
org.drools.core.reteoo.LeftTupleSource
org.drools.core.reteoo.LeftInputAdapterNode
- All Implemented Interfaces:
Serializable,NetworkNode,MemoryFactory<LeftInputAdapterNode.LiaNodeMemory>,LeftTupleNode,ObjectSink,ObjectSinkNode,Sink
- Direct Known Subclasses:
AlphaTerminalNode
public class LeftInputAdapterNode
extends LeftTupleSource
implements ObjectSinkNode, MemoryFactory<LeftInputAdapterNode.LiaNodeMemory>
All asserting Facts must propagated into the right
ObjectSink side of a BetaNode, if this is the first Pattern
then there are no BetaNodes to propagate to. LeftInputAdapter is used to adapt an ObjectSink propagation into a
TupleSource which propagates a ReteTuple suitable fot the right ReteTuple side
of a BetaNode.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUsed with the updateSink method, so that the parent ObjectSource can update the TupleSinkstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerprotected org.drools.util.bitmask.BitMaskFields inherited from class org.drools.core.reteoo.LeftTupleSource
leftDeclaredMask, leftInferredMask, leftInput, leftNegativeMask, sinkFields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId -
Constructor Summary
ConstructorsConstructorDescriptionLeftInputAdapterNode(int id, ObjectSource source, BuildContext context) Constructus a LeftInputAdapterNode with a unique id that receivesFactHandlefrom a parentObjectSourceand adds it to a given pattern in the resulting Tuples. -
Method Summary
Modifier and TypeMethodDescriptionvoidassertObject(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator) voidbyPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) createMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator) createPeer(TupleImpl original) voiddoAttach(BuildContext context) static voiddoDeleteObject(TupleImpl leftTuple, PropagationContext context, SegmentMemory sm, ReteEvaluator reteEvaluator, LeftInputAdapterNode liaNode, boolean linkOrNotify, LeftInputAdapterNode.LiaNodeMemory lm) static voiddoInsertObject(InternalFactHandle factHandle, PropagationContext context, LeftInputAdapterNode liaNode, ReteEvaluator reteEvaluator, LeftInputAdapterNode.LiaNodeMemory lm, boolean linkOrNotify, boolean useLeftMemory) static List<PathMemory>doInsertSegmentMemory(ReteEvaluator reteEvaluator, boolean linkOrNotify, LeftInputAdapterNode.LiaNodeMemory lm, SegmentMemory sm, TupleImpl leftTuple, boolean streamMode) static voiddoInsertSegmentMemoryWithFlush(ReteEvaluator reteEvaluator, boolean notifySegment, LeftInputAdapterNode.LiaNodeMemory lm, SegmentMemory sm, TupleImpl leftTuple, boolean streamMode) protected booleandoRemove(RuleRemovalContext context, ReteooBuilder builder) Removes the node from the network.static voiddoUpdateObject(TupleImpl leftTuple, PropagationContext context, ReteEvaluator reteEvaluator, LeftInputAdapterNode liaNode, boolean linkOrNotify, LeftInputAdapterNode.LiaNodeMemory lm, SegmentMemory sm) booleanReturns the next nodeReturns the previous nodeintgetType()booleanbooleanvoidmodifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) voidnetworkUpdated(UpdateContext updateContext) A method that is called for all nodes whose network below them changed, after the change is complete, providing them with an opportunity for state updateprotected TupleImplprocessDeletesFromModify(ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator, ObjectTypeNodeId otnId) voidretractLeftTuple(TupleImpl leftTuple, PropagationContext context, ReteEvaluator reteEvaluator) voidSets the next nodevoidsetPartitionId(BuildContext context, RuleBasePartitionId partitionId) Sets the partition this node belongs tovoidsetPreviousObjectSinkNode(ObjectSinkNode previous) Sets the previous nodevoidsetSourcePartitionId(BuildContext context, RuleBasePartitionId partitionId) Methods inherited from class org.drools.core.reteoo.LeftTupleSource
addTupleSink, addTupleSink, addTupleSink, getFirstLeftTupleSinkIgnoreRemoving, getLeftDeclaredMask, getLeftInferredMask, getLeftInputOtnId, getLeftInputPattern, getLeftNegativeMask, getLeftTupleSource, getObjectCount, getObjectType, getObjectTypeForPropertyReactivity, getPathIndex, getSinkPropagator, initDeclaredMask, initInferredMask, initMasks, isInUse, removeTupleSink, setLeftInferredMask, setLeftInputOtnId, setLeftListenedProperties, setLeftTupleSource, setNodeConstraintsPropertyReactiveMask, setObjectCount, setPartitionIdWithSinks, setSourcePartitionIdMethods 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, setStreamMode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.drools.core.common.MemoryFactory
getMemoryIdMethods inherited from interface org.drools.base.common.NetworkNode
addAssociatedTerminal, getAssociatedRules, getAssociatedTerminalsSize, getId, getPartitionId, getSinks, hasAssociatedTerminal, isAssociatedWith, isRightInputIsRiaNode, removeAssociatedTerminalMethods inherited from interface org.drools.core.reteoo.ObjectSinkNode
setPartitionIdWithSinks
-
Field Details
-
log
protected static final transient org.slf4j.Logger log -
sinkMask
protected org.drools.util.bitmask.BitMask sinkMask
-
-
Constructor Details
-
LeftInputAdapterNode
public LeftInputAdapterNode() -
LeftInputAdapterNode
Constructus a LeftInputAdapterNode with a unique id that receivesFactHandlefrom a parentObjectSourceand adds it to a given pattern in the resulting Tuples.- Parameters:
id- The unique id of this node in the current Rete networksource- The parent node, where Facts are propagated from
-
-
Method Details
-
getObjectSource
-
getType
public int getType()- Specified by:
getTypein interfaceNetworkNode- Specified by:
getTypein classLeftTupleSource
-
isLeftTupleMemoryEnabled
public boolean isLeftTupleMemoryEnabled()- Specified by:
isLeftTupleMemoryEnabledin classLeftTupleSource
-
getParentObjectSource
-
doAttach
-
networkUpdated
Description copied from class:BaseNodeA method that is called for all nodes whose network below them changed, after the change is complete, providing them with an opportunity for state update- Specified by:
networkUpdatedin classBaseNode
-
assertObject
public void assertObject(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
assertObjectin interfaceObjectSink
-
doInsertObject
public static void doInsertObject(InternalFactHandle factHandle, PropagationContext context, LeftInputAdapterNode liaNode, ReteEvaluator reteEvaluator, LeftInputAdapterNode.LiaNodeMemory lm, boolean linkOrNotify, boolean useLeftMemory) -
doInsertSegmentMemoryWithFlush
public static void doInsertSegmentMemoryWithFlush(ReteEvaluator reteEvaluator, boolean notifySegment, LeftInputAdapterNode.LiaNodeMemory lm, SegmentMemory sm, TupleImpl leftTuple, boolean streamMode) -
doInsertSegmentMemory
public static List<PathMemory> doInsertSegmentMemory(ReteEvaluator reteEvaluator, boolean linkOrNotify, LeftInputAdapterNode.LiaNodeMemory lm, SegmentMemory sm, TupleImpl leftTuple, boolean streamMode) -
doDeleteObject
public static void doDeleteObject(TupleImpl leftTuple, PropagationContext context, SegmentMemory sm, ReteEvaluator reteEvaluator, LeftInputAdapterNode liaNode, boolean linkOrNotify, LeftInputAdapterNode.LiaNodeMemory lm) -
doUpdateObject
public static void doUpdateObject(TupleImpl leftTuple, PropagationContext context, ReteEvaluator reteEvaluator, LeftInputAdapterNode liaNode, boolean linkOrNotify, LeftInputAdapterNode.LiaNodeMemory lm, SegmentMemory sm) -
retractLeftTuple
public void retractLeftTuple(TupleImpl leftTuple, PropagationContext context, ReteEvaluator reteEvaluator) -
modifyObject
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
modifyObjectin interfaceObjectSink
-
processDeletesFromModify
protected TupleImpl processDeletesFromModify(ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator, ObjectTypeNodeId otnId) -
byPassModifyToBetaNode
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
byPassModifyToBetaNodein interfaceObjectSink
-
doRemove
Description copied from class:BaseNodeRemoves the node from the network. Usually from the parentObjectSourceorTupleSource -
createPeer
-
getNextObjectSinkNode
Returns the next node- Specified by:
getNextObjectSinkNodein interfaceObjectSinkNode- Returns:
- The next ObjectSinkNode
-
setNextObjectSinkNode
Sets the next node- Specified by:
setNextObjectSinkNodein interfaceObjectSinkNode- Parameters:
next- The next ObjectSinkNode
-
getPreviousObjectSinkNode
Returns the previous node- Specified by:
getPreviousObjectSinkNodein interfaceObjectSinkNode- Returns:
- The previous ObjectSinkNode
-
setPreviousObjectSinkNode
Sets the previous node- Specified by:
setPreviousObjectSinkNodein interfaceObjectSinkNode- Parameters:
previous- The previous ObjectSinkNode
-
equals
-
getObjectTypeNode
- Specified by:
getObjectTypeNodein classBaseNode
-
createMemory
public LeftInputAdapterNode.LiaNodeMemory createMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator) - Specified by:
createMemoryin interfaceMemoryFactory<LeftInputAdapterNode.LiaNodeMemory>
-
setSourcePartitionId
- Overrides:
setSourcePartitionIdin classLeftTupleSource
-
setPartitionId
Description copied from class:BaseNodeSets the partition this node belongs to- Overrides:
setPartitionIdin classBaseNode
-
isTerminal
public boolean isTerminal()
-