public final class RetryStrategy extends Base
Modifier and Type | Method and Description |
---|---|
static RetryStrategy |
resume(Throwable error)
The error case should be dealt with giving up and throwing an exception.
|
static RetryStrategy |
retryImmediately(Object parameter)
The error case should be dealt with by retrying immediately with the given parameter.
|
static RetryStrategy |
retryScheduled(Object parameter,
Duration duration)
The error case should be dealt with by retrying later with the given parameter.
|
static RetryStrategy |
stop(Throwable error)
The error case should cause the service to stop and throw an exception.
|
public static RetryStrategy resume(Throwable error)
error
- the exception to throwpublic static RetryStrategy stop(Throwable error)
error
- the exception to throwpublic static RetryStrategy retryImmediately(Object parameter)
parameter
- parameter or parameter object to retry with, can be a new one or the old onepublic static RetryStrategy retryScheduled(Object parameter, Duration duration)
parameter
- parameter or parameter object to retry with, can be a new one or the old oneduration
- the amount of time to wait until the next try