it.list.jft.event
Interface ConnectionListener

All Superinterfaces:
Listener

public interface ConnectionListener
extends Listener

Interface to be implemented in order to handle the Connection Lifecycle.

This interface is bound to connections created by Context.makeConnection().
It may be retrieved by CommunicationLifeCycle.getListener().


Method Summary
 void onConnectionClose(ConnectionCloseEvent event)
          Called when the server-answer to the Connection.close() is available.
 void onConnectionLost(ConnectionLostEvent event)
          Called when the connection with server crashed or when the server choose to terminate the connection.
 void onConnectionOpen(ConnectionOpenEvent event)
          Called when the server-answer to the Connection.open() is available.
 

Method Detail

onConnectionOpen

void onConnectionOpen(ConnectionOpenEvent event)
Called when the server-answer to the Connection.open() is available.

If the server result is Event.RESULT_OK,
then

otherwise

In the latter case it is a good practice to release the connection associated to the event parameter.

Parameters:
event - the server-answer to the Connection.open()

onConnectionClose

void onConnectionClose(ConnectionCloseEvent event)
Called when the server-answer to the Connection.close() is available.

If the server result is Event.RESULT_OK, then the server has closed the connection otherwise some unknow error occured.

In both cases:

It is guaranteed that only one method between onConnectionClose and onConnectionLost will ever be called on the same Listener.

Parameters:
event - the server-answer to the Connection.close()

onConnectionLost

void onConnectionLost(ConnectionLostEvent event)
Called when the connection with server crashed or when the server choose to terminate the connection.

In this case:

It is guaranteed that only one method between onConnectionClose and onConnectionLost will ever be called on the same Listener.

Parameters:
event - the description of this closure


Submit a bug or feature to FT\API Programming Support<\font>