public class DefaultRetryAlgorithm extends Object implements RetryAlgorithm
| Modifier and Type | Field and Description |
|---|---|
static Integer |
DEFAULT_MAX_NBR_RETRIES |
static Long |
DEFAULT_TIME_BETWEEN_RETRIES_IN_MILLIS |
| Constructor and Description |
|---|
DefaultRetryAlgorithm() |
DefaultRetryAlgorithm(Integer maxNbrRetries,
Long timeBetweenRetriesInMillis) |
| Modifier and Type | Method and Description |
|---|---|
Integer |
getMaxNbrRetries() |
int |
getNbrFailures() |
Long |
getTimeBetweenRetriesInMillis() |
long |
getTimeLastFailureInMillis() |
boolean |
isExecutionAllowed()
Implementors report if operation execution should proceed.
|
void |
reportExecutionFailure(Exception exceptionThrown)
Will be invoked when an execution failure is encountered.
|
void |
reset()
Implementors re-initialize for a new invocation.
|
public static final Integer DEFAULT_MAX_NBR_RETRIES
public static final Long DEFAULT_TIME_BETWEEN_RETRIES_IN_MILLIS
public boolean isExecutionAllowed()
RetryAlgorithmisExecutionAllowed in interface RetryAlgorithmpublic void reportExecutionFailure(Exception exceptionThrown)
RetryAlgorithmreportExecutionFailure in interface RetryAlgorithmpublic Integer getMaxNbrRetries()
public Long getTimeBetweenRetriesInMillis()
public int getNbrFailures()
public long getTimeLastFailureInMillis()
public void reset()
RetryAlgorithmreset in interface RetryAlgorithmCopyright © 2015. All rights reserved.