| Package | Description |
|---|---|
| net.jodah.failsafe |
Core Failsafe APIs for performing failsafe executions.
|
| Modifier and Type | Field and Description |
|---|---|
static Fallback<Void> |
Fallback.VOID
A fallback that will return a void result if execution fails.
|
| 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.of(CheckedFunction<ExecutionAttemptedEvent<? extends R>,? extends R> fallback)
Returns the
fallback to be executed if execution fails. |
static <R> Fallback<R> |
Fallback.of(CheckedRunnable fallback)
Returns the
fallback to be executed if execution fails. |
static <R> Fallback<R> |
Fallback.of(CheckedSupplier<? extends R> fallback)
Returns the
fallback to be executed if execution fails. |
static <R> Fallback<R> |
Fallback.of(R fallbackResult)
Returns the
fallbackResult to be provided if execution fails. |
static <R> Fallback<R> |
Fallback.ofAsync(CheckedConsumer<ExecutionAttemptedEvent<? extends R>> fallback)
Returns the
fallback to be executed asynchronously if execution fails. |
static <R> Fallback<R> |
Fallback.ofAsync(CheckedFunction<ExecutionAttemptedEvent<? extends R>,? extends R> fallback)
Returns the
fallback to be executed asynchronously if execution fails. |
static <R> Fallback<R> |
Fallback.ofAsync(CheckedRunnable fallback)
Returns the
fallback to be executed asynchronously if execution fails. |
static <R> Fallback<R> |
Fallback.ofAsync(CheckedSupplier<? extends R> fallback)
Returns the
fallback to be executed asynchronously if execution fails. |
static <R> Fallback<R> |
Fallback.ofException(CheckedFunction<ExecutionAttemptedEvent<? extends R>,? extends Exception> fallback)
Returns the
fallback to be executed if execution fails and allows an alternative exception to be supplied
instead. |
static <R> Fallback<R> |
Fallback.ofStage(CheckedFunction<ExecutionAttemptedEvent<? extends R>,? extends CompletionStage<R>> fallback)
Returns the
fallback to be executed if execution fails. |
static <R> Fallback<R> |
Fallback.ofStage(CheckedSupplier<? extends CompletionStage<R>> fallback)
Returns the
fallback to be executed if execution fails. |
static <R> Fallback<R> |
Fallback.ofStageAsync(CheckedFunction<ExecutionAttemptedEvent<? extends R>,? extends CompletionStage<R>> fallback)
Returns the
fallback to be executed asynchronously if execution fails. |
static <R> Fallback<R> |
Fallback.ofStageAsync(CheckedSupplier<? extends CompletionStage<R>> fallback)
Returns the
fallback to be executed asynchronously if execution fails. |
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. |
Copyright © 2021. All rights reserved.