Interface TaskListener

  • All Superinterfaces:
    org.springframework.core.Ordered
    All Known Implementing Classes:
    KibanaLogFieldsTaskListener, LoggingTaskListener, OpenTracingAsyncTaskListener

    public interface TaskListener
    extends org.springframework.core.Ordered
    An interface that allows listeners to be informed about the task's lifecycle.

    The setSharedTaskContext method is called before the task is being run. Then the startExecution method is called (prior to starting the task). Optionally the timeout method is called. Then the finish is called last.

    • Field Summary

      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default void finish()
      Called just after a task is finished.
      default void setSharedTaskContext​(SharedTaskContext sharedTaskContext)
      Set the shared task context in this task context.
      default void startExecution()
      Called just before the task is started.
      default void timeout()
      Called just after a task has timed-out.
      • Methods inherited from interface org.springframework.core.Ordered

        getOrder
    • Method Detail

      • setSharedTaskContext

        default void setSharedTaskContext​(SharedTaskContext sharedTaskContext)
        Set the shared task context in this task context. Invoked before the set.
        Parameters:
        sharedTaskContext - the shared task context.
      • startExecution

        default void startExecution()
        Called just before the task is started.
      • finish

        default void finish()
        Called just after a task is finished.
      • timeout

        default void timeout()
        Called just after a task has timed-out.