public class MockBackOff implements BackOff
Implements
BackOffConstructors
MockBackOff()
public MockBackOff()
Methods
getMaxTries()
public final int getMaxTries()
Returns the maximum number of tries before returning #STOP.
Type | Description |
int |
getNumberOfTries()
public final int getNumberOfTries()
Returns the number of tries so far.
Type | Description |
int |
nextBackOffMillis()
public long nextBackOffMillis()
Gets the number of milliseconds to wait before retrying the operation or #STOP to indicate that no retries should be made.
Example usage:
long backOffMillis = backoff.nextBackOffMillis(); if (backOffMillis == Backoff.STOP) { // do not retry operation } else { // sleep for backOffMillis milliseconds and retry operation }
Type | Description |
long |
Type | Description |
IOException |
reset()
public void reset()
Reset to initial state.
Type | Description |
IOException |
setBackOffMillis(long backOffMillis)
public MockBackOff setBackOffMillis(long backOffMillis)
Sets the fixed back-off milliseconds (defaults to 0
).
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
backOffMillis | long |
Type | Description |
MockBackOff |
setMaxTries(int maxTries)
public MockBackOff setMaxTries(int maxTries)
Sets the maximum number of tries before returning #STOP (defaults to 10
).
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
maxTries | int |
Type | Description |
MockBackOff |