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:
Externalizable,Serializable,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.- See Also:
- Serialized Form
-
-
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
associations, hashcode, id, memoryId, partitionId, partitionsEnabled
-
-
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, 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, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociation, setId, setPartitionsEnabled, 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, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getPartitionId, 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
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classLeftTupleSource- Throws:
IOExceptionClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classLeftTupleSource- Throws:
IOException
-
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, InternalWorkingMemory workingMemory)
- Specified by:
assertObjectin interfaceObjectSink
-
doInsertObject
public static void doInsertObject(InternalFactHandle factHandle, PropagationContext context, LeftInputAdapterNode liaNode, InternalWorkingMemory wm, LeftInputAdapterNode.LiaNodeMemory lm, boolean linkOrNotify, boolean useLeftMemory)
-
doInsertSegmentMemoryWithFlush
public static void doInsertSegmentMemoryWithFlush(InternalWorkingMemory wm, boolean notifySegment, LeftInputAdapterNode.LiaNodeMemory lm, SegmentMemory sm, LeftTuple leftTuple, boolean streamMode)
-
doInsertSegmentMemory
public static List<PathMemory> doInsertSegmentMemory(InternalWorkingMemory wm, boolean linkOrNotify, LeftInputAdapterNode.LiaNodeMemory lm, SegmentMemory sm, LeftTuple leftTuple, boolean streamMode)
-
doDeleteObject
public static void doDeleteObject(LeftTuple leftTuple, PropagationContext context, SegmentMemory sm, InternalWorkingMemory wm, LeftInputAdapterNode liaNode, boolean linkOrNotify, LeftInputAdapterNode.LiaNodeMemory lm)
-
doUpdateObject
public static void doUpdateObject(LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory wm, LeftInputAdapterNode liaNode, boolean linkOrNotify, LeftInputAdapterNode.LiaNodeMemory lm, SegmentMemory sm)
-
retractLeftTuple
public void retractLeftTuple(LeftTuple leftTuple, PropagationContext context, InternalWorkingMemory workingMemory)
-
modifyObject
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory)
- Specified by:
modifyObjectin interfaceObjectSink
-
processDeletesFromModify
protected LeftTuple processDeletesFromModify(ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory, ObjectTypeNode.Id otnId)
-
byPassModifyToBetaNode
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory)
- 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, InternalWorkingMemory wm)
- 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()
-
-