接口 JobExecutionListener
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.- 作者:
- Dave Syer
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
afterJob(JobExecution jobExecution)
Callback after completion of a job.void
beforeJob(JobExecution jobExecution)
Callback before a job executes.
方法详细资料
beforeJob
void beforeJob(JobExecution jobExecution)
Callback before a job executes.- 参数:
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)".- 参数:
jobExecution
- the currentJobExecution