public class SimpleChunkProvider<I> extends java.lang.Object implements ChunkProvider<I>
ItemReader
.ChunkOrientedTasklet
Modifier and Type | Field and Description |
---|---|
protected ItemReader<? extends I> |
itemReader |
protected org.apache.commons.logging.Log |
logger |
Constructor and Description |
---|
SimpleChunkProvider(ItemReader<? extends I> itemReader,
RepeatOperations repeatOperations) |
Modifier and Type | Method and Description |
---|---|
protected I |
doRead()
Surrounds the read call with listener callbacks.
|
protected MulticasterBatchListener<I,?> |
getListener() |
void |
postProcess(StepContribution contribution,
Chunk<I> chunk) |
Chunk<I> |
provide(StepContribution contribution) |
protected I |
read(StepContribution contribution,
Chunk<I> chunk)
Delegates to
doRead() . |
void |
registerListener(StepListener listener)
Register a listener for callbacks at the appropriate stages in a process.
|
void |
setListeners(java.util.List<? extends StepListener> listeners)
Register some
StepListener s with the handler. |
protected final org.apache.commons.logging.Log logger
protected final ItemReader<? extends I> itemReader
public SimpleChunkProvider(ItemReader<? extends I> itemReader, RepeatOperations repeatOperations)
public void setListeners(java.util.List<? extends StepListener> listeners)
StepListener
s with the handler. Each will get the
callbacks in the order specified at the correct stage.listeners
- public void registerListener(StepListener listener)
listener
- a StepListener
protected MulticasterBatchListener<I,?> getListener()
protected final I doRead() throws java.lang.Exception
java.lang.Exception
public Chunk<I> provide(StepContribution contribution) throws java.lang.Exception
provide
in interface ChunkProvider<I>
java.lang.Exception
public void postProcess(StepContribution contribution, Chunk<I> chunk)
postProcess
in interface ChunkProvider<I>
protected I read(StepContribution contribution, Chunk<I> chunk) throws SkipOverflowException, java.lang.Exception
doRead()
. Subclasses can add additional behaviour
(e.g. exception handling).contribution
- the current step execution contributionchunk
- the current chunkSkipOverflowException
- if specifically the chunk is accumulating
too much data (e.g. skips) and it wants to force a commit.java.lang.Exception
- if there is a generic issue