org.drools.reteoo
Class TupleSource

java.lang.Object
  extended by org.drools.reteoo.TupleSource
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConditionNode, JoinNode, ParameterNode

abstract class TupleSource
extends Object
implements Serializable

A source of ReteTuple s for a TupleSink.

Nodes that propagate Tuples extend this class.

Author:
bob mcwhirter
See Also:
TupleSource, ReteTuple

Constructor Summary
TupleSource()
          Construct.
 
Method Summary
protected  void addTupleSink(TupleSink tupleSink)
          Adds the TupleSink so that it may receive Tuples propagated from this TupleSource.
abstract  void attach()
          Attaches this node into the network.
abstract  Set getTupleDeclarations()
          Retrieve the available tuple Declarations.
 List getTupleSinks()
          Retrieve the TupleSinks that receive propagated Tuples.
protected  void propagateAssertTuple(ReteTuple tuple, WorkingMemoryImpl workingMemory)
          Propagate the assertion of a Tuple to this node's TupleSink.
protected  void propagateRetractTuples(TupleKey key, WorkingMemoryImpl workingMemory)
          Propagate the retration of a Tuple to this node's TupleSink.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleSource

TupleSource()
Construct.

Method Detail

addTupleSink

protected void addTupleSink(TupleSink tupleSink)
Adds the TupleSink so that it may receive Tuples propagated from this TupleSource.

Parameters:
tupleSink - The TupleSink to receive propagated Tuples.

propagateAssertTuple

protected void propagateAssertTuple(ReteTuple tuple,
                                    WorkingMemoryImpl workingMemory)
                             throws AssertionException
Propagate the assertion of a Tuple to this node's TupleSink.

Parameters:
tuple - The Tuple to propagate.
workingMemory - the working memory session.
Throws:
AssertionException - If an errors occurs while attempting assertion.

propagateRetractTuples

protected void propagateRetractTuples(TupleKey key,
                                      WorkingMemoryImpl workingMemory)
                               throws RetractionException
Propagate the retration of a Tuple to this node's TupleSink.

Parameters:
key - The tuple key.
workingMemory - The working memory session.
Throws:
RetractionException - If an error occurs while attempting retraction

getTupleSinks

public List getTupleSinks()
Retrieve the TupleSinks that receive propagated Tuples.

Returns:
The TupleSinks that receive propagated Tuples.

getTupleDeclarations

public abstract Set getTupleDeclarations()
Retrieve the available tuple Declarations.

Returns:
The available tuple declarations.

attach

public abstract void attach()
Attaches this node into the network.



Copyright © 2001-2005 The Codehaus. All Rights Reserved.