Package org.springframework.batch.core
Interface JobExecutionListener
- All Known Implementing Classes:
CompositeJobExecutionListener
,JobExecutionListenerSupport
,JobListenerAdapter
public interface JobExecutionListener
Provide callbacks at specific points in the lifecycle of aJob
. 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
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
afterJob(JobExecution jobExecution)
Callback after completion of a job.void
beforeJob(JobExecution jobExecution)
Callback before a job executes.
Method Detail
beforeJob
void beforeJob(JobExecution jobExecution)
Callback before a job executes.- Parameters:
jobExecution
- the currentJobExecution
afterJob
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 currentJobExecution