BackOff implementation that provides a fixed interval
between two attempts and a maximum number of retries.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| public static final long | DEFAULT_INTERVAL
The default recovery interval: 5000 ms = 5 seconds. |
| private long | |
| private long | |
| public static final long | UNLIMITED_ATTEMPTS
Constant value indicating an unlimited number of attempts. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | FixedBackOff(long
the interval between two attempts interval, long the maximum number of attempts maxAttempts)Create an instance. |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public long | |
| public void | |
| public void | |
| public BackOffExecution |
| DEFAULT_INTERVAL | back to summary |
|---|---|
| public static final long DEFAULT_INTERVAL The default recovery interval: 5000 ms = 5 seconds. | |
| interval | back to summary |
|---|---|
| private long interval | |
| maxAttempts | back to summary |
|---|---|
| private long maxAttempts | |
| UNLIMITED_ATTEMPTS | back to summary |
|---|---|
| public static final long UNLIMITED_ATTEMPTS Constant value indicating an unlimited number of attempts. | |
| FixedBackOff | back to summary |
|---|---|
| public FixedBackOff() Create an instance with an interval of 5000 ms and an unlimited number of attempts. | |
| FixedBackOff | back to summary |
|---|---|
| public FixedBackOff(long interval, long maxAttempts) Create an instance.
| |
| getInterval | back to summary |
|---|---|
| public long getInterval() Return the interval between two attempts in milliseconds. | |
| getMaxAttempts | back to summary |
|---|---|
| public long getMaxAttempts() Return the maximum number of attempts in milliseconds. | |
| setInterval | back to summary |
|---|---|
| public void setInterval(long interval) Set the interval between two attempts in milliseconds. | |
| setMaxAttempts | back to summary |
|---|---|
| public void setMaxAttempts(long maxAttempts) Set the maximum number of attempts in milliseconds. | |
| start | back to summary |
|---|---|
| public BackOffExecution start() Implements org. Doc from org. Start a new back off execution.
| |
| Modifier and Type | Field and Description |
|---|---|
| private long |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public long | nextBackOff()
Implements org. STOP (-1) to indicate that no further attempt
should be made for the operation.
|
| public String |
| currentAttempts | back to summary |
|---|---|
| private long currentAttempts | |
| FixedBackOffExecution | back to summary |
|---|---|
| private FixedBackOffExecution() | |
| nextBackOff | back to summary |
|---|---|
| public long nextBackOff() Implements org. Doc from org. Return the number of milliseconds to wait before retrying the operation
or
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |