Class TaskRemoveStrategy

  • All Implemented Interfaces:
    TaskAbortStrategy

    public class TaskRemoveStrategy
    extends Object
    implements TaskAbortStrategy
    Removes the scheduled task from the executor's queue.
    Since:
    2.0.0
    Author:
    Rutger Lubbers, Paul Klos
    • Constructor Detail

      • TaskRemoveStrategy

        public TaskRemoveStrategy​(ThreadPoolExecutor executor,
                                  Runnable task,
                                  String taskType)
        Create a new instance.
        Parameters:
        executor - The executor executing or queueing the task.
        task - The task.
        taskType - The type of the task.
    • Method Detail

      • invoke

        public boolean invoke()
        Invoke the strategy in order to abort the task (that registered this abort strategy).
        Specified by:
        invoke in interface TaskAbortStrategy