public class RetryingOperation<T> extends Object
Constructor and Description |
---|
RetryingOperation() |
Modifier and Type | Method and Description |
---|---|
T |
call(Callable<T> callable) |
long |
getExceptionCount()
Returns the total number of exceptions/failures seen by this reader.
|
Throwable |
getFirstException()
Returns the first exception thrown for any individual read attempt.
|
long |
getInitialRetryDelay()
Returns the amount of time to wait (in milliseconds) after the first error, before retrying (default 1 second).
|
Throwable |
getLastException()
Returns the last exception thrown for any individual read attempt.
|
long |
getMaxErrorCount()
Returns the number of retries allowed across all read attempts (default max long - 1).
|
int |
getMaxRetryCount()
Returns the number of retries allowed for any individual read attempt (default 5).
|
IRetryStrategy |
getStrategy()
Returns the retry strategy (default
RetryStrategy.EXPONENTIAL_BACKOFF ). |
protected void |
onFailure(Throwable exception) |
void |
run(Runnable runnable) |
RetryingOperation<T> |
setInitialRetryDelay(long initialRetryDelay)
Sets the amount of time to wait (in milliseconds) after the first error, before retrying (default 1 second).
|
RetryingOperation<T> |
setMaxErrorCount(long maxErrorCount)
Sets the number of retries allowed across all read attempts (default max long -1).
|
RetryingOperation<T> |
setMaxRetryCount(int maxRetryCount)
Sets the number of retries allowed for any individual read attempt (default 5).
|
RetryingOperation<T> |
setStrategy(IRetryStrategy strategy)
Sets the retry strategy (default
RetryStrategy.EXPONENTIAL_BACKOFF ). |
public int getMaxRetryCount()
public RetryingOperation<T> setMaxRetryCount(int maxRetryCount)
public long getMaxErrorCount()
public RetryingOperation<T> setMaxErrorCount(long maxErrorCount)
public long getInitialRetryDelay()
public RetryingOperation<T> setInitialRetryDelay(long initialRetryDelay)
public IRetryStrategy getStrategy()
RetryStrategy.EXPONENTIAL_BACKOFF
).public RetryingOperation<T> setStrategy(IRetryStrategy strategy)
RetryStrategy.EXPONENTIAL_BACKOFF
).public long getExceptionCount()
public Throwable getFirstException()
public Throwable getLastException()
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.