public class RetryingTaskExecutor<T> extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BACK_OFF_MULTIPLIER |
static int |
DEFAULT_INITIAL_RETRY_DELAY |
static int |
DEFAULT_MAX_RETRIES |
static long |
DEFAULT_MAX_RETRY_DELAY |
protected T |
objectToReturn |
Constructor and Description |
---|
RetryingTaskExecutor() |
RetryingTaskExecutor(int maxRetries,
boolean rethrowLastException) |
RetryingTaskExecutor(long initialRetryDelayMs,
int maxRetries) |
RetryingTaskExecutor(long initialRetryDelayMs,
int maxRetries,
boolean useExponentialBackOff) |
RetryingTaskExecutor(long initialRetryDelayMs,
long maxRetryDelay,
int maxRetries,
long backOffMultiplier,
boolean useExponentialBackOff,
boolean rethrowLastException) |
Modifier and Type | Method and Description |
---|---|
T |
getObjectToReturn() |
static <T> T |
retry(String message,
int retries,
long initialRetryDelayMs,
Callable<T> call)
Shortcut method that retries the callable up to a certain number of times.
|
static <T> T |
retry(String message,
int retries,
long initialRetryDelayMs,
Callable<T> call,
com.google.common.base.Predicate<Exception> shouldRetry) |
void |
runTask(Callable<T> task) |
void |
runTask(String taskName,
Callable<T> callable) |
public static final long DEFAULT_MAX_RETRY_DELAY
public static final int DEFAULT_MAX_RETRIES
public static final int DEFAULT_INITIAL_RETRY_DELAY
public static final int DEFAULT_BACK_OFF_MULTIPLIER
protected volatile T objectToReturn
public RetryingTaskExecutor(long initialRetryDelayMs, long maxRetryDelay, int maxRetries, long backOffMultiplier, boolean useExponentialBackOff, boolean rethrowLastException)
public RetryingTaskExecutor(long initialRetryDelayMs, int maxRetries)
public RetryingTaskExecutor(long initialRetryDelayMs, int maxRetries, boolean useExponentialBackOff)
public RetryingTaskExecutor(int maxRetries, boolean rethrowLastException)
public RetryingTaskExecutor()
public T getObjectToReturn()
public static <T> T retry(String message, int retries, long initialRetryDelayMs, Callable<T> call)
T
- what object to returnmessage
- retries
- initialRetryDelayMs
- in millisecondscall
- Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.