org.springframework.batch.core
Interface JobExecutionListener

All Known Implementing Classes:
CompositeExecutionJobListener, 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

Method Summary
 void afterJob(JobExecution jobExecution)
          Callback after successful completion of a job.
 void beforeJob(JobExecution jobExecution)
          Initialise the state of the listener with the JobExecution from the current scope.
 void onError(JobExecution jobExecution, Throwable e)
          Callback on job failure owing to the throwable provided.
 void onInterrupt(JobExecution jobExecution)
          Callback when a job is interrupted or stopped manually.
 

Method Detail

beforeJob

void beforeJob(JobExecution jobExecution)
Initialise the state of the listener with the JobExecution from the current scope.

Parameters:
jobExecution - the current JobExecution

afterJob

void afterJob(JobExecution jobExecution)
Callback after successful completion of a job.

Parameters:
jobExecution - the current JobExecution

onError

void onError(JobExecution jobExecution,
             Throwable e)
Callback on job failure owing to the throwable provided.

Parameters:
jobExecution - the current JobExecution
e - the exception that caused the job to terminate

onInterrupt

void onInterrupt(JobExecution jobExecution)
Callback when a job is interrupted or stopped manually.

Parameters:
jobExecution - the current JobExecution


Copyright © 2008 SpringSource. All Rights Reserved.