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 rightObjectSink
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 aTupleSource
which propagates aReteTuple
suitable fot the rightReteTuple
side of aBetaNode
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LeftInputAdapterNode.LiaNodeMemory
static class
LeftInputAdapterNode.RightTupleSinkAdapter
Used 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.Logger
log
protected BitMask
sinkMask
-
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 receivesFactHandle
from a parentObjectSource
and 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 receivesFactHandle
from a parentObjectSource
and 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:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classLeftTupleSource
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classLeftTupleSource
- Throws:
IOException
-
getObjectSource
public ObjectSource getObjectSource()
-
getType
public short getType()
- Specified by:
getType
in interfaceNetworkNode
- Specified by:
getType
in classLeftTupleSource
-
isLeftTupleMemoryEnabled
public boolean isLeftTupleMemoryEnabled()
- Specified by:
isLeftTupleMemoryEnabled
in classLeftTupleSource
-
getParentObjectSource
public ObjectSource getParentObjectSource()
-
doAttach
public void doAttach(BuildContext context)
-
networkUpdated
public void networkUpdated(UpdateContext updateContext)
Description copied from class:BaseNode
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 update- Specified by:
networkUpdated
in classBaseNode
-
assertObject
public void assertObject(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory)
- Specified by:
assertObject
in 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:
modifyObject
in 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:
byPassModifyToBetaNode
in interfaceObjectSink
-
doRemove
protected boolean doRemove(RuleRemovalContext context, ReteooBuilder builder)
Description copied from class:BaseNode
Removes the node from the network. Usually from the parentObjectSource
orTupleSource
-
createPeer
public LeftTuple createPeer(LeftTuple original)
- Specified by:
createPeer
in classLeftTupleSource
-
getNextObjectSinkNode
public ObjectSinkNode getNextObjectSinkNode()
Returns the next node- Specified by:
getNextObjectSinkNode
in interfaceObjectSinkNode
- Returns:
- The next ObjectSinkNode
-
setNextObjectSinkNode
public void setNextObjectSinkNode(ObjectSinkNode next)
Sets the next node- Specified by:
setNextObjectSinkNode
in interfaceObjectSinkNode
- Parameters:
next
- The next ObjectSinkNode
-
getPreviousObjectSinkNode
public ObjectSinkNode getPreviousObjectSinkNode()
Returns the previous node- Specified by:
getPreviousObjectSinkNode
in interfaceObjectSinkNode
- Returns:
- The previous ObjectSinkNode
-
setPreviousObjectSinkNode
public void setPreviousObjectSinkNode(ObjectSinkNode previous)
Sets the previous node- Specified by:
setPreviousObjectSinkNode
in interfaceObjectSinkNode
- Parameters:
previous
- The previous ObjectSinkNode
-
getObjectTypeNode
public ObjectTypeNode getObjectTypeNode()
- Specified by:
getObjectTypeNode
in classBaseNode
-
createMemory
public LeftInputAdapterNode.LiaNodeMemory createMemory(RuleBaseConfiguration config, InternalWorkingMemory wm)
- Specified by:
createMemory
in interfaceMemoryFactory<LeftInputAdapterNode.LiaNodeMemory>
-
setSourcePartitionId
public void setSourcePartitionId(BuildContext context, RuleBasePartitionId partitionId)
- Overrides:
setSourcePartitionId
in classLeftTupleSource
-
setPartitionId
public void setPartitionId(BuildContext context, RuleBasePartitionId partitionId)
Description copied from class:BaseNode
Sets the partition this node belongs to- Overrides:
setPartitionId
in classBaseNode
-
isTerminal
public boolean isTerminal()
-
-