ResponseT - attempt response typepublic class BasicResultRetryAlgorithm<ResponseT> extends Object implements ResultRetryAlgorithm<ResponseT>
ResultRetryAlgorithm. Using this implementation would mean that
all exceptions should be retried, all responses should be accepted (including null) and
no retrying process should ever be canceled.| Constructor and Description |
|---|
BasicResultRetryAlgorithm() |
| Modifier and Type | Method and Description |
|---|---|
TimedAttemptSettings |
createNextAttempt(Throwable prevThrowable,
ResponseT prevResponse,
TimedAttemptSettings prevSettings)
Always returns null, indicating that this algorithm does not provide any specific settings for
the next attempt.
|
boolean |
shouldRetry(Throwable prevThrowable,
ResponseT prevResponse)
Returns
true if an exception was thrown (prevThrowable != null), false
otherwise. |
public TimedAttemptSettings createNextAttempt(Throwable prevThrowable, ResponseT prevResponse, TimedAttemptSettings prevSettings)
createNextAttempt in interface ResultRetryAlgorithm<ResponseT>prevThrowable - exception thrown by the previous attempt (null, if none)prevResponse - response returned by the previous attemptprevSettings - previous attempt settingsnull, if the implementing algorithm does not provide
specific settings for the next attemptpublic boolean shouldRetry(Throwable prevThrowable, ResponseT prevResponse)
true if an exception was thrown (prevThrowable != null), false
otherwise.shouldRetry in interface ResultRetryAlgorithm<ResponseT>prevThrowable - exception thrown by the previous attempt (null, if none)prevResponse - response returned by the previous attempt