org.springframework.batch.core.listener
Class CompositeExecutionJobListener

java.lang.Object
  extended by org.springframework.batch.core.listener.CompositeExecutionJobListener
All Implemented Interfaces:
JobExecutionListener

public class CompositeExecutionJobListener
extends Object
implements JobExecutionListener

Author:
Dave Syer

Constructor Summary
CompositeExecutionJobListener()
           
 
Method Summary
 void afterJob(JobExecution jobExecution)
          Call the registered listeners in reverse order, respecting and prioritising those that implement Ordered.
 void beforeJob(JobExecution jobExecution)
          Call the registered listeners in order, respecting and prioritising those that implement Ordered.
 void onError(JobExecution jobExecution, Throwable e)
          Call the registered listeners in reverse order, respecting and prioritising those that implement Ordered.
 void onInterrupt(JobExecution jobExecution)
          Call the registered listeners in reverse order, respecting and prioritising those that implement Ordered.
 void register(JobExecutionListener jobExecutionListener)
          Register additional listener.
 void setListeners(JobExecutionListener[] 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

CompositeExecutionJobListener

public CompositeExecutionJobListener()
Method Detail

setListeners

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

Parameters:
listeners -

register

public void register(JobExecutionListener jobExecutionListener)
Register additional listener.

Parameters:
jobExecutionListener -

afterJob

public void afterJob(JobExecution jobExecution)
Call the registered listeners in reverse order, respecting and prioritising those that implement Ordered.

Specified by:
afterJob in interface JobExecutionListener
Parameters:
jobExecution - the current JobExecution
See Also:
JobExecutionListener.afterJob(org.springframework.batch.core.JobExecution)

beforeJob

public void beforeJob(JobExecution jobExecution)
Call the registered listeners in order, respecting and prioritising those that implement Ordered.

Specified by:
beforeJob in interface JobExecutionListener
Parameters:
jobExecution - the current JobExecution
See Also:
JobExecutionListener.beforeJob(org.springframework.batch.core.JobExecution)

onError

public void onError(JobExecution jobExecution,
                    Throwable e)
Call the registered listeners in reverse order, respecting and prioritising those that implement Ordered.

Specified by:
onError in interface JobExecutionListener
Parameters:
jobExecution - the current JobExecution
e - the exception that caused the job to terminate
See Also:
JobExecutionListener.onError(org.springframework.batch.core.JobExecution, java.lang.Throwable)

onInterrupt

public void onInterrupt(JobExecution jobExecution)
Call the registered listeners in reverse order, respecting and prioritising those that implement Ordered.

Specified by:
onInterrupt in interface JobExecutionListener
Parameters:
jobExecution - the current JobExecution
See Also:
JobExecutionListener.onInterrupt(org.springframework.batch.core.JobExecution)


Copyright © 2009 SpringSource. All Rights Reserved.