public enum SyncRetryExecutor extends Enum<SyncRetryExecutor> implements RetryExecutor
RetryExecutor that executes tasks in the same thread and without retry.
Useful for testing or when no-op implementation of RetryExecutor is needed.
This implementation, while implements the API, runs all tasks synchronously so that returned futures are already completed.
Exceptions are not thrown but wrapped in Future as well.| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.util.concurrent.ListenableFuture<Void> |
doWithRetry(RetryRunnable action) |
<V> com.google.common.util.concurrent.ListenableFuture<V> |
getFutureWithRetry(RetryCallable<com.google.common.util.concurrent.ListenableFuture<V>> task) |
<V> com.google.common.util.concurrent.ListenableFuture<V> |
getWithRetry(Callable<V> task) |
<V> com.google.common.util.concurrent.ListenableFuture<V> |
getWithRetry(RetryCallable<V> task) |
static SyncRetryExecutor |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SyncRetryExecutor[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SyncRetryExecutor INSTANCE
public static SyncRetryExecutor[] values()
for (SyncRetryExecutor c : SyncRetryExecutor.values()) System.out.println(c);
public static SyncRetryExecutor valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic com.google.common.util.concurrent.ListenableFuture<Void> doWithRetry(RetryRunnable action)
doWithRetry in interface RetryExecutorpublic <V> com.google.common.util.concurrent.ListenableFuture<V> getWithRetry(Callable<V> task)
getWithRetry in interface RetryExecutorpublic <V> com.google.common.util.concurrent.ListenableFuture<V> getWithRetry(RetryCallable<V> task)
getWithRetry in interface RetryExecutorpublic <V> com.google.common.util.concurrent.ListenableFuture<V> getFutureWithRetry(RetryCallable<com.google.common.util.concurrent.ListenableFuture<V>> task)
getFutureWithRetry in interface RetryExecutorCopyright © 2014. All rights reserved.