org.drools.reteoo
Class ObjectSource

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

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

Field Detail

sink

protected ObjectSinkPropagator sink
The destination for FactHandleImpl.


source

protected ObjectSource source
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()

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

protected 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()
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,
                        BaseNode node,
                        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


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