net.sf.xenqtt.client
Class NullReconnectStrategy

java.lang.Object
  extended by net.sf.xenqtt.client.NullReconnectStrategy
All Implemented Interfaces:
Cloneable, ReconnectionStrategy

public final class NullReconnectStrategy
extends Object
implements ReconnectionStrategy

Reconnect strategy that does 0 reconnect attempts.


Constructor Summary
NullReconnectStrategy()
           
 
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

NullReconnectStrategy

public NullReconnectStrategy()
Method Detail

connectionLost

public long connectionLost(MqttClient client,
                           Throwable cause)
Description copied from interface: ReconnectionStrategy
Called by an MqttClient each time the connection to the broker is lost other than by an intentional disconnect.

Specified by:
connectionLost in interface ReconnectionStrategy
cause - The exception that cause the connection to close or resulted from the connection closing. May be null.
Returns:
Milliseconds the client should wait before trying to connect to the broker again. If <= 0 the client will stop trying to connect to the broker.
See Also:
ReconnectionStrategy.connectionLost(net.sf.xenqtt.client.MqttClient, java.lang.Throwable)

connectionEstablished

public void connectionEstablished()
Description copied from interface: ReconnectionStrategy
Called by an MqttClient instance when a connection to the broker is established.

Specified by:
connectionEstablished in interface ReconnectionStrategy
See Also:
ReconnectionStrategy.connectionEstablished()

clone

public ReconnectionStrategy clone()
Specified by:
clone in interface ReconnectionStrategy
Overrides:
clone in class Object
Returns:
A new instance of the same type as this object. This is used to create a new strategy for each client created by the MqttClientFactory.
See Also:
Object.clone(), ReconnectionStrategy.clone()


Copyright © 2013. All Rights Reserved.