ocsf.client
Class AdaptableClient

java.lang.Object
  |
  +--ocsf.client.AbstractClient
        |
        +--ocsf.client.AdaptableClient

class AdaptableClient
extends AbstractClient

The AdaptableClient is a class that extends the AbstractClient in place of the ObservableClient .

Project Name: OCSF (Object Client-Server Framework)


Field Summary
private  ObservableClient client
          The proxy used to simulate multiple class inheritance.
 
Fields inherited from class ocsf.client.AbstractClient
clientReader, clientSocket, host, input, output, port, readyToStop
 
Constructor Summary
AdaptableClient(java.lang.String host, int port, ObservableClient client)
          Constructs the client adapter.
 
Method Summary
protected  void connectionClosed()
          Hook method called after the connection has been closed.
protected  void connectionEstablished()
          Hook method called after a connection has been established.
protected  void connectionException(java.lang.Exception exception)
          Hook method called after an exception is raised by the client listening thread.
protected  void handleMessageFromServer(java.lang.Object msg)
          Handles a message sent from the server to this client.
 
Methods inherited from class ocsf.client.AbstractClient
closeAll, closeConnection, getHost, getInetAddress, getPort, isConnected, openConnection, run, sendToServer, setHost, setPort
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

client

private ObservableClient client
The proxy used to simulate multiple class inheritance.
Constructor Detail

AdaptableClient

public AdaptableClient(java.lang.String host,
                       int port,
                       ObservableClient client)
Constructs the client adapter.
Parameters:
host - the server's host name.
port - the port number.
Method Detail

connectionClosed

protected final void connectionClosed()
Hook method called after the connection has been closed.
Overrides:
connectionClosed in class AbstractClient

connectionException

protected final void connectionException(java.lang.Exception exception)
Hook method called after an exception is raised by the client listening thread.
Parameters:
exception - the exception raised.
Overrides:
connectionException in class AbstractClient

connectionEstablished

protected final void connectionEstablished()
Hook method called after a connection has been established.
Overrides:
connectionEstablished in class AbstractClient

handleMessageFromServer

protected final void handleMessageFromServer(java.lang.Object msg)
Handles a message sent from the server to this client.
Parameters:
msg - the message sent.
Overrides:
handleMessageFromServer in class AbstractClient