| Package | Description |
|---|---|
| net.jodah.failsafe |
Core Failsafe APIs for performing failsafe executions.
|
| Modifier and Type | Method and Description |
|---|---|
static ExecutionResult |
ExecutionResult.failure(Throwable failure)
Returns a an ExecutionResult with the
failure set, completed true and success false. |
protected ExecutionResult |
PolicyExecutor.onFailure(ExecutionResult result)
Performs post-execution handling for a
result that is considered a failure according to PolicyExecutor.isFailure(ExecutionResult), possibly creating a new result, else returning the original result. |
protected ExecutionResult |
PolicyExecutor.postExecute(ExecutionResult result)
Performs synchronous post-execution handling for a
result. |
protected ExecutionResult |
PolicyExecutor.preExecute()
Called before execution to return an alternative result or failure such as if execution is not allowed or needed.
|
static ExecutionResult |
ExecutionResult.success(Object result)
Returns a an ExecutionResult with the
result set, completed true and success true. |
ExecutionResult |
ExecutionResult.with(long waitNanos,
boolean completed,
boolean success)
Returns a copy of the ExecutionResult with the
waitNanos, completed and success values. |
ExecutionResult |
ExecutionResult.withComplete()
Returns a copy of the ExecutionResult with the value set to true, else this if nothing has changed.
|
ExecutionResult |
ExecutionResult.withResult(Object result)
Returns a copy of the ExecutionResult with the
result value, and completed and success set to true. |
| Modifier and Type | Method and Description |
|---|---|
protected CompletableFuture<ExecutionResult> |
PolicyExecutor.onFailureAsync(ExecutionResult result,
Scheduler scheduler,
FailsafeFuture<Object> future)
Performs potentially asynchrononus post-execution handling for a failed
result, possibly creating a new
result, else returning the original result. |
protected CompletableFuture<ExecutionResult> |
PolicyExecutor.postExecuteAsync(ExecutionResult result,
Scheduler scheduler,
FailsafeFuture<Object> future)
Performs potentially asynchronous post-execution handling for a
result. |
protected Supplier<ExecutionResult> |
PolicyExecutor.supply(Supplier<ExecutionResult> supplier,
Scheduler scheduler)
Performs an execution by calling pre-execute else calling the supplier and doing a post-execute.
|
protected Supplier<CompletableFuture<ExecutionResult>> |
PolicyExecutor.supplyAsync(Supplier<CompletableFuture<ExecutionResult>> supplier,
Scheduler scheduler,
FailsafeFuture<Object> future)
Performs an async execution by calling pre-execute else calling the supplier and doing a post-execute.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
PolicyExecutor.isFailure(ExecutionResult result)
Returns whether the
result is a success according to the policy. |
protected ExecutionResult |
PolicyExecutor.onFailure(ExecutionResult result)
Performs post-execution handling for a
result that is considered a failure according to PolicyExecutor.isFailure(ExecutionResult), possibly creating a new result, else returning the original result. |
protected CompletableFuture<ExecutionResult> |
PolicyExecutor.onFailureAsync(ExecutionResult result,
Scheduler scheduler,
FailsafeFuture<Object> future)
Performs potentially asynchrononus post-execution handling for a failed
result, possibly creating a new
result, else returning the original result. |
protected void |
PolicyExecutor.onSuccess(ExecutionResult result)
Performs post-execution handling for a
result that is considered a success according to PolicyExecutor.isFailure(ExecutionResult). |
protected ExecutionResult |
PolicyExecutor.postExecute(ExecutionResult result)
Performs synchronous post-execution handling for a
result. |
protected CompletableFuture<ExecutionResult> |
PolicyExecutor.postExecuteAsync(ExecutionResult result,
Scheduler scheduler,
FailsafeFuture<Object> future)
Performs potentially asynchronous post-execution handling for a
result. |
| Modifier and Type | Method and Description |
|---|---|
protected Supplier<ExecutionResult> |
PolicyExecutor.supply(Supplier<ExecutionResult> supplier,
Scheduler scheduler)
Performs an execution by calling pre-execute else calling the supplier and doing a post-execute.
|
protected Supplier<CompletableFuture<ExecutionResult>> |
PolicyExecutor.supplyAsync(Supplier<CompletableFuture<ExecutionResult>> supplier,
Scheduler scheduler,
FailsafeFuture<Object> future)
Performs an async execution by calling pre-execute else calling the supplier and doing a post-execute.
|
Copyright © 2019. All rights reserved.