类 CircuitBreakerRetryPolicy
java.lang.Object
infra.retry.policy.CircuitBreakerRetryPolicy
- 所有已实现的接口:
RetryPolicy
,Serializable
- 从以下版本开始:
- 4.0
- 作者:
- Dave Syer, Harry Yang
- 另请参阅:
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明static final String
static final String
private final RetryPolicy
private static final infra.logging.Logger
private long
private long
从接口继承的字段 infra.retry.RetryPolicy
NO_MAXIMUM_ATTEMPTS_SET
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
canRetry
(RetryContext context) void
close
(RetryContext context) open
(RetryContext parent) Acquire resources needed for the retry operation.void
openTimeoutSupplier
(Supplier<Long> timeoutSupplier) A supplier for the Timeout for tripping the open circuit.void
registerThrowable
(RetryContext context, Throwable throwable) Called once per retry attempt, after the callback fails.void
resetTimeoutSupplier
(Supplier<Long> timeoutSupplier) A supplier for the timeout for resetting circuit in milliseconds.void
setOpenTimeout
(long timeout) Timeout for tripping the open circuit.void
setResetTimeout
(long timeout) Timeout for resetting circuit in milliseconds.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 infra.retry.RetryPolicy
getMaxAttempts
-
字段详细资料
-
构造器详细资料
-
CircuitBreakerRetryPolicy
public CircuitBreakerRetryPolicy() -
CircuitBreakerRetryPolicy
-
-
方法详细资料
-
setResetTimeout
public void setResetTimeout(long timeout) Timeout for resetting circuit in milliseconds. After the circuit opens it will re-close after this time has elapsed and the context will be restarted.- 参数:
timeout
- the timeout to set in milliseconds
-
resetTimeoutSupplier
A supplier for the timeout for resetting circuit in milliseconds. After the circuit opens it will re-close after this time has elapsed and the context will be restarted.- 参数:
timeoutSupplier
- a supplier for the timeout to set in milliseconds
-
setOpenTimeout
public void setOpenTimeout(long timeout) Timeout for tripping the open circuit. If the delegate policy cannot retry and the time elapsed since the context was started is less than this window, then the circuit is opened.- 参数:
timeout
- the timeout to set in milliseconds
-
openTimeoutSupplier
A supplier for the Timeout for tripping the open circuit. If the delegate policy cannot retry and the time elapsed since the context was started is less than this window, then the circuit is opened.- 参数:
timeoutSupplier
- a supplier for the timeout to set in milliseconds
-
canRetry
- 指定者:
canRetry
在接口中RetryPolicy
- 参数:
context
- the current retry status- 返回:
- true if the operation can proceed
-
open
从接口复制的说明:RetryPolicy
Acquire 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.- 指定者:
open
在接口中RetryPolicy
- 参数:
parent
- the parent context if we are in a nested retry.- 返回:
- a
RetryContext
object specific to this policy.
-
close
- 指定者:
close
在接口中RetryPolicy
- 参数:
context
- a retry status created by theRetryPolicy.open(RetryContext)
method of this policy.
-
registerThrowable
从接口复制的说明:RetryPolicy
Called once per retry attempt, after the callback fails.- 指定者:
registerThrowable
在接口中RetryPolicy
- 参数:
context
- the current status object.throwable
- the exception to throw
-