org.drools.common
Class PropagationContextImpl

java.lang.Object
  extended by org.drools.common.PropagationContextImpl
All Implemented Interfaces:
Externalizable, Serializable, org.drools.runtime.rule.PropagationContext

public class PropagationContextImpl
extends Object
implements PropagationContext

See Also:
Serialized Form

Field Summary
 int activeActivations
           
 int dormantActivations
           
 
Fields inherited from interface org.drools.runtime.rule.PropagationContext
ASSERTION, EXPIRATION, MODIFICATION, RETRACTION, RULE_ADDITION, RULE_REMOVAL, typeDescr
 
Constructor Summary
PropagationContextImpl()
           
PropagationContextImpl(long number, int type, Rule rule, LeftTuple leftTuple, InternalFactHandle factHandle)
           
PropagationContextImpl(long number, int type, Rule rule, LeftTuple leftTuple, InternalFactHandle factHandle, int activeActivations, int dormantActivations, EntryPoint entryPoint)
           
PropagationContextImpl(long number, int type, Rule rule, LeftTuple leftTuple, InternalFactHandle factHandle, int activeActivations, int dormantActivations, EntryPoint entryPoint, long modificationMask)
           
PropagationContextImpl(long number, int type, Rule rule, LeftTuple leftTuple, InternalFactHandle factHandle, int activeActivations, int dormantActivations, EntryPoint entryPoint, long modificationMask, Class<?> modifiedClass, MarshallerReaderContext readerContext)
           
PropagationContextImpl(long number, int type, Rule rule, LeftTuple leftTuple, InternalFactHandle factHandle, int activeActivations, int dormantActivations, EntryPoint entryPoint, MarshallerReaderContext readerContext)
           
 
Method Summary
 PropagationContext adaptModificationMaskForObjectType(ObjectType type, InternalWorkingMemory workingMemory)
           
 void addInsertAction(WorkingMemoryAction action)
           
 void cleanReaderContext()
           
 void evaluateActionQueue(InternalWorkingMemory workingMemory)
           
 int getActiveActivations()
           
 WindowTupleList getActiveWindowTupleList()
           
 int getDormantActivations()
           
 EntryPoint getEntryPoint()
           
 FactHandle getFactHandle()
           
 InternalFactHandle getFactHandleOrigin()
           
 LeftTuple getLeftTupleOrigin()
           
 long getModificationMask()
           
 ObjectType getObjectType()
           
 int getOriginOffset()
          Returns the offset of the fact that initiated this propagation in the current propagation context.
 ObjectHashSet getPropagationAttemptsMemory()
          Keeps a list of nodes to which a propagation attempt fail because the node was unlinked.
 long getPropagationNumber()
           
 LinkedList<WorkingMemoryAction> getQueue2()
           
 MarshallerReaderContext getReaderContext()
           
 org.drools.definition.rule.Rule getRule()
           
 Rule getRuleOrigin()
           
 int getType()
           
 boolean isPropagating(ObjectTypeNode otn)
           
 void readExternal(ObjectInput in)
           
 void releaseResources()
           
 void removeInsertAction(WorkingMemoryAction action)
           
 void setActiveWindowTupleList(WindowTupleList list)
           
 void setCurrentPropagatingOTN(ObjectTypeNode otn)
          When L&R unlinking is active, we need to keep track of the OTN that triggered this propagation.
 void setEntryPoint(EntryPoint entryPoint)
           
 void setFactHandle(InternalFactHandle factHandle)
           
 void setModificationMask(long modificationMask)
           
 void setObjectType(ObjectType objectType)
           
 void setOriginOffset(int originOffset)
          Sets the origin offset to the given offset.
 void setShouldPropagateAll(Object node)
           
 boolean shouldPropagateAll()
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

activeActivations

public int activeActivations

dormantActivations

public int dormantActivations
Constructor Detail

PropagationContextImpl

public PropagationContextImpl()

PropagationContextImpl

public PropagationContextImpl(long number,
                              int type,
                              Rule rule,
                              LeftTuple leftTuple,
                              InternalFactHandle factHandle)

PropagationContextImpl

public PropagationContextImpl(long number,
                              int type,
                              Rule rule,
                              LeftTuple leftTuple,
                              InternalFactHandle factHandle,
                              int activeActivations,
                              int dormantActivations,
                              EntryPoint entryPoint)

