Class PipelineRunnable<P>
- java.lang.Object
-
- de.aristaflow.adept2.util.threading.PipelineRunnable<P>
-
- Type Parameters:
P- The type of objects that identify a pipeline.
- All Implemented Interfaces:
Runnable
@Deprecated public class PipelineRunnable<P> extends Object implements Runnable
Deprecated.UsePipelineRunnableinstead.A runnable that executes all runnables that are present for a specific object. Think of this runnable as pipeline that executes all work that arrives in the pipeline. As soon as there is no more work, the pipeline (represented by a queue) will be deleted.- Author:
- Ulrich Kreher
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanactiveDeprecated.A flag to indicate that this pipeline is active.protected LoggerloggerDeprecated.The logger which to use for runtime exceptions stemming from executing a runnable.protected Queue<Runnable>pipelineDeprecated.The pipeline providing the work for this runnable.protected PpipelineIdDeprecated.The identifier of our pipeline.protected Map<P,Pair<PipelineRunnable<P>,Queue<Runnable>>>pipelinesDeprecated.The data structures containing all pipelines from which the current pipeline will be removed as soon as it is empty.protected AtomicIntegerterminateDeprecated.A boolean flag to signal this pipeline to terminate.protected CountDownLatchterminatedDeprecated.The latch allowing others to wait for the termination of this pipeline.
-
Constructor Summary
Constructors Modifier Constructor Description protectedPipelineRunnable(P pipelineId, Queue<Runnable> pipeline, Map<P,Pair<PipelineRunnable<P>,Queue<Runnable>>> pipelines, AtomicInteger terminate, Logger logger)Deprecated.Creates a new runnable that executes all the work present for a specific object (in a pipeline).
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidawaitTermination()Deprecated.Awaits the termination of this runnable.PgetId()Deprecated.Gets the ID of this pipeline.voidrun()Deprecated.
-
-
-
Field Detail
-
pipelineId
protected final P pipelineId
Deprecated.The identifier of our pipeline.
-
pipeline
protected final Queue<Runnable> pipeline
Deprecated.The pipeline providing the work for this runnable.
-
pipelines
protected final Map<P,Pair<PipelineRunnable<P>,Queue<Runnable>>> pipelines
Deprecated.The data structures containing all pipelines from which the current pipeline will be removed as soon as it is empty.
-
terminate
protected final AtomicInteger terminate
Deprecated.A boolean flag to signal this pipeline to terminate. This allows for synchronising across different pipelines.
-
active
protected volatile boolean active
Deprecated.A flag to indicate that this pipeline is active.
-
terminated
protected final CountDownLatch terminated
Deprecated.The latch allowing others to wait for the termination of this pipeline.
-
logger
protected final Logger logger
Deprecated.The logger which to use for runtime exceptions stemming from executing a runnable. Such an exception will only be logged, the execution of the pipeline will continue.
-
-
Constructor Detail
-
PipelineRunnable
protected PipelineRunnable(P pipelineId, Queue<Runnable> pipeline, Map<P,Pair<PipelineRunnable<P>,Queue<Runnable>>> pipelines, AtomicInteger terminate, Logger logger)
Deprecated.Creates a new runnable that executes all the work present for a specific object (in a pipeline).- Parameters:
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- A boolean flag to signal this thread to terminate. 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.
-
-
Method Detail
-
getId
public P getId()
Deprecated.Gets the ID of this pipeline.- Returns:
- The ID of this pipeline.
-
awaitTermination
public void awaitTermination() throws InterruptedExceptionDeprecated.Awaits the termination of this runnable. Either the thread has been interrupted, its termination has been requested or the pipeline is empty.- Throws:
InterruptedException- If the waiting thread is interrupted while waiting for this runnable to terminate, anInterruptedExceptionwill be thrown.
-
-