org.springframework.batch.core.step.item
Class FaultTolerantChunkProvider<I>

java.lang.Object
  extended by org.springframework.batch.core.step.item.SimpleChunkProvider<I>
      extended by org.springframework.batch.core.step.item.FaultTolerantChunkProvider<I>
All Implemented Interfaces:
ChunkProvider<I>

public class FaultTolerantChunkProvider<I>
extends SimpleChunkProvider<I>

FaultTolerant implementation of the ChunkProcessor interface, that allows for skipping or retry of items that cause exceptions during reading or processing.


Field Summary
 
Fields inherited from class org.springframework.batch.core.step.item.SimpleChunkProvider
itemReader, logger
 
Constructor Summary
FaultTolerantChunkProvider(ItemReader<? extends I> itemReader, RepeatOperations repeatOperations)
           
 
Method Summary
 void postProcess(StepContribution contribution, Chunk<I> chunk)
           
protected  I read(StepContribution contribution, Chunk<I> chunk)
           
 void setRollbackClassifier(Classifier<Throwable,Boolean> rollbackClassifier)
          Classifier to determine whether exceptions have been marked as no-rollback (as opposed to skippable).
 void setSkipPolicy(SkipPolicy SkipPolicy)
          The policy that determines whether exceptions can be skipped on read.
 
Methods inherited from class org.springframework.batch.core.step.item.SimpleChunkProvider
doRead, getListener, provide, registerListener, setListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FaultTolerantChunkProvider

public FaultTolerantChunkProvider(ItemReader<? extends I> itemReader,
                                  RepeatOperations repeatOperations)
Method Detail

setSkipPolicy

public void setSkipPolicy(SkipPolicy SkipPolicy)
The policy that determines whether exceptions can be skipped on read.

Parameters:
SkipPolicy -

setRollbackClassifier

public void setRollbackClassifier(Classifier<Throwable,Boolean> rollbackClassifier)
Classifier to determine whether exceptions have been marked as no-rollback (as opposed to skippable). If ecnounterd they are simply ignored, unless also skippable.

Parameters:
rollbackClassifier - the rollback classifier to set

read

protected I read(StepContribution contribution,
                 Chunk<I> chunk)
          throws Exception
Overrides:
read in class SimpleChunkProvider<I>
Throws:
Exception

postProcess

public void postProcess(StepContribution contribution,
                        Chunk<I> chunk)
Specified by:
postProcess in interface ChunkProvider<I>
Overrides:
postProcess in class SimpleChunkProvider<I>


Copyright © 2009 SpringSource. All Rights Reserved.