|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--ocsf.server.AbstractServer
|
+--ocsf.server.AdaptableServer
The AdaptableServer is an adapter class
that extends the AbstractServer class in place of
the AbstractObservableServer .
Project Name: OCSF (Object Client-Server Framework)
| Field Summary | |
private ObservableServer |
server
The adapter used to simulate multiple class inheritance. |
| Fields inherited from class ocsf.server.AbstractServer |
backlog,
clientThreadGroup,
connectionListener,
port,
readyToStop,
serverSocket,
timeout |
| Constructor Summary | |
AdaptableServer(int port,
ObservableServer server)
Constructs the server adapter. |
|
| Method Summary | |
protected void |
clientConnected(ConnectionToClient client)
Hook method called each time a new client connection is accepted. |
protected void |
clientDisconnected(ConnectionToClient client)
Hook method called each time a client disconnects. |
protected void |
clientException(ConnectionToClient client,
java.lang.Throwable exception)
Hook method called each time an exception is raised in a client thread. |
protected void |
handleMessageFromClient(java.lang.Object msg,
ConnectionToClient client)
Handles a command sent from the client to the server. |
protected void |
listeningException(java.lang.Throwable exception)
Hook method called when the server stops accepting connections because an exception has been raised. |
protected void |
serverClosed()
Hook method called when the server is closed. |
protected void |
serverStarted()
Hook method called when the server starts listening for connections. |
protected void |
serverStopped()
Hook method called when the server stops accepting connections. |
| Methods inherited from class ocsf.server.AbstractServer |
close,
getClientConnections,
getNumberOfClients,
getPort,
isListening,
listen,
receiveMessageFromClient,
run,
sendToAllClients,
setBacklog,
setPort,
setTimeout,
stopListening |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private ObservableServer server
| Constructor Detail |
public AdaptableServer(int port,
ObservableServer server)
host - the server's host name.port - the port number.| Method Detail |
protected final void clientConnected(ConnectionToClient client)
client - the connection connected to the client.protected final void clientDisconnected(ConnectionToClient client)
client - the connection with the client.
protected final void clientException(ConnectionToClient client,
java.lang.Throwable exception)
client - the client that raised the exception.exception - the exception raised.protected final void listeningException(java.lang.Throwable exception)
exception - the exception raised.protected final void serverStopped()
protected final void serverStarted()
protected final void serverClosed()
protected final void handleMessageFromClient(java.lang.Object msg,
ConnectionToClient client)
msg - the message sent.client - the connection connected to the client that
sent the message.
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||