public final class StopStrategies
extends java.lang.Object
StopStrategy
instances.Modifier and Type | Method and Description |
---|---|
static StopStrategy |
neverStop()
Returns a stop strategy which consists in never stopping retrying
|
static StopStrategy |
stopAfterAttempt(int attemptNumber)
Returns a stop strategy which consists in stopping after N failed attempts
|
static StopStrategy |
stopAfterDelay(long delayInMillis)
Returns a stop strategy which consists in stopping after a given delay
|
public static StopStrategy neverStop()
public static StopStrategy stopAfterAttempt(int attemptNumber)
attemptNumber
- the number of failed attempts before stoppingpublic static StopStrategy stopAfterDelay(long delayInMillis)
delayInMillis
- the delay, in milliseconds, starting with the start of the first attempt.