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:
MemoryFactory<LeftInputAdapterNode.LiaNodeMemory>,NetworkNode,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 rightObjectSinkside of a BetaNode, if this is the first Pattern then there are no BetaNodes to propagate to.LeftInputAdapteris used to adapt an ObjectSink propagation into aTupleSourcewhich propagates aReteTuplesuitable fot the rightReteTupleside of aBetaNode.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLeftInputAdapterNode.LiaNodeMemorystatic classLeftInputAdapterNode.RightTupleSinkAdapterUsed with the updateSink method, so that the parent ObjectSource can update the TupleSink
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlogprotected BitMasksinkMask-
Fields inherited from class org.drools.core.reteoo.LeftTupleSource
leftDeclaredMask, leftInferredMask, leftInput, leftNegativeMask, sink
-
Fields inherited from class org.drools.core.common.BaseNode
associatedTerminals, associations, hashcode, id, memoryId, partitionId, partitionsEnabled, posInSegment
-
-
Constructor Summary
Constructors Constructor Description LeftInputAdapterNode()LeftInputAdapterNode(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
-
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, setSourcePartitionId
-
Methods inherited from class org.drools.core.common.BaseNode
addAssociation, addAssociation, attach, getAssociatedRules, getAssociatedTerminals, getAssociationsSize, getId, getMemoryId, getPartitionId, getPosInSegment, getSinks, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociation, setId, setPartitionsEnabled, setPosInSegment, setStreamMode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.common.MemoryFactory
getMemoryId
-
Methods inherited from interface org.drools.core.common.NetworkNode
getAssociatedRules, getAssociatedTerminals, getId, getPartitionId, getPosInSegment, getSinks, isAssociatedWith
-
Methods inherited from interface org.drools.core.reteoo.ObjectSinkNode
setPartitionIdWithSinks
-
-
-
-
Field Detail
-
log
protected static final transient org.slf4j.Logger log
-
sinkMask
protected BitMask sinkMask
-
-
Constructor Detail
-
LeftInputAdapterNode
public LeftInputAdapterNode()
-
LeftInputAdapterNode
public LeftInputAdapterNode(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.- Parameters:
id- The unique id of this node in the current Rete networksource- The parent node, where Facts are propagated from
-
-
Method Detail
-
getObjectSource
public ObjectSource getObjectSource()
-
getType
public short getType()
- Specified by:
getTypein interfaceNetworkNode- Specified by:
getTypein classLeftTupleSource
-
isLeftTupleMemoryEnabled
public boolean isLeftTupleMemoryEnabled()
- Specified by:
isLeftTupleMemoryEnabledin classLeftTupleSource
-
getParentObjectSource
public ObjectSource getParentObjectSource()
-
doAttach
public void doAttach(BuildContext context)
-
networkUpdated
public void networkUpdated(UpdateContext updateContext)
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, LeftTuple leftTuple, boolean streamMode)
-
doInsertSegmentMemory
public static List<PathMemory> doInsertSegmentMemory(ReteEvaluator reteEvaluator, boolean linkOrNotify, LeftInputAdapterNode.LiaNodeMemory lm, SegmentMemory sm, LeftTuple leftTuple, boolean streamMode)
-
doDeleteObject
public static void doDeleteObject(LeftTuple leftTuple, PropagationContext context, SegmentMemory sm, ReteEvaluator reteEvaluator, LeftInputAdapterNode liaNode, boolean linkOrNotify, LeftInputAdapterNode.LiaNodeMemory lm)
-
doUpdateObject
public static void doUpdateObject(LeftTuple leftTuple, PropagationContext context, ReteEvaluator reteEvaluator, LeftInputAdapterNode liaNode, boolean linkOrNotify, LeftInputAdapterNode.LiaNodeMemory lm, SegmentMemory sm)
-
retractLeftTuple
public void retractLeftTuple(LeftTuple leftTuple, PropagationContext context, ReteEvaluator reteEvaluator)
-
modifyObject
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator)
- Specified by:
modifyObjectin interfaceObjectSink
-
processDeletesFromModify
protected LeftTuple processDeletesFromModify(ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator, ObjectTypeNode.Id otnId)
-
byPassModifyToBetaNode
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator)
- Specified by:
byPassModifyToBetaNodein interfaceObjectSink
-
doRemove
protected boolean doRemove(RuleRemovalContext context, ReteooBuilder builder)
Description copied from class:BaseNodeRemoves the node from the network. Usually from the parentObjectSourceorTupleSource
-
createPeer
public LeftTuple createPeer(LeftTuple original)
- Specified by:
createPeerin classLeftTupleSource
-
getNextObjectSinkNode
public ObjectSinkNode getNextObjectSinkNode()
Returns the next node- Specified by:
getNextObjectSinkNodein interfaceObjectSinkNode- Returns:
- The next ObjectSinkNode
-
setNextObjectSinkNode
public void setNextObjectSinkNode(ObjectSinkNode next)
Sets the next node- Specified by:
setNextObjectSinkNodein interfaceObjectSinkNode- Parameters:
next- The next ObjectSinkNode
-
getPreviousObjectSinkNode
public ObjectSinkNode getPreviousObjectSinkNode()
Returns the previous node- Specified by:
getPreviousObjectSinkNodein interfaceObjectSinkNode- Returns:
- The previous ObjectSinkNode
-
setPreviousObjectSinkNode
public void setPreviousObjectSinkNode(ObjectSinkNode previous)
Sets the previous node- Specified by:
setPreviousObjectSinkNodein interfaceObjectSinkNode- Parameters:
previous- The previous ObjectSinkNode
-
getObjectTypeNode
public ObjectTypeNode getObjectTypeNode()
- Specified by:
getObjectTypeNodein classBaseNode
-
createMemory
public LeftInputAdapterNode.LiaNodeMemory createMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator)
- Specified by:
createMemoryin interfaceMemoryFactory<LeftInputAdapterNode.LiaNodeMemory>
-
setSourcePartitionId
public void setSourcePartitionId(BuildContext context, RuleBasePartitionId partitionId)
- Overrides:
setSourcePartitionIdin classLeftTupleSource
-
setPartitionId
public void setPartitionId(BuildContext context, RuleBasePartitionId partitionId)
Description copied from class:BaseNodeSets the partition this node belongs to- Overrides:
setPartitionIdin classBaseNode
-
isTerminal
public boolean isTerminal()
-
-