public abstract class StreamWorker<T extends Node> extends NodeWorker<T>
NodeWorker
which performs its work on a single
stream at a time only. The streams are processed according to the following
algorithm:
accept(StreamDescriptor)
returns true
for the
stream, work(Stream)
on it.reject(StreamDescriptor)
returns true
for
the stream, throw an exception indicating a rejection.Constructor and Description |
---|
StreamWorker() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(StreamDescriptor descriptor)
Check whether to accept a stream (and work on it) based on its descriptor.
|
protected boolean |
reject(StreamDescriptor descriptor)
Check whether to reject a stream based on its descriptor.
|
protected void |
work()
Implement this method to let the node perform some useful work.
|
protected abstract void |
work(Stream stream)
Implement this method in order to work on a single stream.
|
abort, abortNow, addInputBundle, addOutputBundle, doAbort, doAbortNow, error, error, error, fail, fail, fail, getController, getInputBundle, getInputBundles, getJob, getLimitSupport, getNode, getOutputBundle, getOutputBundles, getServerJob, getState, getStreamTransportFactory, getTransportSender, initialize, isAbortRequested, postWork, preWork, run, setDescriptor, setJob, toString, warn, warn, warn
protected final void work() throws Throwable
NodeWorker
Implementors are free to throw whatever exception they see fit. If any Throwable
is
thrown from this method, the failure manager is notified about the fatal failure of the whole
pipeline.
work
in class NodeWorker<T extends Node>
Throwable
protected boolean reject(StreamDescriptor descriptor)
descriptor
- protected boolean accept(StreamDescriptor descriptor)
descriptor
- Copyright © 2017 levigo holding gmbh. All rights reserved.