Smack

org.jivesoftware.smack
Interface ConnectionListener

All Known Implementing Classes:
AbstractConnectionListener, ReconnectionManager

public interface ConnectionListener

Interface that allows for implementing classes to listen for connection closing and reconnection events. Listeners are registered with Connection objects.

Author:
Matt Tucker
See Also:
Connection.addConnectionListener(org.jivesoftware.smack.ConnectionListener), Connection.removeConnectionListener(org.jivesoftware.smack.ConnectionListener)

Method Summary
 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.
 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 reconnected successfully to the server.
 

Method Detail

connectionClosed

void connectionClosed()
Notification that the connection was closed normally or that the reconnection process has been aborted.


connectionClosedOnError

void connectionClosedOnError(Exception e)
Notification that the connection was closed due to an exception. When abruptly disconnected it is possible for the connection to try reconnecting to the server.

Parameters:
e - the exception.

reconnectingIn

void reconnectingIn(int seconds)
The connection will retry to reconnect in the specified number of seconds.

Parameters:
seconds - remaining seconds before attempting a reconnection.

reconnectionSuccessful

void reconnectionSuccessful()
The connection has reconnected successfully to the server. Connections will reconnect to the server when the previous socket connection was abruptly closed.


reconnectionFailed

void reconnectionFailed(Exception e)
An attempt to connect to the server has failed. The connection will keep trying reconnecting to the server in a moment.

Parameters:
e - the exception that caused the reconnection to fail.

Smack

Copyright © 2003-2007 Jive Software.