Drools :: Core 6.1.0.Beta1

org.drools.core.reteoo
Class ObjectSource

java.lang.Object
  extended by org.drools.core.common.BaseNode
      extended by org.drools.core.reteoo.ObjectSource
All Implemented Interfaces:
Externalizable, Serializable, NetworkNode
Direct Known Subclasses:
AlphaNode, EntryPointNode, ObjectTypeNode, PropagationQueuingNode, Rete, RightInputAdapterNode, WindowNode

public abstract class ObjectSource
extends BaseNode
implements Externalizable

A source of FactHandles for an ObjectSink.

Nodes that propagate FactHandleImpl extend this class.

See Also:
ObjectSource, DefaultFactHandle, Serialized Form

Field Summary
protected  long declaredMask
           
protected  long inferredMask
           
protected  ObjectSinkPropagator sink
          The destination for FactHandleImpl.
protected  ObjectSource source
           
 
Fields inherited from class org.drools.core.common.BaseNode
associations, id, partitionId, partitionsEnabled, streamMode
 
Constructor Summary
ObjectSource()
           
 
Method Summary
 void addObjectSink(ObjectSink objectSink)
          Adds the ObjectSink so that it may receive FactHandleImpl propagated from this ObjectSource.
abstract  long calculateDeclaredMask(List<String> settableProperties)
           
protected  void doRemove(RuleRemovalContext context, ReteooBuilder builder, InternalWorkingMemory[] workingMemories)
          Removes the node from teh network.
 long getDeclaredMask()
           
protected  ObjectTypeNode getObjectTypeNode()
           
 ObjectSource getParentObjectSource()
           
 ObjectSinkPropagator getSinkPropagator()
           
 void initDeclaredMask(BuildContext context)
           
 boolean isInUse()
          Returns true in case the current node is in use (is referenced by any other node)
 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 removeObjectSink(ObjectSink objectSink)
          Removes the ObjectSink
 void resetInferredMask()
           
 long updateMask(long mask)
           
abstract  void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.drools.core.common.BaseNode
addAssociation, attach, attach, getAssociations, getId, getPartitionId, hashCode, isStreamMode, remove, removeAssociation, setId, setPartitionId, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.drools.core.common.NetworkNode
getType
 

Field Detail

sink

protected ObjectSinkPropagator sink
The destination for FactHandleImpl.


source

protected ObjectSource source

declaredMask

protected long declaredMask

inferredMask

protected long inferredMask
Constructor Detail

ObjectSource

public ObjectSource()
Method Detail

readExternal

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

writeExternal

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

getParentObjectSource

public ObjectSource getParentObjectSource()

initDeclaredMask

public void initDeclaredMask(BuildContext context)

calculateDeclaredMask

public abstract long calculateDeclaredMask(List<String> settableProperties)

resetInferredMask

public void resetInferredMask()

updateMask

public long updateMask(long mask)

addObjectSink

public void addObjectSink(ObjectSink objectSink)
Adds the ObjectSink so that it may receive FactHandleImpl propagated from this ObjectSource.

Parameters:
objectSink - The ObjectSink to receive propagated FactHandleImpl.

removeObjectSink

public void removeObjectSink(ObjectSink objectSink)
Removes the ObjectSink

Parameters:
objectSink - The ObjectSink to remove

updateSink

public abstract void updateSink(ObjectSink sink,
                                PropagationContext context,
                                InternalWorkingMemory workingMemory)

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

getSinkPropagator

public ObjectSinkPropagator getSinkPropagator()

isInUse

public boolean isInUse()
Description copied from class: BaseNode
Returns true in case the current node is in use (is referenced by any other node)

Specified by:
isInUse in class BaseNode
Returns:

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

getObjectTypeNode

protected ObjectTypeNode getObjectTypeNode()

getDeclaredMask

public long getDeclaredMask()

Drools :: Core 6.1.0.Beta1

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