|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.xenqtt.client.FixedReconnectionStrategy
public final class FixedReconnectionStrategy
A ReconnectStrategy implementation that attempts to reconnect a fixed intervals up to a maximum number of reconnection attempts.
This class is thread-safe.
| Constructor Summary | |
|---|---|
FixedReconnectionStrategy(long reconnectDelayMillis,
int maxReconnectAttempts)
Create a new instance of this class. |
|
| Method Summary | |
|---|---|
ReconnectionStrategy |
clone()
|
void |
connectionEstablished()
Called by an MqttClient instance when a connection to the broker is established. |
long |
connectionLost(MqttClient client,
Throwable cause)
Called by an MqttClient each time the connection to the broker is lost other than by an intentional disconnect. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FixedReconnectionStrategy(long reconnectDelayMillis,
int maxReconnectAttempts)
reconnectDelayMillis - The amount of time, in milliseconds, to wait before each reconnect attemptmaxReconnectAttempts - The maximum number of times to attempt a reconnect before no further attempts will be made| Method Detail |
|---|
public long connectionLost(MqttClient client,
Throwable cause)
ReconnectionStrategyMqttClient each time the connection to the broker is lost other than by an intentional disconnect.
connectionLost in interface ReconnectionStrategycause - The exception that cause the connection to close or resulted from the connection closing. May be null.
ReconnectionStrategy.connectionLost(net.sf.xenqtt.client.MqttClient, java.lang.Throwable)public void connectionEstablished()
ReconnectionStrategyMqttClient instance when a connection to the broker is established.
connectionEstablished in interface ReconnectionStrategyReconnectionStrategy.connectionEstablished()public ReconnectionStrategy clone()
clone in interface ReconnectionStrategyclone in class ObjectMqttClientFactory.Object.clone(),
ReconnectionStrategy.clone()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||