Package org.drools.core.reteoo
Class RightInputAdapterNode
- java.lang.Object
-
- org.drools.core.common.BaseNode
-
- org.drools.core.reteoo.ObjectSource
-
- org.drools.core.reteoo.RightInputAdapterNode
-
- All Implemented Interfaces:
java.io.Serializable
,org.drools.base.common.NetworkNode
,MemoryFactory<PathMemory>
,LeftTupleNode
,LeftTupleSink
,LeftTupleSinkNode
,PathEndNode
,Sink
public class RightInputAdapterNode extends ObjectSource implements LeftTupleSinkNode, PathEndNode
When joining a subnetwork into the main network again, RightInputAdapterNode adapts the subnetwork's tuple into a fact in order right join it with the tuple being propagated in the main network.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RightInputAdapterNode.RiaPathMemory
-
Nested classes/interfaces inherited from interface org.drools.core.reteoo.PathEndNode
PathEndNode.PathMemSpec
-
-
Field Summary
-
Fields inherited from class org.drools.core.reteoo.ObjectSource
alphaNodeHashingThreshold, alphaNodeRangeIndexThreshold, declaredMask, inferredMask, sink, source
-
Fields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId, partitionsEnabled
-
-
Constructor Summary
Constructors Constructor Description RightInputAdapterNode()
RightInputAdapterNode(int id, LeftTupleSource source, LeftTupleSource startTupleSource, BuildContext context)
Constructor specifying the unique id of the node in the Rete network, the position of the propagatingFactHandleImpl
inReteTuple
and the source that propagates the receiveReteTuple
s.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAssociation(BuildContext context, org.kie.api.definition.rule.Rule rule)
org.drools.core.util.bitmask.BitMask
calculateDeclaredMask(org.drools.base.base.ObjectType modifiedType, java.util.List<java.lang.String> settableProperties)
LeftTuple
createLeftTuple(InternalFactHandle factHandle, boolean leftTupleMemoryEnabled)
LeftTuple
createLeftTuple(InternalFactHandle factHandle, LeftTuple leftTuple, Sink sink)
LeftTuple
createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, LeftTuple currentLeftChild, LeftTuple currentRightChild, Sink sink, boolean leftTupleMemoryEnabled)
LeftTuple
createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, Sink sink)
LeftTuple
createLeftTuple(LeftTuple leftTuple, Sink sink, PropagationContext pctx, boolean leftTupleMemoryEnabled)
RightInputAdapterNode.RiaPathMemory
createMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator)
Creates and return the node memorySubnetworkTuple
createPeer(LeftTuple original)
void
doAttach(BuildContext context)
protected boolean
doRemove(RuleRemovalContext context, ReteooBuilder builder)
Removes the node from the network.boolean
equals(java.lang.Object object)
SegmentMemory.SegmentPrototype[]
getEagerSegmentPrototypes()
org.drools.core.util.bitmask.BitMask
getLeftInferredMask()
ObjectTypeNode.Id
getLeftInputOtnId()
LeftTupleSource
getLeftTupleSource()
LeftTupleSinkNode
getNextLeftTupleSinkNode()
Returns the next nodeint
getObjectCount()
PathEndNode[]
getPathEndNodes()
int
getPathIndex()
PathEndNode.PathMemSpec
getPathMemSpec()
PathEndNode.PathMemSpec
getPathMemSpec(TerminalNode removingTN)
used during network build time, potentially during rule removal time.LeftTupleNode[]
getPathNodes()
LeftTupleSinkNode
getPreviousLeftTupleSinkNode()
Returns the previous nodeSegmentMemory.SegmentPrototype[]
getSegmentPrototypes()
LeftTupleSinkPropagator
getSinkPropagator()
LeftTupleSource
getStartTupleSource()
short
getType()
boolean
hasPathNode(LeftTupleNode node)
boolean
isLeftTupleMemoryEnabled()
void
networkUpdated(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 updatevoid
nullPathMemSpec()
boolean
removeAssociation(org.kie.api.definition.rule.Rule rule, RuleRemovalContext context)
Removes the association to the given rule from the associations map.void
resetPathMemSpec(TerminalNode removingTN)
void
setEagerSegmentPrototypes(SegmentMemory.SegmentPrototype[] eagerSegmentPrototypes)
void
setLeftInputOtnId(ObjectTypeNode.Id leftInputOtnId)
void
setNextLeftTupleSinkNode(LeftTupleSinkNode next)
Sets the next nodevoid
setObjectCount(int count)
void
setPathEndNodes(PathEndNode[] pathEndNodes)
void
setPathMemSpec(PathEndNode.PathMemSpec pathMemSpec)
void
setPreviousLeftTupleSinkNode(LeftTupleSinkNode previous)
Sets the previous nodevoid
setSegmentPrototypes(SegmentMemory.SegmentPrototype[] smems)
void
setTupleSource(LeftTupleSource tupleSource)
java.lang.String
toString()
void
updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory wm)
-
Methods inherited from class org.drools.core.reteoo.ObjectSource
addObjectSink, getDeclaredMask, getObjectSinkPropagator, getObjectTypeNode, getParentObjectSource, getRuleBase, initDeclaredMask, isInUse, removeObjectSink, resetInferredMask, setObjectSinkPropagator, setParentObjectSource, setPartitionId, setPartitionIdWithSinks, setSourcePartitionId, updateMask
-
Methods inherited from class org.drools.core.common.BaseNode
addAssociatedTerminal, addAssociation, attach, getAssociatedRules, getAssociatedTerminalsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hasAssociatedTerminal, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociatedTerminal, setId, setPartitionsEnabled, setStreamMode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.reteoo.LeftTupleSink
setPartitionIdWithSinks
-
Methods inherited from interface org.drools.core.common.MemoryFactory
getMemoryId
-
Methods inherited from interface org.drools.base.common.NetworkNode
addAssociatedTerminal, getAssociatedRules, getAssociatedTerminalsSize, getId, getPartitionId, getSinks, hasAssociatedTerminal, isAssociatedWith, isRightInputIsRiaNode, removeAssociatedTerminal
-
Methods inherited from interface org.drools.core.reteoo.PathEndNode
calculatePathMemSpec
-
-
-
-
Constructor Detail
-
RightInputAdapterNode
public RightInputAdapterNode()
-
RightInputAdapterNode
public RightInputAdapterNode(int id, LeftTupleSource source, LeftTupleSource startTupleSource, BuildContext context)
Constructor specifying the unique id of the node in the Rete network, the position of the propagatingFactHandleImpl
inReteTuple
and the source that propagates the receiveReteTuple
s.
- Parameters:
id
- Unique idsource
- TheTupleSource
which propagates the receivedReteTuple
-
-
Method Detail
-
getPathMemSpec
public PathEndNode.PathMemSpec getPathMemSpec()
- Specified by:
getPathMemSpec
in interfacePathEndNode
-
getPathMemSpec
public PathEndNode.PathMemSpec getPathMemSpec(TerminalNode removingTN)
used during network build time, potentially during rule removal time.- Specified by:
getPathMemSpec
in interfacePathEndNode
- Parameters:
removingTN
-- Returns:
-
nullPathMemSpec
public void nullPathMemSpec()
- Specified by:
nullPathMemSpec
in interfacePathEndNode
-
setPathMemSpec
public void setPathMemSpec(PathEndNode.PathMemSpec pathMemSpec)
- Specified by:
setPathMemSpec
in interfacePathEndNode
-
resetPathMemSpec
public void resetPathMemSpec(TerminalNode removingTN)
- Specified by:
resetPathMemSpec
in interfacePathEndNode
-
setSegmentPrototypes
public void setSegmentPrototypes(SegmentMemory.SegmentPrototype[] smems)
- Specified by:
setSegmentPrototypes
in interfacePathEndNode
-
getSegmentPrototypes
public SegmentMemory.SegmentPrototype[] getSegmentPrototypes()
- Specified by:
getSegmentPrototypes
in interfacePathEndNode
-
getEagerSegmentPrototypes
public SegmentMemory.SegmentPrototype[] getEagerSegmentPrototypes()
- Specified by:
getEagerSegmentPrototypes
in interfacePathEndNode
-
setEagerSegmentPrototypes
public void setEagerSegmentPrototypes(SegmentMemory.SegmentPrototype[] eagerSegmentPrototypes)
- Specified by:
setEagerSegmentPrototypes
in interfacePathEndNode
-
setPathEndNodes
public void setPathEndNodes(PathEndNode[] pathEndNodes)
- Specified by:
setPathEndNodes
in interfacePathEndNode
-
getPathEndNodes
public PathEndNode[] getPathEndNodes()
- Specified by:
getPathEndNodes
in interfacePathEndNode
-
getStartTupleSource
public LeftTupleSource getStartTupleSource()
- Specified by:
getStartTupleSource
in interfacePathEndNode
-
getPathIndex
public int getPathIndex()
- Specified by:
getPathIndex
in interfaceLeftTupleNode
-
getObjectCount
public int getObjectCount()
- Specified by:
getObjectCount
in interfaceLeftTupleNode
-
setObjectCount
public void setObjectCount(int count)
- Specified by:
setObjectCount
in interfaceLeftTupleNode
-
createMemory
public RightInputAdapterNode.RiaPathMemory createMemory(RuleBaseConfiguration config, ReteEvaluator reteEvaluator)
Creates and return the node memory- Specified by:
createMemory
in interfaceMemoryFactory<PathMemory>
-
createPeer
public SubnetworkTuple createPeer(LeftTuple original)
- Specified by:
createPeer
in interfaceLeftTupleSink
-
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- Overrides:
networkUpdated
in classObjectSource
-
doRemove
protected boolean doRemove(RuleRemovalContext context, ReteooBuilder builder)
Description copied from class:BaseNode
Removes the node from the network. Usually from the parentObjectSource
orTupleSource
- Overrides:
doRemove
in classObjectSource
-
isLeftTupleMemoryEnabled
public boolean isLeftTupleMemoryEnabled()
- Specified by:
isLeftTupleMemoryEnabled
in interfaceLeftTupleSink
-
getNextLeftTupleSinkNode
public LeftTupleSinkNode getNextLeftTupleSinkNode()
Returns the next node- Specified by:
getNextLeftTupleSinkNode
in interfaceLeftTupleSinkNode
- Returns:
- The next TupleSinkNode
-
setNextLeftTupleSinkNode
public void setNextLeftTupleSinkNode(LeftTupleSinkNode next)
Sets the next node- Specified by:
setNextLeftTupleSinkNode
in interfaceLeftTupleSinkNode
- Parameters:
next
- The next TupleSinkNode
-
getPreviousLeftTupleSinkNode
public LeftTupleSinkNode getPreviousLeftTupleSinkNode()
Returns the previous node- Specified by:
getPreviousLeftTupleSinkNode
in interfaceLeftTupleSinkNode
- Returns:
- The previous TupleSinkNode
-
setPreviousLeftTupleSinkNode
public void setPreviousLeftTupleSinkNode(LeftTupleSinkNode previous)
Sets the previous node- Specified by:
setPreviousLeftTupleSinkNode
in interfaceLeftTupleSinkNode
- Parameters:
previous
- The previous TupleSinkNode
-
getType
public short getType()
- Specified by:
getType
in interfaceorg.drools.base.common.NetworkNode
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
createLeftTuple
public LeftTuple createLeftTuple(InternalFactHandle factHandle, boolean leftTupleMemoryEnabled)
- Specified by:
createLeftTuple
in interfaceLeftTupleSink
-
createLeftTuple
public LeftTuple createLeftTuple(InternalFactHandle factHandle, LeftTuple leftTuple, Sink sink)
- Specified by:
createLeftTuple
in interfaceLeftTupleSink
-
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple, Sink sink, PropagationContext pctx, boolean leftTupleMemoryEnabled)
- Specified by:
createLeftTuple
in interfaceLeftTupleSink
-
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, Sink sink)
- Specified by:
createLeftTuple
in interfaceLeftTupleSink
-
createLeftTuple
public LeftTuple createLeftTuple(LeftTuple leftTuple, RightTuple rightTuple, LeftTuple currentLeftChild, LeftTuple currentRightChild, Sink sink, boolean leftTupleMemoryEnabled)
- Specified by:
createLeftTuple
in interfaceLeftTupleSink
-
getLeftTupleSource
public LeftTupleSource getLeftTupleSource()
- Specified by:
getLeftTupleSource
in interfaceLeftTupleNode
-
setTupleSource
public void setTupleSource(LeftTupleSource tupleSource)
-
getLeftInputOtnId
public ObjectTypeNode.Id getLeftInputOtnId()
- Specified by:
getLeftInputOtnId
in interfaceLeftTupleSink
-
setLeftInputOtnId
public void setLeftInputOtnId(ObjectTypeNode.Id leftInputOtnId)
- Specified by:
setLeftInputOtnId
in interfaceLeftTupleSink
-
calculateDeclaredMask
public org.drools.core.util.bitmask.BitMask calculateDeclaredMask(org.drools.base.base.ObjectType modifiedType, java.util.List<java.lang.String> settableProperties)
- Specified by:
calculateDeclaredMask
in classObjectSource
-
getLeftInferredMask
public org.drools.core.util.bitmask.BitMask getLeftInferredMask()
- Specified by:
getLeftInferredMask
in interfaceLeftTupleSink
-
updateSink
public void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory wm)
- Specified by:
updateSink
in classObjectSource
-
getPathNodes
public LeftTupleNode[] getPathNodes()
- Specified by:
getPathNodes
in interfacePathEndNode
-
hasPathNode
public boolean hasPathNode(LeftTupleNode node)
- Specified by:
hasPathNode
in interfacePathEndNode
-
getSinkPropagator
public LeftTupleSinkPropagator getSinkPropagator()
- Specified by:
getSinkPropagator
in interfaceLeftTupleNode
-
addAssociation
public void addAssociation(BuildContext context, org.kie.api.definition.rule.Rule rule)
- Overrides:
addAssociation
in classBaseNode
-
removeAssociation
public boolean removeAssociation(org.kie.api.definition.rule.Rule rule, RuleRemovalContext context)
Description copied from class:BaseNode
Removes the association to the given rule from the associations map.- Overrides:
removeAssociation
in classBaseNode
-
-