| Package | Description |
|---|---|
| net.jodah.failsafe |
Core Failsafe APIs for performing failsafe executions.
|
| Modifier and Type | Method and Description |
|---|---|
<T> RetryPolicy |
RetryPolicy.abortIf(BiPredicate<T,? extends Throwable> completionPredicate)
Specifies that retries should be aborted if the
completionPredicate matches the completion result. |
<T> RetryPolicy |
RetryPolicy.abortIf(Predicate<T> resultPredicate)
Specifies that retries should be aborted if the
resultPredicate matches the result. |
RetryPolicy |
RetryPolicy.abortOn(Class<? extends Throwable>... failures)
Specifies when retries should be aborted.
|
RetryPolicy |
RetryPolicy.abortOn(Class<? extends Throwable> failure)
Specifies when retries should be aborted.
|
RetryPolicy |
RetryPolicy.abortOn(List<Class<? extends Throwable>> failures)
Specifies when retries should be aborted.
|
RetryPolicy |
RetryPolicy.abortOn(Predicate<? extends Throwable> failurePredicate)
Specifies that retries should be aborted if the
failurePredicate matches the failure. |
RetryPolicy |
RetryPolicy.abortWhen(Object result)
Specifies that retries should be aborted if the execution result matches the
result. |
RetryPolicy |
RetryPolicy.copy()
Returns a copy of this RetryPolicy.
|
<T> RetryPolicy |
RetryPolicy.retryIf(BiPredicate<T,? extends Throwable> completionPredicate)
Specifies that a retry should occur if the
completionPredicate matches the completion result and the retry
policy is not exceeded. |
<T> RetryPolicy |
RetryPolicy.retryIf(Predicate<T> resultPredicate)
Specifies that a retry should occur if the
resultPredicate matches the result and the retry policy is not
exceeded. |
RetryPolicy |
RetryPolicy.retryOn(Class<? extends Throwable>... failures)
Specifies the failures to retry on.
|
RetryPolicy |
RetryPolicy.retryOn(Class<? extends Throwable> failure)
Specifies the failure to retry on.
|
RetryPolicy |
RetryPolicy.retryOn(List<Class<? extends Throwable>> failures)
Specifies the failures to retry on.
|
RetryPolicy |
RetryPolicy.retryOn(Predicate<? extends Throwable> failurePredicate)
Specifies that a retry should occur if the
failurePredicate matches the failure and the retry policy is not
exceeded. |
RetryPolicy |
RetryPolicy.retryWhen(Object result)
Specifies that a retry should occur if the execution result equals the
result and the retry policy is not
exceeded. |
RetryPolicy |
RetryPolicy.withBackoff(long delay,
long maxDelay,
TimeUnit timeUnit)
Sets the
delay between retries, exponentially backing off to the maxDelay and multiplying
successive delays by a factor of 2. |
RetryPolicy |
RetryPolicy.withBackoff(long delay,
long maxDelay,
TimeUnit timeUnit,
double delayFactor)
Sets the
delay between retries, exponentially backing off to the maxDelay and multiplying
successive delays by the delayFactor. |
RetryPolicy |
RetryPolicy.withDelay(long delayMin,
long delayMax,
TimeUnit timeUnit)
Sets a random delay between the
delayMin and delayMax (inclusive) to occur between retries. |
RetryPolicy |
RetryPolicy.withDelay(long delay,
TimeUnit timeUnit)
Sets the
delay to occur between retries. |
RetryPolicy |
RetryPolicy.withDelay(RetryPolicy.DelayFunction<?,? extends Throwable> delayFunction)
Sets the
delayFunction that computes the next delay before retrying. |
<F extends Throwable> |
RetryPolicy.withDelayOn(RetryPolicy.DelayFunction<Object,F> delayFunction,
Class<F> failure)
Sets the
delayFunction that computes the next delay before retrying. |
<R> RetryPolicy |
RetryPolicy.withDelayWhen(RetryPolicy.DelayFunction<R,? extends Throwable> delayFunction,
R result)
Sets the
delayFunction that computes the next delay before retrying. |
RetryPolicy |
RetryPolicy.withJitter(double jitterFactor)
Sets the
jitterFactor to randomly vary retry delays by. |
RetryPolicy |
RetryPolicy.withJitter(long jitter,
TimeUnit timeUnit)
Sets the
jitter to randomly vary retry delays by. |
RetryPolicy |
RetryPolicy.withMaxDuration(long maxDuration,
TimeUnit timeUnit)
Sets the max duration to perform retries for, else the execution will be failed.
|
RetryPolicy |
RetryPolicy.withMaxRetries(int maxRetries)
Sets the max number of retries to perform.
|
| Modifier and Type | Method and Description |
|---|---|
F |
FailsafeConfig.with(RetryPolicy retryPolicy)
Configures the
retryPolicy to be used for retrying failed executions. |
static <T> SyncFailsafe<T> |
Failsafe.with(RetryPolicy retryPolicy)
Creates and returns a new SyncFailsafe instance that will perform executions and retries synchronously according to
the
retryPolicy. |
| Constructor and Description |
|---|
Execution(RetryPolicy retryPolicy)
Creates a new Execution for the
retryPolicy. |
Execution(RetryPolicy retryPolicy,
CircuitBreaker circuitBreaker)
Creates a new Execution for the
retryPolicy and circuitBreaker. |
RetryPolicy(RetryPolicy rp)
Copy constructor.
|
Copyright © 2018. All rights reserved.