R - result typeF - failsafe type - SyncFailsafe or AsyncFailsafepublic class FailsafeConfig<R,F> extends Object
| Modifier and Type | Method and Description |
|---|---|
F |
onAbort(CheckedBiConsumer<? extends R,? extends Throwable> listener)
Registers the
listener to be called when an execution is aborted. |
F |
onAbort(CheckedConsumer<? extends Throwable> listener)
Registers the
listener to be called when an execution is aborted. |
F |
onAbort(ContextualResultListener<? extends R,? extends Throwable> listener)
Registers the
listener to be called when an execution is aborted. |
F |
onAbortAsync(CheckedBiConsumer<? extends R,? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution is aborted. |
F |
onAbortAsync(CheckedConsumer<? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution is aborted. |
F |
onAbortAsync(ContextualResultListener<? extends R,? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution is aborted. |
F |
onComplete(CheckedBiConsumer<? extends R,? extends Throwable> listener)
Registers the
listener to be called when an execution is completed. |
F |
onComplete(ContextualResultListener<? extends R,? extends Throwable> listener)
Registers the
listener to be called when an execution is completed. |
F |
onCompleteAsync(CheckedBiConsumer<? extends R,? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution is completed. |
F |
onCompleteAsync(ContextualResultListener<? extends R,? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution is completed. |
F |
onFailedAttempt(CheckedBiConsumer<? extends R,? extends Throwable> listener)
Registers the
listener to be called when an execution attempt fails. |
F |
onFailedAttempt(CheckedConsumer<? extends Throwable> listener)
Registers the
listener to be called when an execution attempt fails. |
F |
onFailedAttempt(ContextualResultListener<? extends R,? extends Throwable> listener)
Registers the
listener to be called when an execution attempt fails. |
F |
onFailedAttemptAsync(CheckedBiConsumer<? extends R,? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution attempt fails. |
F |
onFailedAttemptAsync(CheckedConsumer<? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution attempt fails. |
F |
onFailedAttemptAsync(ContextualResultListener<? extends R,? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution attempt fails. |
F |
onFailure(CheckedBiConsumer<? extends R,? extends Throwable> listener)
Registers the
listener to be called when an execution fails and cannot be retried. |
F |
onFailure(CheckedConsumer<? extends Throwable> listener)
Registers the
listener to be called when an execution fails and cannot be retried. |
F |
onFailure(ContextualResultListener<? extends R,? extends Throwable> listener)
Registers the
listener to be called when an execution fails and cannot be retried. |
F |
onFailureAsync(CheckedBiConsumer<? extends R,? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution fails and
cannot be retried. |
F |
onFailureAsync(CheckedConsumer<? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution fails and
cannot be retried. |
F |
onFailureAsync(ContextualResultListener<? extends R,? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution fails and
cannot be retried. |
F |
onRetriesExceeded(CheckedBiConsumer<? extends R,? extends Throwable> listener)
Registers the
listener to be called when an execution fails and the max retry attempts or max duration are
exceeded. |
F |
onRetriesExceeded(CheckedConsumer<? extends Throwable> listener)
Registers the
listener to be called when an execution fails and the max retry attempts or max duration are
exceeded. |
F |
onRetriesExceededAsync(CheckedBiConsumer<? extends R,? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution fails and the
max retry attempts or
max duration are exceeded. |
F |
onRetriesExceededAsync(CheckedConsumer<? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution fails and the
max retry attempts or
max duration are exceeded. |
F |
onRetry(CheckedBiConsumer<? extends R,? extends Throwable> listener)
Registers the
listener to be called before an execution is retried. |
F |
onRetry(CheckedConsumer<? extends Throwable> listener)
Registers the
listener to be called before an execution is retried. |
F |
onRetry(ContextualResultListener<? extends R,? extends Throwable> listener)
Registers the
listener to be called before an execution is retried. |
F |
onRetryAsync(CheckedBiConsumer<? extends R,? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor before an execution is retried. |
F |
onRetryAsync(CheckedConsumer<? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor before an execution is retried. |
F |
onRetryAsync(ContextualResultListener<? extends R,? extends Throwable> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor before an execution is retried. |
F |
onSuccess(CheckedBiConsumer<? extends R,ExecutionContext> listener)
Registers the
listener to be called when an execution is successful. |
F |
onSuccess(CheckedConsumer<? extends R> listener)
Registers the
listener to be called when an execution is successful. |
F |
onSuccessAsync(CheckedBiConsumer<? extends R,ExecutionContext> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution is successful. |
F |
onSuccessAsync(CheckedConsumer<? extends R> listener,
ExecutorService executor)
Registers the
listener to be called asynchronously on the executor when an execution is successful. |
F |
with(CircuitBreaker circuitBreaker)
Configures the
circuitBreaker to be used to control the rate of event execution. |
<T> F |
with(Listeners<T> listeners)
Configures the
listeners to be called as execution events occur. |
F |
with(RetryPolicy retryPolicy)
Configures the
retryPolicy to be used for retrying failed executions. |
F |
withFallback(Callable<? extends R> fallback)
Configures the
fallback action to be executed if execution fails. |
F |
withFallback(CheckedBiConsumer<? extends R,? extends Throwable> fallback)
Configures the
fallback action to be executed if execution fails. |
F |
withFallback(CheckedBiFunction<? extends R,? extends Throwable,? extends R> fallback)
Configures the
fallback action to be executed if execution fails. |
F |
withFallback(CheckedConsumer<? extends Throwable> fallback)
Configures the
fallback action to be executed if execution fails. |
F |
withFallback(CheckedFunction<? extends Throwable,? extends R> fallback)
Configures the
fallback action to be executed if execution fails. |
F |
withFallback(CheckedRunnable fallback)
Configures the
fallback action to be executed if execution fails. |
F |
withFallback(R fallback)
Configures the
fallback result to be returned if execution fails. |
public F onAbort(CheckedBiConsumer<? extends R,? extends Throwable> listener)
listener to be called when an execution is aborted.public F onAbort(CheckedConsumer<? extends Throwable> listener)
listener to be called when an execution is aborted.public F onAbort(ContextualResultListener<? extends R,? extends Throwable> listener)
listener to be called when an execution is aborted.public F onAbortAsync(CheckedBiConsumer<? extends R,? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution is aborted.public F onAbortAsync(CheckedConsumer<? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution is aborted.public F onAbortAsync(ContextualResultListener<? extends R,? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution is aborted.public F onComplete(CheckedBiConsumer<? extends R,? extends Throwable> listener)
listener to be called when an execution is completed.public F onComplete(ContextualResultListener<? extends R,? extends Throwable> listener)
listener to be called when an execution is completed.public F onCompleteAsync(CheckedBiConsumer<? extends R,? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution is completed.public F onCompleteAsync(ContextualResultListener<? extends R,? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution is completed.public F onFailedAttempt(CheckedBiConsumer<? extends R,? extends Throwable> listener)
listener to be called when an execution attempt fails.public F onFailedAttempt(CheckedConsumer<? extends Throwable> listener)
listener to be called when an execution attempt fails.public F onFailedAttempt(ContextualResultListener<? extends R,? extends Throwable> listener)
listener to be called when an execution attempt fails.public F onFailedAttemptAsync(CheckedBiConsumer<? extends R,? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution attempt fails.public F onFailedAttemptAsync(CheckedConsumer<? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution attempt fails.public F onFailedAttemptAsync(ContextualResultListener<? extends R,? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution attempt fails.public F onFailure(CheckedBiConsumer<? extends R,? extends Throwable> listener)
listener to be called when an execution fails and cannot be retried.public F onFailure(CheckedConsumer<? extends Throwable> listener)
listener to be called when an execution fails and cannot be retried.public F onFailure(ContextualResultListener<? extends R,? extends Throwable> listener)
listener to be called when an execution fails and cannot be retried.public F onFailureAsync(CheckedBiConsumer<? extends R,? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution fails and
cannot be retried.public F onFailureAsync(CheckedConsumer<? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution fails and
cannot be retried.public F onFailureAsync(ContextualResultListener<? extends R,? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution fails and
cannot be retried.public F onRetriesExceeded(CheckedBiConsumer<? extends R,? extends Throwable> listener)
listener to be called when an execution fails and the max retry attempts or max duration are
exceeded.public F onRetriesExceeded(CheckedConsumer<? extends Throwable> listener)
listener to be called when an execution fails and the max retry attempts or max duration are
exceeded.public F onRetriesExceededAsync(CheckedBiConsumer<? extends R,? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution fails and the
max retry attempts or
max duration are exceeded.public F onRetriesExceededAsync(CheckedConsumer<? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution fails and the
max retry attempts or
max duration are exceeded.public F onRetry(CheckedBiConsumer<? extends R,? extends Throwable> listener)
listener to be called before an execution is retried.public F onRetry(CheckedConsumer<? extends Throwable> listener)
listener to be called before an execution is retried.public F onRetry(ContextualResultListener<? extends R,? extends Throwable> listener)
listener to be called before an execution is retried.public F onRetryAsync(CheckedBiConsumer<? extends R,? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor before an execution is retried.public F onRetryAsync(CheckedConsumer<? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor before an execution is retried.public F onRetryAsync(ContextualResultListener<? extends R,? extends Throwable> listener, ExecutorService executor)
listener to be called asynchronously on the executor before an execution is retried.public F onSuccess(CheckedBiConsumer<? extends R,ExecutionContext> listener)
listener to be called when an execution is successful.public F onSuccess(CheckedConsumer<? extends R> listener)
listener to be called when an execution is successful.public F onSuccessAsync(CheckedBiConsumer<? extends R,ExecutionContext> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution is successful.public F onSuccessAsync(CheckedConsumer<? extends R> listener, ExecutorService executor)
listener to be called asynchronously on the executor when an execution is successful.public F with(CircuitBreaker circuitBreaker)
circuitBreaker to be used to control the rate of event execution.NullPointerException - if circuitBreaker is nullIllegalStateException - if a circuit breaker is already configuredpublic <T> F with(Listeners<T> listeners)
listeners to be called as execution events occur.NullPointerException - if listeners is nullpublic F with(RetryPolicy retryPolicy)
retryPolicy to be used for retrying failed executions.NullPointerException - if retryPolicy is nullIllegalStateException - if a retry policy is already configuredpublic F withFallback(Callable<? extends R> fallback)
fallback action to be executed if execution fails.NullPointerException - if fallback is nullIllegalStateException - if withFallback method has already been calledpublic F withFallback(CheckedBiConsumer<? extends R,? extends Throwable> fallback)
fallback action to be executed if execution fails.NullPointerException - if fallback is nullIllegalStateException - if withFallback method has already been calledpublic F withFallback(CheckedBiFunction<? extends R,? extends Throwable,? extends R> fallback)
fallback action to be executed if execution fails.NullPointerException - if fallback is nullIllegalStateException - if withFallback method has already been calledpublic F withFallback(CheckedConsumer<? extends Throwable> fallback)
fallback action to be executed if execution fails.NullPointerException - if fallback is nullIllegalStateException - if withFallback method has already been calledpublic F withFallback(CheckedFunction<? extends Throwable,? extends R> fallback)
fallback action to be executed if execution fails.NullPointerException - if fallback is nullIllegalStateException - if withFallback method has already been calledpublic F withFallback(CheckedRunnable fallback)
fallback action to be executed if execution fails.NullPointerException - if fallback is nullIllegalStateException - if withFallback method has already been calledpublic F withFallback(R fallback)
fallback result to be returned if execution fails.NullPointerException - if fallback is nullIllegalStateException - if withFallback method has already been calledCopyright © 2018. All rights reserved.