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 void
beforeStep(StepExecution stepExecution)
Initialize the state of the listener with theStepExecution
from the current scope.void
write(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:StepExecutionListener
Initialize the state of the listener with theStepExecution
from the current scope.- Specified by:
beforeStep
in interfaceStepExecutionListener
- Overrides:
beforeStep
in 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.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 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.