|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
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 madeMethod Detail |
---|
public long connectionLost(MqttClient client, Throwable cause)
ReconnectionStrategy
MqttClient
each time the connection to the broker is lost other than by an intentional disconnect.
connectionLost
in interface ReconnectionStrategy
cause
- 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()
ReconnectionStrategy
MqttClient
instance when a connection to the broker is established.
connectionEstablished
in interface ReconnectionStrategy
ReconnectionStrategy.connectionEstablished()
public ReconnectionStrategy clone()
clone
in interface ReconnectionStrategy
clone
in class Object
MqttClientFactory
.Object.clone()
,
ReconnectionStrategy.clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |