org.springframework.batch.core.listener
Class CompositeStepExecutionListener

java.lang.Object
  extended by org.springframework.batch.core.listener.CompositeStepExecutionListener
All Implemented Interfaces:
StepExecutionListener, StepListener

public class CompositeStepExecutionListener
extends Object
implements StepExecutionListener

Author:
Lucas Ward, Dave Syer

Constructor Summary
CompositeStepExecutionListener()
           
 
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).
 void register(StepExecutionListener stepExecutionListener)
          Register additional listener.
 void setListeners(StepExecutionListener[] listeners)
          Public setter for the listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeStepExecutionListener

public CompositeStepExecutionListener()
Method Detail

setListeners

public void setListeners(StepExecutionListener[] listeners)
Public setter for the listeners.

Parameters:
listeners -

register

public void register(StepExecutionListener stepExecutionListener)
Register additional listener.

Parameters:
stepExecutionListener -

afterStep

public ExitStatus afterStep(StepExecution stepExecution)
Description copied from interface: StepExecutionListener
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.

Specified by:
afterStep in interface StepExecutionListener
Returns:
an ExitStatus to combine with the normal value. Return null to leave the old value unchanged.

beforeStep

public void beforeStep(StepExecution stepExecution)
Description copied from interface: StepExecutionListener
Initialise the state of the listener with the StepExecution from the current scope.

Specified by:
beforeStep in interface StepExecutionListener

onErrorInStep

public ExitStatus onErrorInStep(StepExecution stepExecution,
                                Throwable e)
Description copied from interface: StepExecutionListener
The value returned will be combined with the normal exit status using ExitStatus.and(ExitStatus).

Specified by:
onErrorInStep in interface StepExecutionListener
e - an exception thrown by the step execution
Returns:
an exit status to be combined with the normal one, or null


Copyright © 2008 SpringSource. All Rights Reserved.