org.springframework.batch.sample.common
Class InfiniteLoopWriter

java.lang.Object
  extended by org.springframework.batch.core.listener.StepExecutionListenerSupport
      extended by org.springframework.batch.sample.common.InfiniteLoopWriter
All Implemented Interfaces:
StepExecutionListener, StepListener, ItemWriter<Object>

public class InfiniteLoopWriter
extends StepExecutionListenerSupport
implements ItemWriter<Object>

Simple module implementation that will always return true to indicate that processing should continue. This is useful for testing graceful shutdown of jobs.

Author:
Lucas Ward

Constructor Summary
InfiniteLoopWriter()
           
 
Method Summary
 void beforeStep(StepExecution stepExecution)
          Initialize the state of the listener with the StepExecution from the current scope.
 void write(List<? extends Object> items)
          Process the supplied data element.
 
Methods inherited from class org.springframework.batch.core.listener.StepExecutionListenerSupport
afterStep
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfiniteLoopWriter

public InfiniteLoopWriter()
Method Detail

beforeStep

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

Specified by:
beforeStep in interface StepExecutionListener
Overrides:
beforeStep in class StepExecutionListenerSupport
See Also:
StepExecutionListener.beforeStep(StepExecution)

write

public void write(List<? extends Object> items)
           throws Exception
Description copied from interface: ItemWriter
Process the supplied data element. Will not be called with any null items in normal operation.

Specified by:
write in interface ItemWriter<Object>
Throws:
Exception - if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.


Copyright © 2009 SpringSource. All Rights Reserved.