Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_INTERVAL
The default recovery interval: 5000 ms = 5 seconds.
|
static long |
UNLIMITED_ATTEMPTS
Constant value indicating an unlimited number of attempts.
|
Constructor and Description |
---|
FixedBackOff()
Create an instance with an interval of 5000L
ms and an unlimited number of attempts.
|
FixedBackOff(long interval,
long maxAttempts)
Create an instance.
|
Modifier and Type | Method and Description |
---|---|
long |
getInterval()
Return the interval between two attempts in milliseconds.
|
long |
getMaxAttempts()
Return the maximal number of attempts in milliseconds.
|
void |
setInterval(long interval)
Set the interval between two attempts in milliseconds.
|
void |
setMaxAttempts(long maxAttempts)
Set the maximal number of attempts in milliseconds.
|
BackOffExecution |
start()
Start a new back off execution.
|
public static final long DEFAULT_INTERVAL
public static final long UNLIMITED_ATTEMPTS
public FixedBackOff()
public FixedBackOff(long interval, long maxAttempts)
interval
- the interval between two attemptsmaxAttempts
- the maximal number of attemptspublic void setInterval(long interval)
public long getInterval()
public void setMaxAttempts(long maxAttempts)
public long getMaxAttempts()
public BackOffExecution start()
BackOff
start
in interface BackOff
BackOffExecution
ready to be used