org.atmosphere.gwt.client
Interface AtmosphereListener


public interface AtmosphereListener

Listens for events from an AtmosphereClient.

Author:
Richard Zschech, Pierre Havelaar

Method Summary
 void onAfterRefresh()
          You will receive this after a connection has been refreshed or re-established and is ready to process new events.
 void onBeforeDisconnected()
          Send just before the connection is stopped (this can happen also because the window is being closed)
 void onConnected(int heartbeat, int connectionID)
          The connection has been established
 void onDisconnected()
          The connection has disconnected.
 void onError(Throwable exception, boolean connected)
          An error has occurred.
 void onHeartbeat()
          The connection has received a heartbeat.
 void onMessage(List<?> messages)
          A batch of messages from the server has arrived.
 void onRefresh()
          The connection will be refreshed by the client.
 

Method Detail

onConnected

void onConnected(int heartbeat,
                 int connectionID)
The connection has been established

Parameters:
heartbeat - This is the interval with which the server will send heartbeats
connectionID - This is the unique number that identifies this connection

onBeforeDisconnected

void onBeforeDisconnected()
Send just before the connection is stopped (this can happen also because the window is being closed)


onDisconnected

void onDisconnected()
The connection has disconnected. When the disconnect was unexpected (AtmosphereClient.isRunning() == true) the connecting will be refreshed after this and you can expect the next event to be onAfterRefresh()


onError

void onError(Throwable exception,
             boolean connected)
An error has occurred.

Parameters:
exception -
connected - This will indicate whether the connection is still alive

onHeartbeat

void onHeartbeat()
The connection has received a heartbeat. When a heartbeat is not received at the expected time, the connection is assumed to be dead and a new one is established.


onRefresh

void onRefresh()
The connection will be refreshed by the client. This will occur to prevent data from accumulating in the clients comet implementation and slowing down message processing. Normally you don't need to do anything with this event. It signals the start of a scheduled reconnection. A new connection will be established and the current connection is only dropped when the new connection has become alive.


onAfterRefresh

void onAfterRefresh()
You will receive this after a connection has been refreshed or re-established and is ready to process new events.


onMessage

void onMessage(List<?> messages)
A batch of messages from the server has arrived.

Parameters:
messages -


Copyright © 2012. All Rights Reserved.