Class TaskRemoveStrategy
java.lang.Object
org.hawaiiframework.async.timeout.TaskRemoveStrategy
- All Implemented Interfaces:
TaskAbortStrategy
Removes the scheduled task from the executor's queue.
- Since:
- 2.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionTaskRemoveStrategy(ThreadPoolExecutor executor, Runnable task, String taskType, String taskId) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninvoke()Invoke the strategy in order to abort the task (that registered this abort strategy).
-
Constructor Details
-
TaskRemoveStrategy
public TaskRemoveStrategy(ThreadPoolExecutor executor, Runnable task, String taskType, String taskId) Create a new instance.- Parameters:
executor- The executor executing or queueing thetask.task- The task.taskType- The type of the task.taskId- The task id.
-
-
Method Details
-
invoke
public boolean invoke()Description copied from interface:TaskAbortStrategyInvoke the strategy in order to abort the task (that registered this abort strategy).- Specified by:
invokein interfaceTaskAbortStrategy- Returns:
trueif the task has been aborted.
-