|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.core.step.item.SimpleChunkProvider<I>
public class SimpleChunkProvider<I>
Simple implementation of the ChunkProvider interface that does basic chunk
providing from an ItemReader
.
ChunkOrientedTasklet
Field Summary | |
---|---|
protected ItemReader<? extends I> |
itemReader
|
protected Log |
logger
|
Constructor Summary | |
---|---|
SimpleChunkProvider(ItemReader<? extends I> itemReader,
RepeatOperations repeatOperations)
|
Method Summary | |
---|---|
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(List<? extends StepListener> listeners)
Register some StepListener s with the handler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log logger
protected final ItemReader<? extends I> itemReader
Constructor Detail |
---|
public SimpleChunkProvider(ItemReader<? extends I> itemReader, RepeatOperations repeatOperations)
Method Detail |
---|
public void setListeners(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 Exception
Exception
public Chunk<I> provide(StepContribution contribution) throws Exception
provide
in interface ChunkProvider<I>
Exception
public void postProcess(StepContribution contribution, Chunk<I> chunk)
postProcess
in interface ChunkProvider<I>
protected I read(StepContribution contribution, Chunk<I> chunk) throws SkipOverflowException, Exception
doRead()
. Subclasses can add additional behaviour
(e.g. exception handling).
contribution
- the current step execution contributionchunk
- the current chunk
SkipOverflowException
- if specifically the chunk is accumulating
too much data (e.g. skips) and it wants to force a commit.
Exception
- if there is a generic issue
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |