Uses of Class
dev.failsafe.RetryPolicyBuilder
Packages that use RetryPolicyBuilder
-
Uses of RetryPolicyBuilder in dev.failsafe
Methods in dev.failsafe that return RetryPolicyBuilderModifier and TypeMethodDescriptionRetryPolicyBuilder.abortIf
(CheckedBiPredicate<R, ? extends Throwable> completionPredicate) Specifies that retries should be aborted if thecompletionPredicate
matches the completion result.RetryPolicyBuilder.abortIf
(CheckedPredicate<R> resultPredicate) Specifies that retries should be aborted if theresultPredicate
matches the result.RetryPolicyBuilder.abortOn
(CheckedPredicate<? extends Throwable> abortPredicate) Specifies that retries should be aborted if theabortPredicate
matches the exception.Specifies when retries should be aborted.final RetryPolicyBuilder
<R> Specifies when retries should be aborted.Specifies when retries should be aborted.Specifies that retries should be aborted if the execution result matches theresult
.static <R> RetryPolicyBuilder
<R> RetryPolicy.builder()
Creates a RetryPolicyBuilder that by default will build a RetryPolicy that allows 3 execution attempts max with no delay, unless configured otherwise.static <R> RetryPolicyBuilder
<R> RetryPolicy.builder
(RetryPolicyConfig<R> config) Creates a new RetryPolicyBuilder that will be based on theconfig
.RetryPolicyBuilder.onAbort
(EventListener<ExecutionCompletedEvent<R>> listener) Registers thelistener
to be called when an execution is aborted.RetryPolicyBuilder.onFailedAttempt
(EventListener<ExecutionAttemptedEvent<R>> listener) Registers thelistener
to be called when an execution attempt fails.RetryPolicyBuilder.onRetriesExceeded
(EventListener<ExecutionCompletedEvent<R>> listener) Registers thelistener
to be called when an execution fails and themax retry attempts
ormax duration
are exceeded.RetryPolicyBuilder.onRetry
(EventListener<ExecutionAttemptedEvent<R>> listener) Registers thelistener
to be called when a retry is about to be attempted.RetryPolicyBuilder.onRetryScheduled
(EventListener<ExecutionScheduledEvent<R>> listener) Registers thelistener
to be called when a retry for an async call is about to be scheduled.RetryPolicyBuilder.withBackoff
(long delay, long maxDelay, ChronoUnit chronoUnit) Sets thedelay
between retries, exponentially backing off to themaxDelay
and multiplying consecutive delays by a factor of 2.RetryPolicyBuilder.withBackoff
(long delay, long maxDelay, ChronoUnit chronoUnit, double delayFactor) Sets thedelay
between retries, exponentially backing off to themaxDelay
and multiplying consecutive delays by thedelayFactor
.RetryPolicyBuilder.withBackoff
(Duration delay, Duration maxDelay) Sets thedelay
between retries, exponentially backing off to themaxDelay
and multiplying consecutive delays by a factor of 2.RetryPolicyBuilder.withBackoff
(Duration delay, Duration maxDelay, double delayFactor) Sets thedelay
between retries, exponentially backing off to themaxDelay
and multiplying consecutive delays by thedelayFactor
.RetryPolicyBuilder.withDelay
(long delayMin, long delayMax, ChronoUnit chronoUnit) Sets a random delay between thedelayMin
anddelayMax
(inclusive) to occur between retries.Sets the fixeddelay
to occur between retries.Sets a random delay between thedelayMin
anddelayMax
(inclusive) to occur between retries.RetryPolicyBuilder.withJitter
(double jitterFactor) Sets thejitterFactor
to randomly vary retry delays by.RetryPolicyBuilder.withJitter
(Duration jitter) Sets thejitter
to randomly vary retry delays by.RetryPolicyBuilder.withMaxAttempts
(int maxAttempts) Sets the max number of execution attempts to perform.RetryPolicyBuilder.withMaxDuration
(Duration maxDuration) Sets the max duration to perform retries for, else the execution will be failed.RetryPolicyBuilder.withMaxRetries
(int maxRetries) Sets the max number of retries to perform when an execution attempt fails.