Class InfiniteLoopWriter
- java.lang.Object
- org.springframework.batch.core.listener.StepExecutionListenerSupport
- org.springframework.batch.sample.common.InfiniteLoopWriter
- All Implemented Interfaces:
StepExecutionListener,StepListener,ItemWriter<java.lang.Object>
public class InfiniteLoopWriter extends StepExecutionListenerSupport implements ItemWriter<java.lang.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
Constructors Constructor Description InfiniteLoopWriter()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeStep(StepExecution stepExecution)Initialize the state of the listener with theStepExecutionfrom the current scope.voidwrite(java.util.List<? extends java.lang.Object> items)Process the supplied data element.Methods inherited from class org.springframework.batch.core.listener.StepExecutionListenerSupport
afterStep
Method Detail
beforeStep
public void beforeStep(StepExecution stepExecution)
Description copied from interface:StepExecutionListenerInitialize the state of the listener with theStepExecutionfrom the current scope.- Specified by:
beforeStepin interfaceStepExecutionListener- Overrides:
beforeStepin classStepExecutionListenerSupport- Parameters:
stepExecution- instance ofStepExecution.- See Also:
StepExecutionListener.beforeStep(StepExecution)
write
public void write(java.util.List<? extends java.lang.Object> items) throws java.lang.ExceptionDescription copied from interface:ItemWriterProcess the supplied data element. Will not be called with any null items in normal operation.- Specified by:
writein interfaceItemWriter<java.lang.Object>- Parameters:
items- items to be written- Throws:
java.lang.Exception- if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.