@ParametersAreNonnullByDefault public final class Callables extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Callables.PreRetryCallback<T> |
static class |
Callables.RetryPauseWithTimeout<T> |
static class |
Callables.TimeoutCallable<T> |
Modifier and Type | Field and Description |
---|---|
static com.google.common.base.Predicate<Exception> |
DEFAULT_EXCEPTION_RETRY |
static com.google.common.base.Predicate<Object> |
NORETRY_FOR_RESULT |
static com.google.common.base.Predicate<?> |
RETRY_FOR_NULL_RESULT |
Modifier and Type | Method and Description |
---|---|
static <T> Callables.PreRetryCallback<T> |
callableToPreRetryCallback(Callable<Boolean> doBeforeRetry) |
static <T> T |
executeWithRetry(Callable<T> what,
Callable<Boolean> doBeforeRetry,
com.google.common.base.Predicate<? super T> retryOnReturnVal,
com.google.common.base.Predicate<Exception> retryOnException) |
static <T> T |
executeWithRetry(Callable<T> what,
Callables.PreRetryCallback<T> doBeforeRetry,
com.google.common.base.Predicate<? super T> retryOnReturnVal,
com.google.common.base.Predicate<Exception> retryOnException)
Naive implementation of execution with retry logic.
|
static <T> T |
executeWithRetry(Callables.TimeoutCallable<T> what,
Callables.PreRetryCallback<T> doBeforeRetry,
int nrImmediateRetries,
int maxWaitMillis,
com.google.common.base.Predicate<? super T> retryOnReturnVal,
com.google.common.base.Predicate<Exception> retryOnException)
After the immediate retries are done,
delayed retry with randomized Fibonacci values up to the specified max is executed.
|
static <T> T |
executeWithRetry(Callables.TimeoutCallable<T> what,
int nrImmediateRetries,
int maxRetryWaitMillis) |
static <T> T |
executeWithRetry(Callables.TimeoutCallable<T> what,
int nrImmediateRetries,
int maxRetryWaitMillis,
com.google.common.base.Predicate<? super T> retryOnReturnVal,
com.google.common.base.Predicate<Exception> retryOnException) |
static <T> T |
executeWithRetry(Callables.TimeoutCallable<T> what,
int nrImmediateRetries,
int maxRetryWaitMillis,
com.google.common.base.Predicate<Exception> retryOnException) |
static <T> Callable<T> |
synchronize(Callable<T> callable) |
public static final com.google.common.base.Predicate<Object> NORETRY_FOR_RESULT
public static final com.google.common.base.Predicate<?> RETRY_FOR_NULL_RESULT
public static final com.google.common.base.Predicate<Exception> DEFAULT_EXCEPTION_RETRY
public static <T> T executeWithRetry(Callables.TimeoutCallable<T> what, int nrImmediateRetries, int maxRetryWaitMillis) throws InterruptedException
InterruptedException
public static <T> T executeWithRetry(Callables.TimeoutCallable<T> what, int nrImmediateRetries, int maxRetryWaitMillis, com.google.common.base.Predicate<Exception> retryOnException) throws InterruptedException
InterruptedException
public static <T> T executeWithRetry(Callables.TimeoutCallable<T> what, int nrImmediateRetries, int maxRetryWaitMillis, com.google.common.base.Predicate<? super T> retryOnReturnVal, com.google.common.base.Predicate<Exception> retryOnException) throws InterruptedException
InterruptedException
public static <T> T executeWithRetry(Callables.TimeoutCallable<T> what, Callables.PreRetryCallback<T> doBeforeRetry, int nrImmediateRetries, int maxWaitMillis, com.google.common.base.Predicate<? super T> retryOnReturnVal, com.google.common.base.Predicate<Exception> retryOnException) throws InterruptedException
T
- what
- doBeforeRetry
- nrImmediateRetries
- maxWaitMillis
- retryOnReturnVal
- retryOnException
- InterruptedException
public static <T> T executeWithRetry(Callable<T> what, Callable<Boolean> doBeforeRetry, com.google.common.base.Predicate<? super T> retryOnReturnVal, com.google.common.base.Predicate<Exception> retryOnException) throws InterruptedException
InterruptedException
public static <T> Callables.PreRetryCallback<T> callableToPreRetryCallback(Callable<Boolean> doBeforeRetry)
public static <T> T executeWithRetry(Callable<T> what, Callables.PreRetryCallback<T> doBeforeRetry, com.google.common.base.Predicate<? super T> retryOnReturnVal, com.google.common.base.Predicate<Exception> retryOnException) throws InterruptedException
what
- doBeforeRetry
- retryOnReturnVal
- retryOnException
- InterruptedException
Copyright © 2014. All rights reserved.