org.springframework.batch.core
Interface StepExecutionListener

All Superinterfaces:
StepListener
All Known Implementing Classes:
CompositeStepExecutionListener, MulticasterBatchListener, StepExecutionListenerSupport, StepExecutionPreparedStatementSetter, StepExecutionResourceProxy, StepListenerSupport

public interface StepExecutionListener
extends StepListener

Listener interface for the lifecycle of a Step.

Author:
Lucas Ward, Dave Syer

Method Summary
 ExitStatus afterStep(StepExecution stepExecution)
          Give a listener a chance to modify the exit status from a step.
 void beforeStep(StepExecution stepExecution)
          Initialise the state of the listener with the StepExecution from the current scope.
 ExitStatus onErrorInStep(StepExecution stepExecution, Throwable e)
          The value returned will be combined with the normal exit status using ExitStatus.and(ExitStatus).
 

Method Detail

beforeStep

void beforeStep(StepExecution stepExecution)
Initialise the state of the listener with the StepExecution from the current scope.

Parameters:
stepExecution -

onErrorInStep

ExitStatus onErrorInStep(StepExecution stepExecution,
                         Throwable e)
The value returned will be combined with the normal exit status using ExitStatus.and(ExitStatus).

Parameters:
e - an exception thrown by the step execution
Returns:
an exit status to be combined with the normal one, or null

afterStep

ExitStatus afterStep(StepExecution stepExecution)
Give a listener a chance to modify the exit status from a step. The value returned will be combined with the normal exit status using ExitStatus.and(ExitStatus). Called after successful execution of step's processing logic. Throwing exception in this method will cause step to fail.

Returns:
an ExitStatus to combine with the normal value. Return null to leave the old value unchanged.


Copyright © 2008 SpringSource. All Rights Reserved.