I - input type for the stepO - output type for the steppublic class JsrFaultTolerantChunkProcessor<I,O> extends JsrChunkProcessor<I,O>
JsrChunkProcessor that adds skip and retry functionality.| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
JsrFaultTolerantChunkProcessor(ItemReader<? extends I> reader,
ItemProcessor<? super I,? extends O> processor,
ItemWriter<? super O> writer,
RepeatOperations repeatTemplate,
BatchRetryTemplate batchRetryTemplate) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
persist(StepContribution contribution,
Chunk<O> chunk)
Adds retry and skip logic to the write phase of the chunk loop.
|
protected I |
provide(StepContribution contribution,
Chunk<I> chunk)
Adds retry and skip logic to the reading phase of the chunk loop.
|
void |
registerListener(StepListener listener)
Register a listener for callbacks at the appropriate stages in a process.
|
void |
setChunkMonitor(ChunkMonitor chunkMonitor) |
void |
setListeners(java.util.List<? extends StepListener> listeners)
Register some
StepListeners with the handler. |
void |
setRollbackClassifier(org.springframework.classify.Classifier<java.lang.Throwable,java.lang.Boolean> rollbackClassifier) |
void |
setSkipPolicy(SkipPolicy skipPolicy) |
protected O |
transform(StepContribution contribution,
I item)
Adds retry and skip logic to the process phase of the chunk loop.
|
doPersist, doProvide, doTransform, getListener, processpublic JsrFaultTolerantChunkProcessor(ItemReader<? extends I> reader, ItemProcessor<? super I,? extends O> processor, ItemWriter<? super O> writer, RepeatOperations repeatTemplate, BatchRetryTemplate batchRetryTemplate)
public void setSkipPolicy(SkipPolicy skipPolicy)
skipPolicy - a SkipPolicypublic void setRollbackClassifier(org.springframework.classify.Classifier<java.lang.Throwable,java.lang.Boolean> rollbackClassifier)
rollbackClassifier - a Classifierpublic void setChunkMonitor(ChunkMonitor chunkMonitor)
chunkMonitor - a ChunkMonitorpublic void setListeners(java.util.List<? extends StepListener> listeners)
StepListeners with the handler. Each will get the
callbacks in the order specified at the correct stage.setListeners in class JsrChunkProcessor<I,O>listeners - listeners to be registeredpublic void registerListener(StepListener listener)
registerListener in class JsrChunkProcessor<I,O>listener - a StepListenerprotected I provide(StepContribution contribution, Chunk<I> chunk) throws java.lang.Exception
provide in class JsrChunkProcessor<I,O>contribution - a StepContributionchunk - a Chunkjava.lang.Exceptionprotected O transform(StepContribution contribution, I item) throws java.lang.Exception
transform in class JsrChunkProcessor<I,O>contribution - a StepContributionitem - an item to be processedjava.lang.Exceptionprotected void persist(StepContribution contribution, Chunk<O> chunk) throws java.lang.Exception
persist in class JsrChunkProcessor<I,O>contribution - a StepContributionchunk - a Chunkjava.lang.Exception