R - listener result typepublic class SyncFailsafe<R> extends FailsafeConfig<R,SyncFailsafe<R>>
retry
policy, circuit breaker and
fallback.| Modifier and Type | Method and Description |
|---|---|
<T> T |
get(Callable<T> callable)
Executes the
callable until a successful result is returned or the configured RetryPolicy is
exceeded. |
<T> T |
get(ContextualCallable<T> callable)
Executes the
callable until a successful result is returned or the configured RetryPolicy is
exceeded. |
void |
run(CheckedRunnable runnable)
Executes the
runnable until successful or until the configured RetryPolicy is exceeded. |
void |
run(ContextualRunnable runnable)
Executes the
runnable until successful or until the configured RetryPolicy is exceeded. |
AsyncFailsafe<R> |
with(ScheduledExecutorService executor)
Creates and returns a new AsyncFailsafe instance that will perform executions and retries asynchronously via the
executor. |
AsyncFailsafe<R> |
with(Scheduler scheduler)
Creates and returns a new AsyncFailsafe instance that will perform executions and retries asynchronously via the
scheduler. |
onAbort, onAbort, onAbort, onAbortAsync, onAbortAsync, onAbortAsync, onComplete, onComplete, onCompleteAsync, onCompleteAsync, onFailedAttempt, onFailedAttempt, onFailedAttempt, onFailedAttemptAsync, onFailedAttemptAsync, onFailedAttemptAsync, onFailure, onFailure, onFailure, onFailureAsync, onFailureAsync, onFailureAsync, onRetriesExceeded, onRetriesExceeded, onRetriesExceededAsync, onRetriesExceededAsync, onRetry, onRetry, onRetry, onRetryAsync, onRetryAsync, onRetryAsync, onSuccess, onSuccess, onSuccessAsync, onSuccessAsync, with, with, with, withFallback, withFallback, withFallback, withFallback, withFallback, withFallback, withFallbackpublic <T> T get(Callable<T> callable)
callable until a successful result is returned or the configured RetryPolicy is
exceeded.NullPointerException - if the callable is nullFailsafeException - if the callable fails with a checked Exception or if interrupted while waiting to
perform a retry.CircuitBreakerOpenException - if a configured circuit is open.public <T> T get(ContextualCallable<T> callable)
callable until a successful result is returned or the configured RetryPolicy is
exceeded.NullPointerException - if the callable is nullFailsafeException - if the callable fails with a checked Exception or if interrupted while waiting to
perform a retry.CircuitBreakerOpenException - if a configured circuit is open.public void run(CheckedRunnable runnable)
runnable until successful or until the configured RetryPolicy is exceeded.NullPointerException - if the runnable is nullFailsafeException - if the callable fails with a checked Exception or if interrupted while waiting to
perform a retry.CircuitBreakerOpenException - if a configured circuit is open.public void run(ContextualRunnable runnable)
runnable until successful or until the configured RetryPolicy is exceeded.NullPointerException - if the runnable is nullFailsafeException - if the runnable fails with a checked Exception or if interrupted while waiting to
perform a retry.CircuitBreakerOpenException - if a configured circuit is open.public AsyncFailsafe<R> with(ScheduledExecutorService executor)
executor.NullPointerException - if executor is nullpublic AsyncFailsafe<R> with(Scheduler scheduler)
scheduler.NullPointerException - if scheduler is nullCopyright © 2017. All Rights Reserved.