public class ConstantReconnectionPolicy extends Object implements ReconnectionPolicy
ReconnectionPolicy.ReconnectionSchedule
Constructor and Description |
---|
ConstantReconnectionPolicy(long constantDelayMs)
Creates a reconnection policy that creates with the provided constant wait time between
reconnection attempts.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Gets invoked at cluster shutdown.
|
long |
getConstantDelayMs()
The constant delay used by this reconnection policy.
|
void |
init(Cluster cluster)
Gets invoked at cluster startup.
|
ReconnectionPolicy.ReconnectionSchedule |
newSchedule()
A new schedule that uses a constant
getConstantDelayMs() delay between reconnection
attempt. |
public ConstantReconnectionPolicy(long constantDelayMs)
constantDelayMs
- the constant delay in milliseconds to use.public long getConstantDelayMs()
public ReconnectionPolicy.ReconnectionSchedule newSchedule()
getConstantDelayMs()
delay between reconnection
attempt.newSchedule
in interface ReconnectionPolicy
public void init(Cluster cluster)
ReconnectionPolicy
init
in interface ReconnectionPolicy
cluster
- the cluster that this policy is associated with.public void close()
ReconnectionPolicy
This gives the policy the opportunity to perform some cleanup, for instance stop threads that it might have started.
close
in interface ReconnectionPolicy
Copyright © 2012–2020. All rights reserved.