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