Class ObjectSpecificFlushCallable<O2,T>
- java.lang.Object
-
- de.aristaflow.adept2.util.threading.executor.ObjectSpecificFlushCallable<O2,T>
-
- Type Parameters:
O2
- The type of objects with which runnables are managed and executed within the corresponding executor.T
- The return value of this callable which is the return value of the wrapped callable.
- All Implemented Interfaces:
Callable<T>
public class ObjectSpecificFlushCallable<O2,T> extends Object implements Callable<T>
A callable that executes a specific task exclusively without any object work running concurrently. After the task has terminated, the object work will be restarted, unless another exclusive task is executed concurrently.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
abortedPending
Whether the flush has aborted pending work.protected Collection<ObjectRunnable<?,O2>>
await
All pipelines of which the termination needs to be awaited.protected AbstractObjectSpecificExecutor<?,O2,?>
executor
The executor for restarting the object work.protected Logger
logger
The logger which to use for runtime exceptions stemming from executing the task or interrupts sent when awaiting the termination of the object work.protected Callable<T>
task
The task to run without any object work running.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ObjectSpecificFlushCallable(Callable<T> task, Collection<ObjectRunnable<?,O2>> await, boolean abortedPending, AbstractObjectSpecificExecutor<?,O2,?> executor, Logger logger)
Creates a new runnable that executes an exclusive tasks without any object work running.
-
-
-
Field Detail
-
await
protected final Collection<ObjectRunnable<?,O2>> await
All pipelines of which the termination needs to be awaited.
-
abortedPending
protected final boolean abortedPending
Whether the flush has aborted pending work.
-
executor
protected final AbstractObjectSpecificExecutor<?,O2,?> executor
The executor for restarting the object work.
-
logger
protected final Logger logger
The logger which to use for runtime exceptions stemming from executing the task or interrupts sent when awaiting the termination of the object work.
-
-
Constructor Detail
-
ObjectSpecificFlushCallable
protected ObjectSpecificFlushCallable(Callable<T> task, Collection<ObjectRunnable<?,O2>> await, boolean abortedPending, AbstractObjectSpecificExecutor<?,O2,?> executor, Logger logger)
Creates a new runnable that executes an exclusive tasks without any object work running.- Parameters:
task
- The task to run exclusively.await
- All object work for which to await its termination.abortedPending
- Whether the flush has aborted pending work.executor
- The object-specific pipeline executor to restart the object work after the exclusive task.logger
- The logger which to use for runtime exceptions stemming from executing the task or interrupts sent when awaiting the termination of the object work.
-
-