Top Description Methods
org.springframework.util.backoff

public Interface BackOff

Known Direct Implementers
org.springframework.util.backoff.ExponentialBackOff, org.springframework.util.backoff.FixedBackOff
Annotations
@FunctionalInterface

Provide a BackOffExecution that indicates the rate at which an operation should be retried.

Users of this interface are expected to use it like this:

BackOffExecution exec = backOff.start();

// In the operation recovery/retry loop:
long waitInterval = exec.nextBackOff();
if (waitInterval == BackOffExecution.STOP) {
    // do not retry operation
}
else {
    // sleep, e.g. Thread.sleep(waitInterval)
    // retry operation
}
Once the underlying operation has completed successfully, the execution instance can be discarded.
Author
Stephane Nicoll
Since
4.1
See Also
BackOffExecution

Method Summary

Modifier and TypeMethod and Description
public BackOffExecution

Returns:

a fresh BackOffExecution ready to be used
start
()

Start a new back off execution.

Method Detail

startback to summary
public BackOffExecution start()

Start a new back off execution.

Returns:BackOffExecution

a fresh BackOffExecution ready to be used