public class ReconnectionManager extends Object implements ConnectionListener
The reconnection mechanism will try to reconnect periodically:
| Modifier and Type | Method and Description |
|---|---|
void |
connectionClosed()
Notification that the connection was closed normally or that the
reconnection process has been aborted.
|
void |
connectionClosedOnError(Exception e)
Notification that the connection was closed due to an exception.
|
protected void |
notifyAttemptToReconnectIn(int seconds)
Fires listeners when The Connection will retry a reconnection.
|
protected void |
notifyReconnectionFailed(Exception exception)
Fires listeners when a reconnection attempt has failed.
|
protected void |
reconnect()
Starts a reconnection mechanism if it was configured to do that.
|
void |
reconnectingIn(int seconds)
The connection will retry to reconnect in the specified number of
seconds.
|
void |
reconnectionFailed(Exception e)
An attempt to connect to the server has failed.
|
void |
reconnectionSuccessful()
The connection has successfull gotten connected.
|
protected void reconnect()
protected void notifyReconnectionFailed(Exception exception)
exception - the exception that occured.protected void notifyAttemptToReconnectIn(int seconds)
seconds - the number of seconds that a reconnection will be attempted
in.public void connectionClosed()
ConnectionListenerconnectionClosed in interface ConnectionListenerpublic void connectionClosedOnError(Exception e)
ConnectionListenerconnectionClosedOnError in interface ConnectionListenere - the exception.public void reconnectingIn(int seconds)
ConnectionListenerreconnectingIn in interface ConnectionListenerseconds - remaining seconds before attempting a reconnection.public void reconnectionFailed(Exception e)
ConnectionListenerreconnectionFailed in interface ConnectionListenere - the exception that caused the reconnection to fail.public void reconnectionSuccessful()
reconnectionSuccessful in interface ConnectionListenerCopyright © 2014. All Rights Reserved.