com.lightstreamer.ls_proxy
Interface PushErrorListener


public interface PushErrorListener

Receives asynchronous notifications for connection errors. The notification sequence follows the pattern:

(ClosedConn | FailedConn | ConnRetry (Reconn | ReconnAbandoned | FailedReconn) )*

All notifications are sent in sequence on a dedicated thread.


Method Summary
 void onClosedConnection(int cause)
          Notifies a closure of the connection to Lightstreamer Server imposed by the Server itself.
 void onConnectionRetry(PushException e)
          Notifies that an unexpected interruption of the connection to Lightstreamer Server is being recovered by a new connection attempt.
 void onFailedConnection(PushException e)
          Notifies an unexpected interruption of the connection to Lightstreamer Server.
 void onFailedReconnection(PushException e)
          Notifies that an automatic reconnection attempt has failed.
 void onReconnection()
          Notifies that an automatic reconnection attempt has succeeded.
 void onReconnectionAbandoned()
          Notifies that an automatic reconnection attempts loop has been ended without success because of a subsequent LSProxy.startPushConnection(com.lightstreamer.ls_client.ConnectionInfo) or LSProxy.stopPushConnection() call in some other thread, that has made the reconnection attempts loop obsolete.
 

Method Detail

onClosedConnection

void onClosedConnection(int cause)
Notifies a closure of the connection to Lightstreamer Server imposed by the Server itself. In response to this event, the client is allowed to try a new call to LSProxy.startPushConnection(com.lightstreamer.ls_client.ConnectionInfo) inside this method. However, the client is advised not to try to recover immediately; as a consequence, no automatic recovery attempt is tried, regardless of the ProxyInfo.onFailedConnectionRetry setting.

Parameters:
cause - An integer code that describes the cause of the connection ending, or 0 if no cause information is supplied. See the "END" message in the text protocol documentation for details on the possible causes.
See Also:
ProxyInfo

onFailedConnection

void onFailedConnection(PushException e)
Notifies an unexpected interruption of the connection to Lightstreamer Server. In response to this event, the client is allowed to try a new call to LSProxy.startPushConnection(com.lightstreamer.ls_client.ConnectionInfo) inside this method. If ProxyInfo.onFailedConnectionRetry was set to true in the connection policy preferences, this notification is not received.

Parameters:
e - the specification of the error that has occurred.
See Also:
ProxyInfo

onConnectionRetry

void onConnectionRetry(PushException e)
Notifies that an unexpected interruption of the connection to Lightstreamer Server is being recovered by a new connection attempt. The automatic recovery attempt can only take place if ProxyInfo.onFailedConnectionRetry was set to true in the connection policy preferences.

Parameters:
e - the specification of the error that has occurred.
See Also:
ProxyInfo

onReconnection

void onReconnection()
Notifies that an automatic reconnection attempt has succeeded. This notification is always preceded by the onConnectionRetry(com.lightstreamer.ls_proxy.PushException) notification.


onFailedReconnection

void onFailedReconnection(PushException e)
Notifies that an automatic reconnection attempt has failed. In response to this event, the client is allowed to try a further call to LSProxy.startPushConnection(com.lightstreamer.ls_client.ConnectionInfo) inside this method. This notification can be sent only if ProxyInfo.connectionRetryTimeoutMillis was set to zero or negative in the connection policy preferences, so that just one reconnection attempt was tried. This notification is always preceded by the onConnectionRetry(com.lightstreamer.ls_proxy.PushException) notification.

Parameters:
e - the specification of the error that has occurred in the recovery connection attempt.
See Also:
ProxyInfo

onReconnectionAbandoned

void onReconnectionAbandoned()
Notifies that an automatic reconnection attempts loop has been ended without success because of a subsequent LSProxy.startPushConnection(com.lightstreamer.ls_client.ConnectionInfo) or LSProxy.stopPushConnection() call in some other thread, that has made the reconnection attempts loop obsolete. This notification can be sent only if ProxyInfo.connectionRetryTimeoutMillis was set to a positive value in the connection policy preferences. This notification is always preceded by the onConnectionRetry(com.lightstreamer.ls_proxy.PushException) notification.

See Also:
ProxyInfo