org.drools.reteoo
Class PropagationQueuingNode
java.lang.Object
org.drools.common.BaseNode
org.drools.reteoo.ObjectSource
org.drools.reteoo.PropagationQueuingNode
- All Implemented Interfaces:
- Externalizable, Serializable, NetworkNode, NodeMemory, ObjectSink, ObjectSinkNode, Sink
public class PropagationQueuingNode
- extends ObjectSource
- implements ObjectSinkNode, NodeMemory
A node that will add the propagation to the working memory actions queue,
in order to allow multiple threads to concurrently assert objects to multiple
entry points.
- See Also:
- Serialized Form
|
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)
|
long |
calculateDeclaredMask(List<String> settableProperties)
|
Memory |
createMemory(RuleBaseConfiguration config)
|
boolean |
equals(Object object)
|
ObjectSinkNode |
getNextObjectSinkNode()
Returns the next node |
ObjectSinkNode |
getPreviousObjectSinkNode()
Returns the previous node |
short |
getType()
|
int |
hashCode()
The hashCode return is simply the unique id of the node. |
boolean |
isObjectMemoryEnabled()
|
void |
modifyObject(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
propagateActions(InternalWorkingMemory workingMemory)
Propagate all queued actions (asserts and retracts). |
void |
readExternal(ObjectInput in)
|
void |
retractObject(InternalFactHandle handle,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
setNextObjectSinkNode(ObjectSinkNode next)
Sets the next node |
void |
setObjectMemoryEnabled(boolean objectMemoryOn)
|
void |
setPreviousObjectSinkNode(ObjectSinkNode previous)
Sets the previous node |
void |
updateSink(ObjectSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
|
void |
updateSinkOnAttach(BuildContext context,
PropagationContext propagationContext,
InternalWorkingMemory workingMemory)
|
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class org.drools.reteoo.ObjectSource |
addObjectSink, doCollectAncestors, doRemove, getDeclaredMask, getObjectTypeNode, getParentObjectSource, getSinkPropagator, initDeclaredMask, isInUse, needsMaskUpdate, networkUpdated, removeObjectSink, resetInferredMask, updateMask |
| Methods inherited from class org.drools.common.BaseNode |
addAssociation, attach, collectAncestors, getAssociations, getId, getPartitionId, remove, removeAssociation, setPartitionId, toString, updateSinkOnAttach |
PropagationQueuingNode
public PropagationQueuingNode()
PropagationQueuingNode
public PropagationQueuingNode(int id,
ObjectSource objectSource,
BuildContext context)
- Construct a
PropagationQueuingNode that will queue up
propagations until it the engine reaches a safe propagation point,
when all the queued facts are propagated.
- Parameters:
id - Node's IDobjectSource - Node's object sourcecontext -
calculateDeclaredMask
public long calculateDeclaredMask(List<String> settableProperties)
- Specified by:
calculateDeclaredMask in class ObjectSource
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
- Specified by:
readExternal in interface Externalizable- Overrides:
readExternal in class ObjectSource
- Throws:
IOException
ClassNotFoundException
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
- Specified by:
writeExternal in interface Externalizable- Overrides:
writeExternal in class ObjectSource
- Throws:
IOException
getType
public short getType()
- Specified by:
getType in interface NetworkNode
updateSink
public void updateSink(ObjectSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
updateSink in class ObjectSource
- See Also:
ObjectSource.updateSink(org.drools.reteoo.ObjectSink, org.drools.spi.PropagationContext, org.drools.common.InternalWorkingMemory)
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
updateSinkOnAttach
public void updateSinkOnAttach(BuildContext context,
PropagationContext propagationContext,
InternalWorkingMemory workingMemory)
- Specified by:
updateSinkOnAttach in class BaseNode
getNextObjectSinkNode
public ObjectSinkNode getNextObjectSinkNode()
- Description copied from interface:
ObjectSinkNode
- Returns the next node
- Specified by:
getNextObjectSinkNode in interface ObjectSinkNode
- Returns:
- The next LinkedListNode
- See Also:
ObjectSinkNode.getNextObjectSinkNode()
getPreviousObjectSinkNode
public ObjectSinkNode getPreviousObjectSinkNode()
- Description copied from interface:
ObjectSinkNode
- Returns the previous node
- Specified by:
getPreviousObjectSinkNode in interface ObjectSinkNode
- Returns:
- The previous LinkedListNode
- See Also:
ObjectSinkNode.getPreviousObjectSinkNode()
setNextObjectSinkNode
public void setNextObjectSinkNode(ObjectSinkNode next)
- Description copied from interface:
ObjectSinkNode
- Sets the next node
- Specified by:
setNextObjectSinkNode in interface ObjectSinkNode
- Parameters:
next - The next LinkedListNode- See Also:
ObjectSinkNode.setNextObjectSinkNode(org.drools.reteoo.ObjectSinkNode)
setPreviousObjectSinkNode
public void setPreviousObjectSinkNode(ObjectSinkNode previous)
- Description copied from interface:
ObjectSinkNode
- Sets the previous node
- Specified by:
setPreviousObjectSinkNode in interface ObjectSinkNode
- Parameters:
previous - The previous LinkedListNode- See Also:
ObjectSinkNode.setPreviousObjectSinkNode(org.drools.reteoo.ObjectSinkNode)
isObjectMemoryEnabled
public boolean isObjectMemoryEnabled()
assertObject
public void assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
assertObject in interface ObjectSink
- See Also:
ObjectSink.assertObject(InternalFactHandle, org.drools.spi.PropagationContext, org.drools.common.InternalWorkingMemory)
retractObject
public void retractObject(InternalFactHandle handle,
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
propagateActions
public void propagateActions(InternalWorkingMemory workingMemory)
- Propagate all queued actions (asserts and retracts).
This method implementation is based on optimistic behavior to avoid the
use of locks. There may eventually be a minimum wasted effort, but overall
it will be better than paying for the lock's cost.
- Parameters:
workingMemory -
setObjectMemoryEnabled
public void setObjectMemoryEnabled(boolean objectMemoryOn)
createMemory
public Memory createMemory(RuleBaseConfiguration config)
- Specified by:
createMemory in interface NodeMemory
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
Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.