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, NetworkNode, ObjectSink, ObjectSinkNode, Sink
public class LeftInputAdapterNode
- extends LeftTupleSource
- implements ObjectSinkNode, MemoryFactory
All asserting Facts must propagated into the right ObjectSink 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 a
TupleSource which propagates a ReteTuple suitable fot the right ReteTuple side
of a BetaNode.
- See Also:
- Serialized Form
|
Field Summary |
protected static org.slf4j.Logger |
log
|
protected boolean |
rootQueryNode
|
|
Method Summary |
void |
assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
attach(BuildContext context)
Attaches the node into the network. |
void |
byPassModifyToBetaNode(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
Memory |
createMemory(RuleBaseConfiguration config,
InternalWorkingMemory wm)
|
LeftTuple |
createPeer(LeftTuple original)
|
static void |
doDeleteObject(LeftTuple leftTuple,
PropagationContext context,
SegmentMemory sm,
InternalWorkingMemory wm,
LeftInputAdapterNode liaNode,
boolean linkOrNotify,
LeftInputAdapterNode.LiaNodeMemory lm)
|
static void |
doInsertObject(InternalFactHandle factHandle,
PropagationContext context,
LeftInputAdapterNode liaNode,
InternalWorkingMemory wm,
LeftInputAdapterNode.LiaNodeMemory lm,
boolean linkOrNotify,
boolean useLeftMemory)
|
protected void |
doRemove(RuleRemovalContext context,
ReteooBuilder builder,
InternalWorkingMemory[] workingMemories)
Removes the node from teh network. |
static void |
doUpdateObject(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory wm,
LeftInputAdapterNode liaNode,
boolean linkOrNotify,
LeftInputAdapterNode.LiaNodeMemory lm,
SegmentMemory sm)
|
boolean |
equals(Object object)
|
ObjectSinkNode |
getNextObjectSinkNode()
Returns the next node |
ObjectSource |
getObjectSource()
|
protected ObjectTypeNode |
getObjectTypeNode()
|
ObjectSource |
getParentObjectSource()
|
ObjectSinkNode |
getPreviousObjectSinkNode()
Returns the previous node |
int |
getSegmentMemoryIndex()
|
short |
getType()
|
int |
hashCode()
The hashCode return is simply the unique id of the node. |
boolean |
isLeftTupleMemoryEnabled()
|
boolean |
isRootQueryNode()
|
void |
modifyObject(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
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 oportunity
for state update |
void |
readExternal(ObjectInput in)
|
void |
retractLeftTuple(LeftTuple leftTuple,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
setNextObjectSinkNode(ObjectSinkNode next)
Sets the next node |
void |
setPreviousObjectSinkNode(ObjectSinkNode previous)
Sets the previous node |
void |
setSegmentMemoryIndex(int segmentMemoryIndex)
|
void |
updateSink(LeftTupleSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class org.drools.core.reteoo.LeftTupleSource |
addTupleSink, addTupleSink, addTupleSink, getLeftDeclaredMask, getLeftInferredMask, getLeftInputOtnId, getLeftNegativeMask, getLeftTupleSource, getObjectType, getSinkPropagator, initDeclaredMask, initInferredMask, initMasks, isInUse, removeTupleSink, setLeftInferredMask, setLeftInputOtnId, setLeftListenedProperties, setLeftTupleSource |
| Methods inherited from class org.drools.core.common.BaseNode |
addAssociation, attach, getAssociations, getId, getPartitionId, isStreamMode, remove, removeAssociation, setId, setPartitionId, toString |
log
protected static transient org.slf4j.Logger log
rootQueryNode
protected boolean rootQueryNode
LeftInputAdapterNode
public LeftInputAdapterNode()
LeftInputAdapterNode
public LeftInputAdapterNode(int id,
ObjectSource source,
BuildContext context)
- Constructus a LeftInputAdapterNode with a unique id that receives
FactHandle from a
parent ObjectSource 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
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
- Specified by:
readExternal in interface Externalizable- Overrides:
readExternal in class LeftTupleSource
- Throws:
IOException
ClassNotFoundException
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
- Specified by:
writeExternal in interface Externalizable- Overrides:
writeExternal in class LeftTupleSource
- Throws:
IOException
getObjectSource
public ObjectSource getObjectSource()
getSegmentMemoryIndex
public int getSegmentMemoryIndex()
setSegmentMemoryIndex
public void setSegmentMemoryIndex(int segmentMemoryIndex)
getType
public short getType()
- Specified by:
getType in interface NetworkNode- Specified by:
getType in class LeftTupleSource
isRootQueryNode
public boolean isRootQueryNode()
isLeftTupleMemoryEnabled
public boolean isLeftTupleMemoryEnabled()
- Specified by:
isLeftTupleMemoryEnabled in class LeftTupleSource
getParentObjectSource
public ObjectSource getParentObjectSource()
attach
public void attach(BuildContext context)
- Description copied from class:
BaseNode
- Attaches the node into the network. Usually to the parent
ObjectSource or TupleSource
- Specified by:
attach in class BaseNode
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 oportunity
for state update
- Specified by:
networkUpdated in class BaseNode
assertObject
public void assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
assertObject in interface ObjectSink
doInsertObject
public static void doInsertObject(InternalFactHandle factHandle,
PropagationContext context,
LeftInputAdapterNode liaNode,
InternalWorkingMemory wm,
LeftInputAdapterNode.LiaNodeMemory lm,
boolean linkOrNotify,
boolean useLeftMemory)
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 interface ObjectSink
byPassModifyToBetaNode
public void byPassModifyToBetaNode(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
byPassModifyToBetaNode in interface ObjectSink
doRemove
protected void doRemove(RuleRemovalContext context,
ReteooBuilder builder,
InternalWorkingMemory[] workingMemories)
- Description copied from class:
BaseNode
- Removes the node from teh network. Usually from the parent
ObjectSource or TupleSource
- Specified by:
doRemove in class BaseNode
createPeer
public LeftTuple createPeer(LeftTuple original)
- Specified by:
createPeer in class LeftTupleSource
updateSink
public void updateSink(LeftTupleSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
updateSink in class LeftTupleSource
getNextObjectSinkNode
public ObjectSinkNode getNextObjectSinkNode()
- Returns the next node
- Specified by:
getNextObjectSinkNode in interface ObjectSinkNode
- Returns:
- The next ObjectSinkNode
setNextObjectSinkNode
public void setNextObjectSinkNode(ObjectSinkNode next)
- Sets the next node
- Specified by:
setNextObjectSinkNode in interface ObjectSinkNode
- Parameters:
next - The next ObjectSinkNode
getPreviousObjectSinkNode
public ObjectSinkNode getPreviousObjectSinkNode()
- Returns the previous node
- Specified by:
getPreviousObjectSinkNode in interface ObjectSinkNode
- Returns:
- The previous ObjectSinkNode
setPreviousObjectSinkNode
public void setPreviousObjectSinkNode(ObjectSinkNode previous)
- Sets the previous node
- Specified by:
setPreviousObjectSinkNode in interface ObjectSinkNode
- Parameters:
previous - The previous ObjectSinkNode
hashCode
public int hashCode()
- Description copied from class:
BaseNode
- The hashCode return is simply the unique id of the node. It is expected that base classes will also implement equals(Object object).
- Overrides:
hashCode in class BaseNode
equals
public boolean equals(Object object)
- Overrides:
equals in class Object
getObjectTypeNode
protected ObjectTypeNode getObjectTypeNode()
- Specified by:
getObjectTypeNode in class LeftTupleSource
createMemory
public Memory createMemory(RuleBaseConfiguration config,
InternalWorkingMemory wm)
- Specified by:
createMemory in interface MemoryFactory
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.