Package org.springframework.retry.policy
Class BinaryExceptionClassifierRetryPolicy
java.lang.Object
org.springframework.retry.policy.BinaryExceptionClassifierRetryPolicy
- All Implemented Interfaces:
Serializable,RetryPolicy
A policy, that is based on
BinaryExceptionClassifier. Usually, binary
classification is enough for retry purposes. If you need more flexible classification,
use ExceptionClassifierRetryPolicy.- Author:
- Aleksandr Shamukov
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.retry.RetryPolicy
NO_MAXIMUM_ATTEMPTS_SET -
Constructor Summary
ConstructorsConstructorDescriptionBinaryExceptionClassifierRetryPolicy(BinaryExceptionClassifier exceptionClassifier) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRetry(RetryContext context) voidclose(RetryContext status) open(RetryContext parent) Acquire resources needed for the retry operation.voidregisterThrowable(RetryContext context, Throwable throwable) Called once per retry attempt, after the callback fails.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.retry.RetryPolicy
getMaxAttempts
-
Constructor Details
-
BinaryExceptionClassifierRetryPolicy
-
-
Method Details
-
getExceptionClassifier
-
canRetry
- Specified by:
canRetryin interfaceRetryPolicy- Parameters:
context- the current retry status- Returns:
- true if the operation can proceed
-
close
- Specified by:
closein interfaceRetryPolicy- Parameters:
status- a retry status created by theRetryPolicy.open(RetryContext)method of this policy.
-
registerThrowable
Description copied from interface:RetryPolicyCalled once per retry attempt, after the callback fails.- Specified by:
registerThrowablein interfaceRetryPolicy- Parameters:
context- the current status object.throwable- the exception to throw
-
open
Description copied from interface:RetryPolicyAcquire resources needed for the retry operation. The callback is passed in so that marker interfaces can be used and a manager can collaborate with the callback to set up some state in the status token.- Specified by:
openin interfaceRetryPolicy- Parameters:
parent- the parent context if we are in a nested retry.- Returns:
- a
RetryContextobject specific to this policy.
-