类 ExceptionClassifierRetryPolicy
java.lang.Object
infra.retry.policy.ExceptionClassifierRetryPolicy
- 所有已实现的接口:
RetryPolicy
,Serializable
A
RetryPolicy
that dynamically adapts to one of a set of injected policies
according to the value of the latest exception.- 从以下版本开始:
- 4.0
- 作者:
- Dave Syer
- 另请参阅:
-
嵌套类概要
嵌套类 -
字段概要
字段从接口继承的字段 infra.retry.RetryPolicy
NO_MAXIMUM_ATTEMPTS_SET
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
canRetry
(RetryContext context) Delegate to the policy currently activated in the context.void
close
(RetryContext context) Delegate to the policy currently activated in the context.open
(RetryContext parent) Create an active context that proxies a retry policy by choosing a target from the policy map.void
registerThrowable
(RetryContext context, Throwable throwable) Delegate to the policy currently activated in the context.void
setExceptionClassifier
(Classifier<Throwable, RetryPolicy> exceptionClassifier) Setter for an exception classifier.void
setPolicyMap
(Map<Class<? extends Throwable>, RetryPolicy> policyMap) Setter for policy map used to create a classifier.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 infra.retry.RetryPolicy
getMaxAttempts
-
字段详细资料
-
exceptionClassifier
-
-
构造器详细资料
-
ExceptionClassifierRetryPolicy
public ExceptionClassifierRetryPolicy()
-
-
方法详细资料
-
setPolicyMap
Setter for policy map used to create a classifier. Either this property or the exception classifier directly should be set, but not both.- 参数:
policyMap
- a map of Throwable class toRetryPolicy
that will be used to create aClassifier
to locate a policy.
-
setExceptionClassifier
Setter for an exception classifier. The classifier is responsible for translating exceptions to concrete retry policies. Either this property or the policy map should be used, but not both.- 参数:
exceptionClassifier
- ExceptionClassifier to use
-
canRetry
Delegate to the policy currently activated in the context.- 指定者:
canRetry
在接口中RetryPolicy
- 参数:
context
- the current retry status- 返回:
- true if the operation can proceed
- 另请参阅:
-
close
Delegate to the policy currently activated in the context.- 指定者:
close
在接口中RetryPolicy
- 参数:
context
- a retry status created by theRetryPolicy.open(RetryContext)
method of this policy.- 另请参阅:
-
open
Create an active context that proxies a retry policy by choosing a target from the policy map.- 指定者:
open
在接口中RetryPolicy
- 参数:
parent
- the parent context if we are in a nested retry.- 返回:
- a
RetryContext
object specific to this policy. - 另请参阅:
-
registerThrowable
Delegate to the policy currently activated in the context.- 指定者:
registerThrowable
在接口中RetryPolicy
- 参数:
context
- the current status object.throwable
- the exception to throw- 另请参阅:
-