org.jdesktop.wonderland.server.comms
Interface ClientConnectionHandler

All Known Subinterfaces:
SecureClientConnectionHandler

public interface ClientConnectionHandler

Handles client connections to the given client type.

ClientConnectionHandlers are stored in the Darkstar data store, so must be either Serializable or a ManagedObject. If a handler is a ManagedObject, only a single copy of the handler will exist, and all messages will be forwarded to this object. If the handler is not a managed object, a separate copy of the handler will be created in each WonderlandSession that connects a client of the given type. It is recommended that handlers that expect a large number messages be Serializable.

Author:
jkaplan

Method Summary
 void clientConnected(WonderlandClientSender sender, WonderlandClientID clientID, java.util.Properties properties)
          Handle when a new session connectes to this handler.
 void clientDisconnected(WonderlandClientSender sender, WonderlandClientID clientID)
          Handle when a session disconnects from this handler
 ConnectionType getConnectionType()
          Get the type of connection this handler deals with
 void messageReceived(WonderlandClientSender sender, WonderlandClientID clientID, Message message)
          Handle a message from a client
 void registered(WonderlandClientSender sender)
          Called when the handler is registered with the CommsManager
 

Method Detail

getConnectionType

ConnectionType getConnectionType()
Get the type of connection this handler deals with

Returns:
the connection types this handler can be used for

registered

void registered(WonderlandClientSender sender)
Called when the handler is registered with the CommsManager

Parameters:
sender - the WonderlandClientSender that can be used to send to all clients of the given type

clientConnected

void clientConnected(WonderlandClientSender sender,
                     WonderlandClientID clientID,
                     java.util.Properties properties)
Handle when a new session connectes to this handler. A session connects when a client calls WonderlandSession.connect().

Parameters:
sender - the sender that can be used to send to clients of this handler
clientID - the ID of the session that connected
properties - the properties of the connection, or an empty property object if the client didn't send any properties

messageReceived

void messageReceived(WonderlandClientSender sender,
                     WonderlandClientID clientID,
                     Message message)
Handle a message from a client

Parameters:
sender - the sender that can be used to send to clients of this handler
clientID - the ID of the session that connected
message - the message that was generated

clientDisconnected

void clientDisconnected(WonderlandClientSender sender,
                        WonderlandClientID clientID)
Handle when a session disconnects from this handler

Parameters:
sender - the sender that can be used to send to clients of this handler
clientID - the ID of the session that connected


Open Wonderland - http://openwonderland.org