Class SharedTaskContextHolder
java.lang.Object
org.hawaiiframework.async.timeout.SharedTaskContextHolder
Is used by the guarded task to register it's task abort command (if applicable).
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic SharedTaskContextget()Getter for #sharedTaskAbortStrategy.static StringReturn the task id for the current thread's task.static voidregister(SharedTaskContext sharedTaskContext) Initialize theSharedTaskContextHolderwith thesharedTaskContext.static voidremove()Removes the currentSharedTaskContextfrom the ThreadLocal store.static voidsetTaskAbortStrategy(TaskAbortStrategy taskAbortStrategy) Set the current thread'staskAbortStrategy.
-
Method Details
-
remove
public static void remove()Removes the currentSharedTaskContextfrom the ThreadLocal store. -
setTaskAbortStrategy
Set the current thread'staskAbortStrategy.This sets the
taskAbortStrategyinto the thread'sSharedTaskContext.- Parameters:
taskAbortStrategy- The strategy to set.
-
get
Getter for #sharedTaskAbortStrategy.- Returns:
- the shared task abort strategy
-
getTaskId
Return the task id for the current thread's task.It delegates to the thread local
SharedTaskContext.getTaskId().- Returns:
- The task's id.