@BetaApi public class RetryAlgorithm extends Object
This class is thread-safe.
| Constructor and Description |
|---|
RetryAlgorithm(ExceptionRetryAlgorithm exceptionAlgorithm,
TimedRetryAlgorithm timedAlgorithm)
Creates a new retry algorithm instance, which uses
exceptionAlgorithm and timedAlgorithm to make a decision. |
| Modifier and Type | Method and Description |
|---|---|
TimedAttemptSettings |
createFirstAttempt()
Creates a first attempt
TimedAttemptSettings. |
TimedAttemptSettings |
createNextAttempt(Throwable prevThrowable,
TimedAttemptSettings prevSettings)
Creates a next attempt
TimedAttemptSettings. |
public RetryAlgorithm(ExceptionRetryAlgorithm exceptionAlgorithm, TimedRetryAlgorithm timedAlgorithm)
exceptionAlgorithm and timedAlgorithm to make a decision. exceptionAlgorithm has higher priority than the
timedAlgorithm.timedAlgorithm - timed algorithm to useexceptionAlgorithm - exception algorithm to usepublic TimedAttemptSettings createFirstAttempt()
TimedAttemptSettings.public TimedAttemptSettings createNextAttempt(Throwable prevThrowable, TimedAttemptSettings prevSettings)
TimedAttemptSettings. This method will return the
exception-specific next attempt settings, if there are any, otherwise it will default to the
time-specific settings.prevThrowable - exception thrown by the previous attemptprevSettings - previous attempt settings