com.sun.sgs.impl.client.comm
Interface ClientConnectionListener

All Known Implementing Classes:
SimpleClient.SimpleClientConnectionListener

public interface ClientConnectionListener

Listener for communications events that occur on an associated ClientConnection.


Method Summary
 void connected(ClientConnection connection)
          Notifies this listener that a transport connection has been established.
 void disconnected(boolean graceful, byte[] message)
          Notifies this listener that the associated server connection is disconnected.
 void receivedMessage(byte[] message)
          Notifies this listener that protocol data has arrived from the server.
 void reconnected(byte[] message)
          Notifies this listener that a reconnection effort was successful.
 void reconnecting(byte[] message)
          Notifies this listener that its associated server connection is in the process of reconnecting with the server.
 ServerSessionListener sessionStarted(byte[] message)
          Notifies this listener that a new session has successfully logged in.
 

Method Detail

connected

void connected(ClientConnection connection)
Notifies this listener that a transport connection has been established.

Parameters:
connection - the newly-established connection

receivedMessage

void receivedMessage(byte[] message)
Notifies this listener that protocol data has arrived from the server.

Parameters:
message - protocol-specific message data

sessionStarted

ServerSessionListener sessionStarted(byte[] message)
Notifies this listener that a new session has successfully logged in.

Parameters:
message - protocol-specific session-start data
Returns:
the listener for events on the new ServerSession

reconnecting

void reconnecting(byte[] message)
Notifies this listener that its associated server connection is in the process of reconnecting with the server.

If a connection can be re-established with the server in a timely manner, this listener's reconnected method will be invoked. Otherwise, if a connection cannot be re-established, this listener's disconnected method will be invoked with false indicating that the associated session has been disconnected from the server and the client must log in again.

Parameters:
message - protocol-specific reconnection data

reconnected

void reconnected(byte[] message)
Notifies this listener that a reconnection effort was successful.

Parameters:
message - protocol-specific reconnection data

disconnected

void disconnected(boolean graceful,
                  byte[] message)
Notifies this listener that the associated server connection is disconnected.

If graceful is true, the disconnection was due to the associated client gracefully logging out; otherwise, the disconnection was due to other circumstances, such as forced disconnection or network failure.

Parameters:
graceful - true if disconnection was part of graceful logout, otherwise false
message - protocol-specific reconnection data

Project Darkstar, Version 0.9.11
2013-07-29 21:43:03

Copyright © 2007-2013 Sun Microsystems, Inc. All rights reserved