Class ExceptionClassifierSkipPolicy
java.lang.Object
org.springframework.batch.core.step.skip.ExceptionClassifierSkipPolicy
- All Implemented Interfaces:
SkipPolicy
A
SkipPolicy
that depends on an exception classifier to make its decision, and
then delegates to the classifier result.- Author:
- Dave Syer, Mahmoud Ben Hassine
- See Also:
-
SubclassClassifier
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
setExceptionClassifier
(org.springframework.classify.SubclassClassifier<Throwable, SkipPolicy> classifier) The classifier that will be used to choose a delegate policy.void
setPolicyMap
(Map<Class<? extends Throwable>, SkipPolicy> policyMap) Setter for policy map.boolean
shouldSkip
(Throwable t, long skipCount) Consult the classifier and find a delegate policy, and then use that to determine the outcome.
-
Constructor Details
-
ExceptionClassifierSkipPolicy
public ExceptionClassifierSkipPolicy()
-
-
Method Details
-
setExceptionClassifier
public void setExceptionClassifier(org.springframework.classify.SubclassClassifier<Throwable, SkipPolicy> classifier) The classifier that will be used to choose a delegate policy.- Parameters:
classifier
- the classifier to use to choose a delegate policy
-
setPolicyMap
Setter for policy map. This property should not be changed dynamically - set it once, e.g. in configuration, and then don't change it during a running application. Either this property or the exception classifier directly should be set, but not both.- Parameters:
policyMap
- a map of String toSkipPolicy
that will be used to create aClassifier
to locate a policy.
-
shouldSkip
Consult the classifier and find a delegate policy, and then use that to determine the outcome.- Specified by:
shouldSkip
in interfaceSkipPolicy
- Parameters:
t
- the throwable to considerskipCount
- the current skip count- Returns:
- true if the exception can be skipped
- Throws:
SkipLimitExceededException
- if a limit is exceeded
-