Class RetryContext


  • public class RetryContext
    extends Object
    Encapsulate retrying state for reconnect operations.

    Used as context for Retry calls, keeps track of the current retry attempt for backoff calculations (through next() and restarting the attempt count once a retry has succeeded (through reset()).

    • Constructor Detail

      • RetryContext

        public RetryContext​(Duration firstBackoff,
                            Duration maxBackoffInterval)
    • Method Detail

      • next

        public void next()
        Signal that the next retry attempt should be underway.
      • reset

        public void reset()
        Reset the attempt count, treating further calls to next() as new retry sequences.
      • getFirstBackoff

        public Duration getFirstBackoff()
      • getMaxBackoffInterval

        public Duration getMaxBackoffInterval()
      • isConnected

        public boolean isConnected()
      • getAttempts

        public int getAttempts()
      • getResetCount

        public int getResetCount()