Interface ConnectionHandler

All Known Implementing Classes:
Chatlet

public interface ConnectionHandler

This interface specifies the behaviour of the ConnectionHandler. It is used in conjuction with the ServletConnection to achieve the desired communication.


Method Summary
 java.lang.Object getConnectionData()
          Used when handshaking to get the connection data.
 void handleData(java.lang.Object data)
          Used to handle data recieved by the ServletConnection.
 boolean isConnected()
          Used to retrieve the current connection status.
 void setConnected(boolean connected)
          Used to set the connection status.
 void setConnectionResponse(java.lang.Object response)
          The response given in a handshake procedure.
 

Method Detail

getConnectionData

public java.lang.Object getConnectionData()
Used when handshaking to get the connection data.
Returns:
The connection data to use when handshaking.

setConnectionResponse

public void setConnectionResponse(java.lang.Object response)
The response given in a handshake procedure.
Parameters:
response - The response from a handshake.

isConnected

public boolean isConnected()
Used to retrieve the current connection status.
Returns:
true when a connection has been established and false otherwise.

setConnected

public void setConnected(boolean connected)
Used to set the connection status.
Parameters:
connected - true or false.

handleData

public void handleData(java.lang.Object data)
Used to handle data recieved by the ServletConnection.
Parameters:
data - The data to be handled.