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
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
-
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
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()
- Description copied from class:
BaseNode
- Attaches the node into the network. Usually to the parent
ObjectSource
or TupleSource
- Specified by:
attach
in class BaseNode
- See Also:
BaseNode.attach()
attach
public void attach(InternalWorkingMemory[] workingMemories)
- Specified by:
attach
in class BaseNode
- See Also:
BaseNode.attach(org.drools.common.InternalWorkingMemory[])
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
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 Object createMemory(RuleBaseConfiguration config)
- Specified by:
createMemory
in interface NodeMemory
Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.