Package org.springframework.cloud.task.listener.annotation

# 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 Summary

  Constructors
  Constructor
  Description
  `TaskListenerExecutor(Map<Method,Set<Object>> beforeTaskInstances, Map<Method,Set<Object>> afterTaskInstances, Map<Method,Set<Object>> failedTaskInstances)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onTaskEnd(TaskExecution taskExecution)`
  Executes all the methods that have been annotated with @AfterTask.
  `void`
  `onTaskFailed(TaskExecution taskExecution, Throwable throwable)`
  Executes all the methods that have been annotated with @FailedTask.
  `void`
  `onTaskStartup(TaskExecution taskExecution)`
  Executes all the methods that have been annotated with @BeforeTask.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TaskListenerExecutor

    public TaskListenerExecutor(Map<Method,Set<Object>> beforeTaskInstances, Map<Method,Set<Object>> afterTaskInstances, Map<Method,Set<Object>> failedTaskInstances)

- ## 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.