Class ConstantReconnectionPolicy
- java.lang.Object
-
- com.datastax.driver.core.policies.ConstantReconnectionPolicy
-
- All Implemented Interfaces:
ReconnectionPolicy
public class ConstantReconnectionPolicy extends Object implements ReconnectionPolicy
A reconnection policy that waits a constant time between each reconnection attempt.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.datastax.driver.core.policies.ReconnectionPolicy
ReconnectionPolicy.ReconnectionSchedule
-
-
Constructor Summary
Constructors Constructor Description ConstantReconnectionPolicy(long constantDelayMs)Creates a reconnection policy that creates with the provided constant wait time between reconnection attempts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Gets invoked at cluster shutdown.longgetConstantDelayMs()The constant delay used by this reconnection policy.voidinit(Cluster cluster)Gets invoked at cluster startup.ReconnectionPolicy.ReconnectionSchedulenewSchedule()A new schedule that uses a constantgetConstantDelayMs()delay between reconnection attempt.
-
-
-
Method Detail
-
getConstantDelayMs
public long getConstantDelayMs()
The constant delay used by this reconnection policy.- Returns:
- the constant delay used by this reconnection policy.
-
newSchedule
public ReconnectionPolicy.ReconnectionSchedule newSchedule()
A new schedule that uses a constantgetConstantDelayMs()delay between reconnection attempt.- Specified by:
newSchedulein interfaceReconnectionPolicy- Returns:
- the newly created schedule.
-
init
public void init(Cluster cluster)
Description copied from interface:ReconnectionPolicyGets invoked at cluster startup.- Specified by:
initin interfaceReconnectionPolicy- Parameters:
cluster- the cluster that this policy is associated with.
-
close
public void close()
Description copied from interface:ReconnectionPolicyGets 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:
closein interfaceReconnectionPolicy
-
-