/** * Returns {@code true} if another attempt should be made, or {@code false} otherwise. * * @param prevThrowable exception thrown by the previous attempt or null if a result was returned * instead * @param prevResponse response returned by the previous attempt or null if an exception was * thrown instead * @param nextAttemptSettings attempt settings, which will be used for the next attempt, if * accepted * @throws CancellationException if the retrying process should be canceled * @return {@code true} if another attempt should be made, or {@code false} otherwise */ public boolean shouldRetry( Throwable prevThrowable, ResponseT prevResponse, TimedAttemptSettings nextAttemptSettings) throws CancellationException { return resultAlgorithm.shouldRetry(prevThrowable, prevResponse) && nextAttemptSettings != null && timedAlgorithm.shouldRetry(nextAttemptSettings); }
/** * Returns {@code true} if another attempt should be made, or {@code false} otherwise. * * @param prevThrowable exception thrown by the previous attempt or null if a result was returned * instead * @param prevResponse response returned by the previous attempt or null if an exception was * thrown instead * @param nextAttemptSettings attempt settings, which will be used for the next attempt, if * accepted * @throws CancellationException if the retrying process should be canceled * @return {@code true} if another attempt should be made, or {@code false} otherwise */ public boolean shouldRetry( Throwable prevThrowable, ResponseT prevResponse, TimedAttemptSettings nextAttemptSettings) throws CancellationException { return resultAlgorithm.shouldRetry(prevThrowable, prevResponse) && nextAttemptSettings != null && timedAlgorithm.shouldRetry(nextAttemptSettings); }