类 Retryer.Builder<V>
- java.lang.Object
-
- tech.testnx.cah.common.retry.Retryer.Builder<V>
-
-
构造器概要
构造器 构造器 说明 Builder()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Retryer<V>build()Build a Retryer based on the configurationRetryer.Builder<V>withCondition(Predicate<V> condition)Stop the retrying by test the condition.Retryer.Builder<V>withIntervalWaitInSecond(int intervalWaitInSecond)Interval waiting time in second between each retryingRetryer.Builder<V>withMaxRetry(int maxRetry)Max Retry countRetryer.Builder<V>withProcedureRetry(int procedureRetry)Procedure retry countRetryer.Builder<V>withRecoveryProcedure(Callable<Boolean> recoveryProcedure)Set a recovery procedure after each retrying.Retryer.Builder<V>withStopByException(boolean stopByException)Stop retrying if stopByException is true and any exception is thrown
Default set value is false, so continue retry if exceptionRetryer.Builder<V>withStopProcedure(Callable<Boolean> stopProcedure)Set a procedure after stop retrying
Do nothing by default
-
-
-
方法详细资料
-
withMaxRetry
public Retryer.Builder<V> withMaxRetry(int maxRetry)
Max Retry count- 参数:
maxRetry- is required, missing will caused exception- 返回:
-
withProcedureRetry
public Retryer.Builder<V> withProcedureRetry(int procedureRetry)
Procedure retry count- 参数:
procedureRetry- is not required, default value is 3- 返回:
-
withIntervalWaitInSecond
public Retryer.Builder<V> withIntervalWaitInSecond(int intervalWaitInSecond)
Interval waiting time in second between each retrying- 参数:
intervalWaitInSecond- is required, missing will caused exception- 返回:
-
withCondition
public Retryer.Builder<V> withCondition(Predicate<V> condition)
Stop the retrying by test the condition. If condition result is true, then stop retrying- 参数:
condition- is required, missing will caused exception- 返回:
-
withStopProcedure
public Retryer.Builder<V> withStopProcedure(Callable<Boolean> stopProcedure)
Set a procedure after stop retrying
Do nothing by default- 参数:
stopProcedure-- 返回:
-
withRecoveryProcedure
public Retryer.Builder<V> withRecoveryProcedure(Callable<Boolean> recoveryProcedure)
Set a recovery procedure after each retrying.
Do nothing by default- 参数:
recoveryProcedure-- 返回:
-
withStopByException
public Retryer.Builder<V> withStopByException(boolean stopByException)
Stop retrying if stopByException is true and any exception is thrown
Default set value is false, so continue retry if exception- 参数:
stopByException-- 返回:
-
-