|
||||||||||
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.AbstractStepFactoryBean org.springframework.batch.core.step.item.SimpleStepFactoryBean org.springframework.batch.core.step.item.SkipLimitStepFactoryBean org.springframework.batch.core.step.item.StatefulRetryStepFactoryBean
public class StatefulRetryStepFactoryBean
Factory bean for step that executes its item processing with a stateful
retry. Failed items are never skipped, but always cause a rollback. Before a
rollback, the Step
makes a record of the failed item, caching it
under a key given by the ItemKeyGenerator
. Then when it is
re-presented by the ItemReader
it is recognised and retried up to a
limit given by the RetryPolicy
. When the retry is exhausted instead
of the item being skipped it is handled by an ItemRecoverer
.
The skipLimit property is still used to control the overall exception
handling policy. Only exhausted retries count against the exception handler,
instead of counting all exceptions.
This class is not designed for extension. Do not subclass it.
Constructor Summary | |
---|---|
StatefulRetryStepFactoryBean()
|
Method Summary | |
---|---|
protected void |
applyConfiguration(ItemOrientedStep step)
Uses the SkipLimitStepFactoryBean.setSkipLimit(int) value to configure item handler and and
exception handler. |
void |
setBackOffPolicy(BackOffPolicy backOffPolicy)
Public setter for the BackOffPolicy . |
void |
setItemRecoverer(ItemRecoverer itemRecoverer)
Public setter for the ItemRecoverer . |
void |
setRetryableExceptionClasses(Class[] retryableExceptionClasses)
Public setter for the Class[]. |
void |
setRetryLimit(int retryLimit)
Public setter for the retry limit. |
void |
setRetryListeners(RetryListener[] retryListeners)
Public setter for the RetryListener s. |
Methods inherited from class org.springframework.batch.core.step.item.SkipLimitStepFactoryBean |
---|
addFatalExceptionIfMissing, getFatalExceptionClasses, getItemKeyGenerator, getItemSkipPolicy, setFatalExceptionClasses, setItemKeyGenerator, setSkipCacheCapacity, setSkipLimit, setSkippableExceptionClasses |
Methods inherited from class org.springframework.batch.core.step.item.SimpleStepFactoryBean |
---|
getChunkOperations, getExceptionHandler, getItemHandler, getListeners, getStepOperations, setCommitInterval, setExceptionHandler, setItemHandler, setListeners, setStreams, setTaskExecutor |
Methods inherited from class org.springframework.batch.core.step.item.AbstractStepFactoryBean |
---|
getItemReader, getItemWriter, getName, getObject, getObjectType, isSingleton, setAllowStartIfComplete, setBeanName, setItemReader, setItemWriter, setJobRepository, setSingleton, setStartLimit, setTransactionManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StatefulRetryStepFactoryBean()
Method Detail |
---|
public void setRetryLimit(int retryLimit)
retryLimit
- the retry limit to setpublic void setRetryableExceptionClasses(Class[] retryableExceptionClasses)
retryableExceptionClasses
- the retryableExceptionClasses to setpublic void setBackOffPolicy(BackOffPolicy backOffPolicy)
BackOffPolicy
.
backOffPolicy
- the BackOffPolicy
to setpublic void setRetryListeners(RetryListener[] retryListeners)
RetryListener
s.
retryListeners
- the RetryListener
s to setpublic void setItemRecoverer(ItemRecoverer itemRecoverer)
ItemRecoverer
. If this is set the
ItemRecoverer.recover(Object, Throwable)
will be called when
retry is exhausted, and within the business transaction (which will not
roll back because of any other item-related errors).
itemRecoverer
- the ItemRecoverer
to setprotected void applyConfiguration(ItemOrientedStep step)
SkipLimitStepFactoryBean
SkipLimitStepFactoryBean.setSkipLimit(int)
value to configure item handler and and
exception handler.
applyConfiguration
in class SkipLimitStepFactoryBean
step
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |