com.sun.sgs.client.simple
Class SimpleClient.SimpleClientConnectionListener

java.lang.Object
  extended by com.sun.sgs.client.simple.SimpleClient.SimpleClientConnectionListener
All Implemented Interfaces:
ClientConnectionListener
Enclosing class:
SimpleClient

final class SimpleClient.SimpleClientConnectionListener
extends Object
implements ClientConnectionListener

Receives callbacks on the associated ClientConnection.


Constructor Summary
SimpleClient.SimpleClientConnectionListener()
          Constructs an instance.
SimpleClient.SimpleClientConnectionListener(PasswordAuthentication authentication)
          Constructs an instance with the specified password authentication.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleClient.SimpleClientConnectionListener

SimpleClient.SimpleClientConnectionListener()
Constructs an instance.


SimpleClient.SimpleClientConnectionListener

SimpleClient.SimpleClientConnectionListener(PasswordAuthentication authentication)
Constructs an instance with the specified password authentication. This is used in the redirect case, so the password authentication doesn't need to be reobtained from the user.

Method Detail

connected

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

Specified by:
connected in interface ClientConnectionListener
Parameters:
connection - the newly-established connection

disconnected

public 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.

Specified by:
disconnected in interface ClientConnectionListener
Parameters:
graceful - true if disconnection was part of graceful logout, otherwise false
message - protocol-specific reconnection data

receivedMessage

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

Specified by:
receivedMessage in interface ClientConnectionListener
Parameters:
message - protocol-specific message data

reconnected

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

Specified by:
reconnected in interface ClientConnectionListener
Parameters:
message - protocol-specific reconnection data

reconnecting

public 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.

Specified by:
reconnecting in interface ClientConnectionListener
Parameters:
message - protocol-specific reconnection data

sessionStarted

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

Specified by:
sessionStarted in interface ClientConnectionListener
Parameters:
message - protocol-specific session-start data
Returns:
the listener for events on the new ServerSession

Project Darkstar, Version 0.9.9.5
2013-07-29 20:53:43

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