R
- result typepublic class RetryPolicyConfig<R> extends DelayablePolicyConfig<R>
RetryPolicy
.
This class is threadsafe.
RetryPolicyBuilder
Modifier and Type | Method and Description |
---|---|
boolean |
allowsRetries()
Returns whether the policy config allows retries according to the configured
maxRetries and maxDuration . |
List<CheckedBiPredicate<R,Throwable>> |
getAbortConditions()
Returns the conditions for which an execution result or exception will cause retries to be aborted.
|
EventListener<ExecutionCompletedEvent<R>> |
getAbortListener()
Returns the abort event listener.
|
Duration |
getDelay()
Returns the delay between retries, else
Duration.ZERO if delays have not been configured. |
double |
getDelayFactor()
Returns the delay factor for backoff retries.
|
Duration |
getDelayMax()
Returns the max random delay between retries, else
null if random delays have not been configured. |
Duration |
getDelayMin()
Returns the min random delay between retries, else
null if random delays have not been configured. |
EventListener<ExecutionAttemptedEvent<R>> |
getFailedAttemptListener()
Returns the failed attempt event listener.
|
Duration |
getJitter()
Returns the jitter, else
null if none has been configured. |
double |
getJitterFactor()
Returns the jitter factor, else
0.0 if none has been configured. |
int |
getMaxAttempts()
Returns the max number of execution attempts to perform.
|
Duration |
getMaxDelay()
Returns the max delay between backoff retries, else
null if backoff delays have not been configured. |
Duration |
getMaxDuration()
Returns the max duration to perform retries for.
|
int |
getMaxRetries()
Returns the max number of retries to perform when an execution attempt fails.
|
EventListener<ExecutionCompletedEvent<R>> |
getRetriesExceededListener()
Returns the retries exceeded event listener.
|
EventListener<ExecutionAttemptedEvent<R>> |
getRetryListener()
Returns the retry event listener.
|
EventListener<ExecutionScheduledEvent<R>> |
getRetryScheduledListener()
Returns the retry scheduled event listener.
|
getDelayException, getDelayFn, getDelayResult
getFailureConditions, isExceptionsChecked
getFailureListener, getSuccessListener
public boolean allowsRetries()
maxRetries
and maxDuration
.public List<CheckedBiPredicate<R,Throwable>> getAbortConditions()
public Duration getDelay()
Duration.ZERO
if delays have not been configured. If backoff
delays are configured, this value will represent the initial delay.getDelay
in class DelayablePolicyConfig<R>
RetryPolicyBuilder.withDelay(Duration)
,
RetryPolicyBuilder.withBackoff(Duration, Duration, double)
,
RetryPolicyBuilder.withBackoff(Duration, Duration, double)
,
RetryPolicyBuilder.withBackoff(long, long, ChronoUnit)
,
RetryPolicyBuilder.withBackoff(long, long, ChronoUnit, double)
public Duration getDelayMin()
null
if random delays have not been configured.public Duration getDelayMax()
null
if random delays have not been configured.public double getDelayFactor()
public Duration getJitter()
null
if none has been configured.RetryPolicyBuilder.withJitter(Duration)
public double getJitterFactor()
0.0
if none has been configured.RetryPolicyBuilder.withJitter(double)
public int getMaxAttempts()
-1
represents no limit. Defaults to
3
.public Duration getMaxDelay()
null
if backoff delays have not been configured.public Duration getMaxDuration()
public int getMaxRetries()
-1
represents no
limit. Defaults to 2
.public EventListener<ExecutionCompletedEvent<R>> getAbortListener()
public EventListener<ExecutionAttemptedEvent<R>> getFailedAttemptListener()
public EventListener<ExecutionCompletedEvent<R>> getRetriesExceededListener()
public EventListener<ExecutionAttemptedEvent<R>> getRetryListener()
public EventListener<ExecutionScheduledEvent<R>> getRetryScheduledListener()
Copyright © 2022. All rights reserved.