O - The type of objects with which the runnable is registered (before hashing).P - The type of objects that identifies a pipeline (after hashing).public class PipelineRunnable<O,P> extends AbstractObjectRunnable<O,P,java.util.Queue<java.lang.Runnable>>
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Queue<java.lang.Runnable> |
pipeline
The pipeline providing the work for this runnable.
|
logger, objects, terminate| Modifier | Constructor and Description |
|---|---|
protected |
PipelineRunnable(O object,
P pipelineId,
java.util.Queue<java.lang.Runnable> pipeline,
java.util.Map<P,Pair<ObjectRunnable<O,P>,java.util.Queue<java.lang.Runnable>>> pipelines,
java.util.concurrent.atomic.AtomicInteger terminate,
java.util.logging.Logger logger)
Creates a new runnable that executes all the work present for a specific
object (in a pipeline).
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
runForObject()
Runs this runnable actually.
|
awaitTermination, getIndexObject, getRegisteredObject, runprotected final java.util.Queue<java.lang.Runnable> pipeline
protected PipelineRunnable(O object, P pipelineId, java.util.Queue<java.lang.Runnable> pipeline, java.util.Map<P,Pair<ObjectRunnable<O,P>,java.util.Queue<java.lang.Runnable>>> pipelines, java.util.concurrent.atomic.AtomicInteger terminate, java.util.logging.Logger logger)
object - The object for which this pipeline runnable has been registered.pipelineId - The identifier of our pipeline.pipeline - The pipeline providing the work for this runnable.pipelines - The data structures containing all pipelines from which
the current pipeline will be removed as soon as it is empty.terminate - The amount of termination requests. This allows for synchronising across
different pipelines.logger - The logger which to use for runtime exceptions stemming from
a executing a runnable. Such an exception will only be logged, the
execution of the pipeline will continue.protected boolean runForObject()
AbstractObjectRunnablerunForObject in class AbstractObjectRunnable<O,P,java.util.Queue<java.lang.Runnable>>true,
only return false if you want to continue to work without interruption,
e.g. to change the executing thread.