Package org.springframework.batch.core

# Interface JobExecutionListener

All Known Implementing Classes:
  `CompositeJobExecutionListener`, `JobExecutionListenerSupport`

public interface JobExecutionListener
Provide callbacks at specific points in the lifecycle of a `Job`. Implementations can be stateful if they are careful to either ensure thread safety, or to use one instance of a listener per job, assuming that job instances themselves are not used by more than one thread.

Author:
  Dave Syer, Parikshit Dutta

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default void`
  `afterJob(JobExecution jobExecution)`
  Callback after completion of a job.
  `default void`
  `beforeJob(JobExecution jobExecution)`
  Callback before a job executes.

- ## Method Details

  - ### beforeJob

    default void beforeJob(JobExecution jobExecution)
    Callback before a job executes.
    Parameters:
      `jobExecution` - the current `JobExecution`

  - ### afterJob

    default void afterJob(JobExecution jobExecution)
    Callback after completion of a job. Called after both both successful and failed executions. To perform logic on a particular status, use "if (jobExecution.getStatus() == BatchStatus.X)".
    Parameters:
      `jobExecution` - the current `JobExecution`