public class ExceptionClassifierSkipPolicy extends java.lang.Object implements SkipPolicy
SkipPolicy
that depends on an exception classifier to make its
decision, and then delegates to the classifier result.SubclassClassifier
Constructor and Description |
---|
ExceptionClassifierSkipPolicy() |
Modifier and Type | Method and Description |
---|---|
void |
setExceptionClassifier(org.springframework.classify.SubclassClassifier<java.lang.Throwable,SkipPolicy> classifier)
The classifier that will be used to choose a delegate policy.
|
void |
setPolicyMap(java.util.Map<java.lang.Class<? extends java.lang.Throwable>,SkipPolicy> policyMap)
Setter for policy map.
|
boolean |
shouldSkip(java.lang.Throwable t,
int skipCount)
Consult the classifier and find a delegate policy, and then use that to
determine the outcome.
|
public void setExceptionClassifier(org.springframework.classify.SubclassClassifier<java.lang.Throwable,SkipPolicy> classifier)
classifier
- the classifier to use to choose a delegate policypublic void setPolicyMap(java.util.Map<java.lang.Class<? extends java.lang.Throwable>,SkipPolicy> policyMap)
policyMap
- a map of String to SkipPolicy
that will be used
to create a Classifier
to locate a policy.public boolean shouldSkip(java.lang.Throwable t, int skipCount) throws SkipLimitExceededException
shouldSkip
in interface SkipPolicy
t
- the throwable to considerskipCount
- the current skip countSkipLimitExceededException
- if a limit is exceeded