Class ConstantReconnectionPolicy

  • All Implemented Interfaces:
    ReconnectionPolicy

    public class ConstantReconnectionPolicy
    extends Object
    implements ReconnectionPolicy
    A reconnection policy that waits a constant time between each reconnection attempt.
    • Constructor Detail

      • ConstantReconnectionPolicy

        public ConstantReconnectionPolicy​(long constantDelayMs)
        Creates a reconnection policy that creates with the provided constant wait time between reconnection attempts.
        Parameters:
        constantDelayMs - the constant delay in milliseconds to use.
    • Method Detail

      • getConstantDelayMs

        public long getConstantDelayMs()
        The constant delay used by this reconnection policy.
        Returns:
        the constant delay used by this reconnection policy.
      • init

        public void init​(Cluster cluster)
        Description copied from interface: ReconnectionPolicy
        Gets invoked at cluster startup.
        Specified by:
        init in interface ReconnectionPolicy
        Parameters:
        cluster - the cluster that this policy is associated with.
      • close

        public void close()
        Description copied from interface: ReconnectionPolicy
        Gets invoked at cluster shutdown.

        This gives the policy the opportunity to perform some cleanup, for instance stop threads that it might have started.

        Specified by:
        close in interface ReconnectionPolicy