biz.hammurapi.dataflow
Class Multiplexor

java.lang.Object
  extended by biz.hammurapi.dataflow.Multiplexor
All Implemented Interfaces:
DataSink

public class Multiplexor
extends java.lang.Object
implements DataSink

Dispatches data from source to sinks in the order of addition. This class doesn't do data type matching/conversion. Data info returned by this class is aggregation of data info of connected sinks. If several sinks have data items with the same name but different type, this class selects most specific data type. If it is not possible, it chooses data type of data sink which was added to multiplexor earlier.

Author:
Pavel

Constructor Summary
Multiplexor()
           
 
Method Summary
 boolean addData(Data data)
          Dispatched data to sinks.
 void addSink(DataSink sink)
           
 boolean controlsMultiplexing()
          Always returns false.
 DataItemInfo[] getDataInfo()
          Combines data input requirements from participating sinks.
 java.lang.String getName()
           
 void setName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Multiplexor

public Multiplexor()
Method Detail

addData

public boolean addData(Data data)
Dispatched data to sinks. Always returns false (never consumes, even if one of sinks consumes).

Specified by:
addData in interface DataSink
Returns:
true if data was "consumed" and shall be removed from further processing. If this sink is attached to a multiplexor, then the multiplexor shall not continue adding given data to "sibling" sinks.

controlsMultiplexing

public boolean controlsMultiplexing()
Always returns false.

Specified by:
controlsMultiplexing in interface DataSink
Returns:
true if this sink controls multiplexing to "sibling" sinks, i.e. if addData() can return true.

getDataInfo

public DataItemInfo[] getDataInfo()
Combines data input requirements from participating sinks.

Specified by:
getDataInfo in interface DataSink
Returns:
Information about data items expected/required by the sink.

addSink

public void addSink(DataSink sink)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)


Copyright © 2005 Hammurapi Group. All Rights Reserved.