Class TaskListenerExecutor

java.lang.Object
org.springframework.cloud.task.listener.annotation.TaskListenerExecutor
All Implemented Interfaces:
TaskExecutionListener

public class TaskListenerExecutor extends Object implements TaskExecutionListener
Identifies all beans that contain a TaskExecutionListener annotation and stores the associated method so that it can be called by the TaskExecutionListener at the appropriate time.
Author:
Glenn Renfro, Isik Erhan
  • Constructor Details

  • Method Details

    • onTaskStartup

      public void onTaskStartup(TaskExecution taskExecution)
      Executes all the methods that have been annotated with @BeforeTask.
      Specified by:
      onTaskStartup in interface TaskExecutionListener
      Parameters:
      taskExecution - associated with the event.
    • onTaskEnd

      public void onTaskEnd(TaskExecution taskExecution)
      Executes all the methods that have been annotated with @AfterTask.
      Specified by:
      onTaskEnd in interface TaskExecutionListener
      Parameters:
      taskExecution - associated with the event.
    • onTaskFailed

      public void onTaskFailed(TaskExecution taskExecution, Throwable throwable)
      Executes all the methods that have been annotated with @FailedTask.
      Specified by:
      onTaskFailed in interface TaskExecutionListener
      Parameters:
      throwable - that was not caught for the task execution.
      taskExecution - associated with the event.