Class SharedTaskContextHolder


  • public final class SharedTaskContextHolder
    extends Object
    Is used by the guarded task to register it's task abort command (if applicable).
    Since:
    2.0.0
    Author:
    Rutger Lubbers, Paul Klos
    • Method Detail

      • remove

        public static void remove()
        Removes the current SharedTaskContext from the ThreadLocal store.
      • setTaskAbortStrategy

        public static void setTaskAbortStrategy​(TaskAbortStrategy taskAbortStrategy)
        Set the current thread's taskAbortStrategy.

        This sets the taskAbortStrategy into the thread's SharedTaskContext.

        Parameters:
        taskAbortStrategy - The strategy to set.
      • get

        public static SharedTaskContext get()
        Getter for #sharedTaskAbortStrategy.
        Returns:
        the shared task abort strategy
      • getTaskId

        public static String getTaskId()
        Return the task id for the current thread's task. It delegates to the thread local SharedTaskContext.getTaskId().
        Returns:
        The task's id.