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:
Externalizable
,Serializable
,MemoryFactory<RightInputAdapterNode.RiaNodeMemory>
,NetworkNode
,LeftTupleNode
,LeftTupleSink
,LeftTupleSinkNode
,PathEndNode
,Sink
public class RightInputAdapterNode extends ObjectSource implements LeftTupleSinkNode, PathEndNode, MemoryFactory<RightInputAdapterNode.RiaNodeMemory>
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.RiaNodeMemory
-
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
-
Methods inherited from class org.drools.core.reteoo.ObjectSource
addObjectSink, getDeclaredMask, getKnowledgeBase, getObjectSinkPropagator, getObjectTypeNode, getParentObjectSource, initDeclaredMask, isInUse, removeObjectSink, resetInferredMask, setObjectSinkPropagator, setParentObjectSource, setPartitionId, setPartitionIdWithSinks, setSourcePartitionId, updateMask
-
Methods inherited from class org.drools.core.common.BaseNode
addAssociation, attach, getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, 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.core.common.NetworkNode
getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getPartitionId, isAssociatedWith
-
Methods inherited from interface org.drools.core.reteoo.PathEndNode
calculatePathMemSpec, 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
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classObjectSource
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classObjectSource
- Throws:
IOException
-
getPathMemSpec
public PathEndNode.PathMemSpec getPathMemSpec()
- Specified by:
getPathMemSpec
in interfacePathEndNode
-
resetPathMemSpec
public void resetPathMemSpec(TerminalNode removingTN)
- Specified by:
resetPathMemSpec
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()
-
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.RiaNodeMemory createMemory(RuleBaseConfiguration config, InternalWorkingMemory wm)
Creates and return the node memory- Specified by:
createMemory
in interfaceMemoryFactory<RightInputAdapterNode.RiaNodeMemory>
-
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
-
setLeftTupleMemoryEnabled
public void setLeftTupleMemoryEnabled(boolean tupleMemoryEnabled)
- Specified by:
setLeftTupleMemoryEnabled
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 interfaceNetworkNode
-
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 BitMask calculateDeclaredMask(Class modifiedClass, List<String> settableProperties)
- Specified by:
calculateDeclaredMask
in classObjectSource
-
getLeftInferredMask
public BitMask getLeftInferredMask()
- Specified by:
getLeftInferredMask
in interfaceLeftTupleSink
-
updateSink
public void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
- 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)
Description copied from class:BaseNode
Removes the association to the given rule from the associations map.- Overrides:
removeAssociation
in classBaseNode
-
-