Package dev.failsafe
Class RetryPolicyConfig<R>
java.lang.Object
dev.failsafe.PolicyConfig<R>
dev.failsafe.FailurePolicyConfig<R>
dev.failsafe.DelayablePolicyConfig<R>
dev.failsafe.RetryPolicyConfig<R>
- Type Parameters:
R
- result type
Configuration for a
RetryPolicy
.
This class is threadsafe.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) List
<CheckedBiPredicate<R, Throwable>> (package private) EventListener
<ExecutionCompletedEvent<R>> (package private) double
(package private) Duration
(package private) Duration
(package private) EventListener
<ExecutionAttemptedEvent<R>> (package private) Duration
(package private) double
(package private) Duration
(package private) Duration
(package private) int
(package private) EventListener
<ExecutionCompletedEvent<R>> (package private) EventListener
<ExecutionAttemptedEvent<R>> (package private) EventListener
<ExecutionScheduledEvent<R>> Fields inherited from class dev.failsafe.DelayablePolicyConfig
delay, delayException, delayFn, delayResult
Fields inherited from class dev.failsafe.FailurePolicyConfig
exceptionsChecked, failureConditions
Fields inherited from class dev.failsafe.PolicyConfig
failureListener, successListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether the policy config allows retries according to the configuredmaxRetries
andmaxDuration
.Returns the conditions for which an execution result or exception will cause retries to be aborted.Returns the abort event listener.getDelay()
Returns the delay between retries, elseDuration.ZERO
if delays have not been configured.double
Returns the delay factor for backoff retries.Returns the max random delay between retries, elsenull
if random delays have not been configured.Returns the min random delay between retries, elsenull
if random delays have not been configured.Returns the failed attempt event listener.Returns the jitter, elsenull
if none has been configured.double
Returns the jitter factor, else0.0
if none has been configured.int
Returns the max number of execution attempts to perform.Returns the max delay between backoff retries, elsenull
if backoff delays have not been configured.Returns the max duration to perform retries for.int
Returns the max number of retries to perform when an execution attempt fails.Returns the retries exceeded event listener.Returns the retry event listener.Returns the retry scheduled event listener.Methods inherited from class dev.failsafe.DelayablePolicyConfig
getDelayException, getDelayFn, getDelayResult
Methods inherited from class dev.failsafe.FailurePolicyConfig
getFailureConditions, isExceptionsChecked
Methods inherited from class dev.failsafe.PolicyConfig
getFailureListener, getSuccessListener
-
Field Details
-
delayMin
Duration delayMin -
delayMax
Duration delayMax -
delayFactor
double delayFactor -
maxDelay
Duration maxDelay -
jitter
Duration jitter -
jitterFactor
double jitterFactor -
maxDuration
Duration maxDuration -
maxRetries
int maxRetries -
abortConditions
List<CheckedBiPredicate<R,Throwable>> abortConditions -
abortListener
EventListener<ExecutionCompletedEvent<R>> abortListener -
failedAttemptListener
EventListener<ExecutionAttemptedEvent<R>> failedAttemptListener -
retriesExceededListener
EventListener<ExecutionCompletedEvent<R>> retriesExceededListener -
retryListener
EventListener<ExecutionAttemptedEvent<R>> retryListener -
retryScheduledListener
EventListener<ExecutionScheduledEvent<R>> retryScheduledListener
-
-
Constructor Details
-
RetryPolicyConfig
RetryPolicyConfig() -
RetryPolicyConfig
RetryPolicyConfig(RetryPolicyConfig<R> config)
-
-
Method Details
-
allowsRetries
public boolean allowsRetries()Returns whether the policy config allows retries according to the configuredmaxRetries
andmaxDuration
.- See Also:
-
getAbortConditions
Returns the conditions for which an execution result or exception will cause retries to be aborted.- See Also:
-
getDelay
Returns the delay between retries, elseDuration.ZERO
if delays have not been configured. If backoff delays are configured, this value will represent the initial delay.- Overrides:
getDelay
in classDelayablePolicyConfig<R>
- See Also:
-
getDelayMin
Returns the min random delay between retries, elsenull
if random delays have not been configured.- See Also:
-
getDelayMax
Returns the max random delay between retries, elsenull
if random delays have not been configured.- See Also:
-
getDelayFactor
public double getDelayFactor()Returns the delay factor for backoff retries.- See Also:
-
getJitter
Returns the jitter, elsenull
if none has been configured.- See Also:
-
getJitterFactor
public double getJitterFactor()Returns the jitter factor, else0.0
if none has been configured.- See Also:
-
getMaxAttempts
public int getMaxAttempts()Returns the max number of execution attempts to perform. A value of-1
represents no limit. Defaults to3
.- See Also:
-
getMaxDelay
Returns the max delay between backoff retries, elsenull
if backoff delays have not been configured.- See Also:
-
getMaxDuration
Returns the max duration to perform retries for.- See Also:
-
getMaxRetries
public int getMaxRetries()Returns the max number of retries to perform when an execution attempt fails. A value of-1
represents no limit. Defaults to2
.- See Also:
-
getAbortListener
Returns the abort event listener.- See Also:
-
getFailedAttemptListener
Returns the failed attempt event listener.- See Also:
-
getRetriesExceededListener
Returns the retries exceeded event listener.- See Also:
-
getRetryListener
Returns the retry event listener.- See Also:
-
getRetryScheduledListener
Returns the retry scheduled event listener.- See Also:
-