|
||||||||||
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
public class SkipLimitStepFactoryBean
Factory bean for step that provides options for configuring skip behavior.
User can set setSkipLimit(int)
to set how many exceptions of
setSkippableExceptionClasses(Class[])
types are tolerated.
setFatalExceptionClasses(Class[])
will cause immediate termination
of job - they are treated as higher priority than
setSkippableExceptionClasses(Class[])
, so the two lists don't need
to be exclusive.
Skippable exceptions on write will by default cause transaction rollback - to
avoid rollback for specific exception class include it in the transaction
attribute as "no rollback for".
SimpleStepFactoryBean
Field Summary |
---|
Fields inherited from class org.springframework.batch.core.step.item.SimpleStepFactoryBean |
---|
logger |
Constructor Summary | |
---|---|
SkipLimitStepFactoryBean()
|
Method Summary | |
---|---|
void |
addFatalExceptionIfMissing(Class cls)
|
protected void |
applyConfiguration(ItemOrientedStep step)
Uses the setSkipLimit(int) value to configure item handler and
and exception handler. |
void |
setBackOffPolicy(BackOffPolicy backOffPolicy)
Public setter for the BackOffPolicy . |
void |
setCacheCapacity(int cacheCapacity)
Public setter for the capacity of the cache in the retry policy. |
void |
setFatalExceptionClasses(Class[] fatalExceptionClasses)
Public setter for exception classes that should cause immediate failure. |
void |
setItemKeyGenerator(ItemKeyGenerator itemKeyGenerator)
Public setter for the ItemKeyGenerator . |
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. |
void |
setRetryPolicy(RetryPolicy retryPolicy)
Setter for the retry policy. |
void |
setSkipLimit(int skipLimit)
Public setter for a limit that determines skip policy. |
void |
setSkippableExceptionClasses(Class[] exceptionClasses)
Public setter for exception classes that when raised won't crash the job but will result in transaction rollback and the item which handling caused the exception will be skipped. |
Methods inherited from class org.springframework.batch.core.step.item.SimpleStepFactoryBean |
---|
getChunkOperations, getExceptionHandler, getItemHandler, getStepOperations, setChunkCompletionPolicy, setCommitInterval, setExceptionHandler, setItemHandler, setTaskExecutor, setThrottleLimit |
Methods inherited from class org.springframework.batch.core.step.item.AbstractStepFactoryBean |
---|
getItemReader, getItemWriter, getListeners, getName, getObject, getObjectType, getTransactionAttribute, isSingleton, setAllowStartIfComplete, setBeanName, setItemReader, setItemWriter, setJobRepository, setListeners, setSingleton, setStartLimit, setStreams, setTransactionAttribute, setTransactionManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SkipLimitStepFactoryBean()
Method Detail |
---|
public void setRetryPolicy(RetryPolicy retryPolicy)
retryPolicy
- a stateless RetryPolicy
public void setRetryLimit(int retryLimit)
retryLimit
- the retry limit to setpublic void setCacheCapacity(int cacheCapacity)
MapRetryContextCache
.
cacheCapacity
- the cacheCapacity 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 setSkipLimit(int skipLimit)
skipLimit
- the value to set. Default is 0 (never skip).public void setSkippableExceptionClasses(Class[] exceptionClasses)
exceptionClasses
- defaults to Exception
public void setFatalExceptionClasses(Class[] fatalExceptionClasses)
fatalExceptionClasses
- Error
by defaultpublic void setItemKeyGenerator(ItemKeyGenerator itemKeyGenerator)
ItemKeyGenerator
. This is used to identify
failed items so they can be skipped if encountered again, generally in
another transaction.
itemKeyGenerator
- the ItemKeyGenerator
to set.protected void applyConfiguration(ItemOrientedStep step)
setSkipLimit(int)
value to configure item handler and
and exception handler.
applyConfiguration
in class SimpleStepFactoryBean
public void addFatalExceptionIfMissing(Class cls)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |