public interface TimedRetryAlgorithmWithContext extends TimedRetryAlgorithm
TimedAttemptSettings.
Future will be
canceled.
TimedAttemptSettings for each subsequent retry attempt.
RetryingContext that can contain specific
RetrySettings and retryable codes that should be used to determine the retry behavior.
Implementations of this interface must be be thread-save.
| Modifier and Type | Method and Description |
|---|---|
TimedAttemptSettings |
createFirstAttempt(RetryingContext context)
Creates a first attempt
TimedAttemptSettings. |
TimedAttemptSettings |
createNextAttempt(RetryingContext context,
TimedAttemptSettings previousSettings)
Creates a next attempt
TimedAttemptSettings, which defines properties of the next
attempt. |
boolean |
shouldRetry(RetryingContext context,
TimedAttemptSettings nextAttemptSettings)
Returns
true if another attempt should be made, or false otherwise. |
createFirstAttempt, createNextAttempt, shouldRetryTimedAttemptSettings createFirstAttempt(RetryingContext context)
TimedAttemptSettings.context - a RetryingContext that can contain custom RetrySettings and
retryable codesTimedAttemptSettings createNextAttempt(RetryingContext context, TimedAttemptSettings previousSettings)
TimedAttemptSettings, which defines properties of the next
attempt.context - a RetryingContext that can contain custom RetrySettings and
retryable codespreviousSettings - previous attempt settingsnull if the implementing algorithm does not provide
specific settings for the next attemptboolean shouldRetry(RetryingContext context, TimedAttemptSettings nextAttemptSettings)
true if another attempt should be made, or false otherwise.context - a RetryingContext that can contain custom RetrySettings and
retryable codes.nextAttemptSettings - attempt settings, which will be used for the next attempt, if
acceptedCancellationException - if the retrying process should be canceled