Class BasicResultRetryAlgorithm<ResponseT>

    • Constructor Detail

      • BasicResultRetryAlgorithm

        public BasicResultRetryAlgorithm()
    • Method Detail

      • createNextAttempt

        public TimedAttemptSettings createNextAttempt​(RetryingContext context,
                                                      java.lang.Throwable previousThrowable,
                                                      ResponseT previousResponse,
                                                      TimedAttemptSettings previousSettings)
        Always returns null, indicating that this algorithm does not provide any specific settings for the next attempt.
        Specified by:
        createNextAttempt in interface ResultRetryAlgorithmWithContext<ResponseT>
        Parameters:
        context - the retrying context of this invocation that can be used to determine the settings for the next attempt.
        previousThrowable - exception thrown by the previous attempt (null, if none)
        previousResponse - response returned by the previous attempt
        previousSettings - previous attempt settings
      • shouldRetry

        public boolean shouldRetry​(java.lang.Throwable previousThrowable,
                                   ResponseT previousResponse)
        Returns true if an exception was thrown (previousThrowable != null), false otherwise.
        Specified by:
        shouldRetry in interface ResultRetryAlgorithm<ResponseT>
      • shouldRetry

        public boolean shouldRetry​(RetryingContext context,
                                   java.lang.Throwable previousThrowable,
                                   ResponseT previousResponse)
                            throws java.util.concurrent.CancellationException
        Returns true if an exception was thrown (previousThrowable != null), false otherwise.
        Specified by:
        shouldRetry in interface ResultRetryAlgorithmWithContext<ResponseT>
        Parameters:
        context - the retrying context of this invocation that can be used to determine whether the call should be retried.
        previousThrowable - exception thrown by the previous attempt (null, if none)
        previousResponse - response returned by the previous attempt.
        Throws:
        java.util.concurrent.CancellationException