public abstract class AbstractSink extends SystemComponent implements Sink
SystemComponent
implementing characteristics of a Sink
for it processes data.Constructor and Description |
---|
AbstractSink(LifeCycleManager manager,
java.util.HashMap<java.lang.String,java.lang.String> configuration)
Creates a new
AbstractSink . |
Modifier and Type | Method and Description |
---|---|
protected DataDescription[] |
getDescriptionsForIncomingData()
Collects the
DataDescription s for all incoming data-queues. |
ConnectorSink |
getSinkConnector()
Returns the
Sink 's ConnectorSink . |
void |
initConnector()
Initiates a
SystemComponent 's Connector s. |
protected abstract void |
processData(DataEntry entry)
Passes a
DataEntry to the AbstractSink , which needs to be
processed. |
void |
receiveData(java.util.concurrent.LinkedBlockingQueue<DataEntry> data,
DataDescription description)
Sets a
LinkedBlockingQueue of DataEntry s to receive data
with. |
boolean |
stopComponent()
Stops the component.
|
void |
stopReceiving()
Stops receiving data.
|
configure, configureComponent, disableMeasuring, enableMeasuring, getLifeCycleManager, getState, isReadyToMeasure, measure, measureComponent, stop, train, trainComponent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInputDescription
public AbstractSink(LifeCycleManager manager, java.util.HashMap<java.lang.String,java.lang.String> configuration) throws InstantiationException
AbstractSink
.LifeCycleManager
to register itself to in order to be
managed (that is controlled in its life-cycle) and a HashMap
containing information about the sink's configuration.manager
- LifeCycleManager
the sink will register itself to.configuration
- HashMap
containing information about the sink's
configuration.InstantiationException
- if given configuration or manager are not valid.public void initConnector()
SystemComponent
SystemComponent
's Connector
s.initConnector
in class SystemComponent
public ConnectorSink getSinkConnector()
Sink
Sink
's ConnectorSink
.getSinkConnector
in interface Sink
Sink
's ConnectorSink
.public void receiveData(java.util.concurrent.LinkedBlockingQueue<DataEntry> data, DataDescription description)
Sink
LinkedBlockingQueue
of DataEntry
s to receive data
with. Can be called multiple times if the Sink is matched with multiple
Source
s.receiveData
in interface Sink
data
- LinkedBlockingQueue
to receive DataEntry
s
with.description
- DataDescription
describing incoming data for given
queue.public boolean stopComponent()
SystemComponent
SystemComponent.stop()
is called to
allow custom stopping-tasks (e.g. releasing connections).stopComponent
in class SystemComponent
protected abstract void processData(DataEntry entry)
DataEntry
to the AbstractSink
, which needs to be
processed.entry
- DataEntry
to be processed.protected DataDescription[] getDescriptionsForIncomingData()
DataDescription
s for all incoming data-queues.DataDescription
s for all possible incoming data.public void stopReceiving()
ReceiverThread
.