| Package | Description |
|---|---|
| net.jodah.failsafe |
Core Failsafe APIs for performing failsafe executions.
|
| Modifier and Type | Method and Description |
|---|---|
static <R> Fallback<R> |
Fallback.of(CheckedConsumer<ExecutionAttemptedEvent<? extends R>> fallback)
Returns the
fallback to be executed if execution fails. |
static <R> Fallback<R> |
Fallback.ofAsync(CheckedConsumer<ExecutionAttemptedEvent<? extends R>> fallback)
Returns the
fallback to be executed asynchronously if execution fails. |
RetryPolicy<R> |
RetryPolicy.onAbort(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when an execution is aborted. |
FailsafeExecutor<R> |
FailsafeExecutor.onComplete(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when an execution is complete for all of the configured policies are
exceeded. |
Fallback<R> |
Fallback.onFailedAttempt(CheckedConsumer<? extends ExecutionAttemptedEvent<R>> listener)
Registers the
listener to be called when the last execution attempt prior to the fallback failed. |
RetryPolicy<R> |
RetryPolicy.onFailedAttempt(CheckedConsumer<? extends ExecutionAttemptedEvent<R>> listener)
Registers the
listener to be called when an execution attempt fails. |
FailsafeExecutor<R> |
FailsafeExecutor.onFailure(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when an execution fails. |
S |
PolicyListeners.onFailure(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when a Policy fails to handle an execution. |
RetryPolicy<R> |
RetryPolicy.onRetriesExceeded(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when an execution fails and the max retry attempts or max duration are exceeded. |
RetryPolicy<R> |
RetryPolicy.onRetry(CheckedConsumer<? extends ExecutionAttemptedEvent<R>> listener)
Registers the
listener to be called when a retry is about to be attempted. |
RetryPolicy<R> |
RetryPolicy.onRetryScheduled(CheckedConsumer<? extends ExecutionScheduledEvent<R>> listener)
Registers the
listener to be called when a retry is about to be scheduled. |
FailsafeExecutor<R> |
FailsafeExecutor.onSuccess(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when an execution is successful. |
S |
PolicyListeners.onSuccess(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when a Policy succeeds in handling an execution. |
Copyright © 2021. All rights reserved.