Class TimeoutGuardTask
- java.lang.Object
-
- org.hawaiiframework.async.HawaiiAsyncRunnable
-
- org.hawaiiframework.async.timeout.TimeoutGuardTask
-
- All Implemented Interfaces:
Runnable
public class TimeoutGuardTask extends HawaiiAsyncRunnable
Task that stops another scheduled task if the scheduled task's timeout has been reached.We first try to remove the scheduled task from the executor, so it will not be executed. If this fails we will try to abort the scheduled tasks.
For this the guarded task must register it's
TaskAbortStrategy
in theSharedTaskContext
.- Since:
- 2.0.0
- Author:
- Rutger Lubbers, Paul Klos
-
-
Field Summary
-
Fields inherited from class org.hawaiiframework.async.HawaiiAsyncRunnable
sharedTaskContext
-
-
Constructor Summary
Constructors Constructor Description TimeoutGuardTask(SharedTaskContext sharedTaskContext)
Create a newTimeoutGuardTask
instance with the giventaskExecutor
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doRun()
This method is executed byRunnable
run.-
Methods inherited from class org.hawaiiframework.async.HawaiiAsyncRunnable
run
-
-
-
-
Constructor Detail
-
TimeoutGuardTask
public TimeoutGuardTask(SharedTaskContext sharedTaskContext)
Create a newTimeoutGuardTask
instance with the giventaskExecutor
.
-
-
Method Detail
-
doRun
protected void doRun()
This method is executed byRunnable
run. Run executes all administrative calls. Code specified in this method will be executed in between those calls.- Specified by:
doRun
in classHawaiiAsyncRunnable
-
-