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 Details

    • task

      protected final Callable<T> task
      The task to run without any object work running.
    • 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 Details

    • 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.
  • Method Details