PropagationContextImpl

public PropagationContextImpl(long number,
                              int type,
                              Rule rule,
                              LeftTuple leftTuple,
                              InternalFactHandle factHandle,
                              int activeActivations,
                              int dormantActivations,
                              EntryPoint entryPoint,
                              long modificationMask)

PropagationContextImpl

public PropagationContextImpl(long number,
                              int type,
                              Rule rule,
                              LeftTuple leftTuple,
                              InternalFactHandle factHandle,
                              int activeActivations,
                              int dormantActivations,
                              EntryPoint entryPoint,
                              MarshallerReaderContext readerContext)

PropagationContextImpl

public PropagationContextImpl(long number,
                              int type,
                              Rule rule,
                              LeftTuple leftTuple,
                              InternalFactHandle factHandle,
                              int activeActivations,
                              int dormantActivations,
                              EntryPoint entryPoint,
                              long modificationMask,
                              Class<?> modifiedClass,
                              MarshallerReaderContext readerContext)
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

getPropagationNumber

public long getPropagationNumber()
Specified by:
getPropagationNumber in interface org.drools.runtime.rule.PropagationContext

cleanReaderContext

public void cleanReaderContext()

getRuleOrigin

public Rule getRuleOrigin()

getRule

public org.drools.definition.rule.Rule getRule()
Specified by:
getRule in interface org.drools.runtime.rule.PropagationContext

getLeftTupleOrigin

public LeftTuple getLeftTupleOrigin()

getFactHandleOrigin

public InternalFactHandle getFactHandleOrigin()

getFactHandle

public FactHandle getFactHandle()
Specified by:
getFactHandle in interface org.drools.runtime.rule.PropagationContext

getType

public int getType()
Specified by:
getType in interface org.drools.runtime.rule.PropagationContext

getActiveActivations

public int getActiveActivations()

getDormantActivations

public int getDormantActivations()

releaseResources

public void releaseResources()

getEntryPoint

public EntryPoint getEntryPoint()
Returns:
the entryPoint

setEntryPoint

public void setEntryPoint(EntryPoint entryPoint)
Parameters:
entryPoint - the entryPoint to set

setFactHandle

public void setFactHandle(InternalFactHandle factHandle)

getOriginOffset

public int getOriginOffset()
Description copied from interface: PropagationContext
Returns the offset of the fact that initiated this propagation in the current propagation context. This attribute is mutable as the same fact might have different offsets in different rules or logical branches.

Returns:
-1 for not set, and from 0 to the tuple length-1.

setOriginOffset

public void setOriginOffset(int originOffset)
Description copied from interface: PropagationContext
Sets the origin offset to the given offset.

Parameters:
originOffset - -1 to unset or from 0 to tuple length-1

getPropagationAttemptsMemory

public ObjectHashSet getPropagationAttemptsMemory()
Description copied from interface: PropagationContext
Keeps a list of nodes to which a propagation attempt fail because the node was unlinked.


isPropagating

public boolean isPropagating(ObjectTypeNode otn)

setCurrentPropagatingOTN

public void setCurrentPropagatingOTN(ObjectTypeNode otn)
Description copied from interface: PropagationContext
When L&R unlinking is active, we need to keep track of the OTN that triggered this propagation.


setShouldPropagateAll

public void setShouldPropagateAll(Object node)

shouldPropagateAll

public boolean shouldPropagateAll()

addInsertAction

public void addInsertAction(WorkingMemoryAction action)

removeInsertAction

public void removeInsertAction(WorkingMemoryAction action)

getQueue2

public LinkedList<WorkingMemoryAction> getQueue2()

evaluateActionQueue

public void evaluateActionQueue(InternalWorkingMemory workingMemory)

getModificationMask

public long getModificationMask()

setModificationMask

public void setModificationMask(long modificationMask)

adaptModificationMaskForObjectType

public PropagationContext adaptModificationMaskForObjectType(ObjectType type,
                                                             InternalWorkingMemory workingMemory)

getActiveWindowTupleList

public WindowTupleList getActiveWindowTupleList()

setActiveWindowTupleList

public void setActiveWindowTupleList(WindowTupleList list)

getObjectType

public ObjectType getObjectType()

setObjectType

public void setObjectType(ObjectType objectType)

getReaderContext

public MarshallerReaderContext getReaderContext()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.