Class FixedBackOff

  • All Implemented Interfaces:
    BackOff

    public class FixedBackOff
    extends Object
    implements BackOff
    A simple BackOff implementation that provides a fixed interval between two attempts and a maximum number of retries.
    Since:
    4.1
    Author:
    Stephane Nicoll
    • Constructor Detail

      • FixedBackOff

        public FixedBackOff()
        Create an instance with an interval of 5000L ms and an unlimited number of attempts.
      • FixedBackOff

        public FixedBackOff​(long interval,
                            long maxAttempts)
        Create an instance.
        Parameters:
        interval - the interval between two attempts
        maxAttempts - the maximum number of attempts
    • Method Detail

      • setInterval

        public void setInterval​(long interval)
        Set the interval between two attempts in milliseconds.
      • getInterval

        public long getInterval()
        Return the interval between two attempts in milliseconds.
      • setMaxAttempts

        public void setMaxAttempts​(long maxAttempts)
        Set the maximum number of attempts in milliseconds.
      • getMaxAttempts

        public long getMaxAttempts()
        Return the maximum number of attempts in milliseconds.