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 TypeMethodDescriptiondefault void
afterJob
(JobExecution jobExecution) Callback after completion of a job.default void
beforeJob
(JobExecution jobExecution) Callback before a job executes.
-
Method Details
-
beforeJob
Callback before a job executes.- Parameters:
jobExecution
- the currentJobExecution
-
afterJob
Callback after completion of a job. Called after both successful and failed executions. To perform logic on a particular status, useif (jobExecution.getStatus() == BatchStatus.X)
.- Parameters:
jobExecution
- the currentJobExecution
-