Package org.springframework.cloud.task.listener

# Interface TaskExecutionListener

All Known Implementing Classes:
  `SimpleCommandLineArgsProvider`, `TaskExecutionListenerSupport`, `TaskListenerExecutor`

public interface TaskExecutionListener
The listener interface for receiving task execution events.

Author:
  Glenn Renfro

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default void`
  `onTaskEnd(TaskExecution taskExecution)`
  Invoked before the `TaskExecution` has been updated in the `TaskRepository` upon task end.
  `default void`
  `onTaskFailed(TaskExecution taskExecution, Throwable throwable)`
  Invoked if an uncaught exception occurs during a task execution.
  `default void`
  `onTaskStartup(TaskExecution taskExecution)`
  Invoked after the `TaskExecution` has been stored in the `TaskRepository`.

- ## Method Details

  - ### onTaskStartup

    default void onTaskStartup(TaskExecution taskExecution)
    Invoked after the `TaskExecution` has been stored in the `TaskRepository`.
    Parameters:
      `taskExecution` - instance containing the information about the current task.

  - ### onTaskEnd

    default void onTaskEnd(TaskExecution taskExecution)
    Invoked before the `TaskExecution` has been updated in the `TaskRepository` upon task end.
    Parameters:
      `taskExecution` - instance containing the information about the current task.

  - ### onTaskFailed

    default void onTaskFailed(TaskExecution taskExecution, Throwable throwable)
    Invoked if an uncaught exception occurs during a task execution. This invocation will occur before the `TaskExecution` has been updated in the `TaskRepository` and before the onTaskEnd is called.
    Parameters:
      `taskExecution` - instance containing the information about the current task.
      `throwable` - the uncaught exception that was thrown during task execution.