|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sourceforge.jemm.comm.server.ServerThread
public class ServerThread
ServerThread is used by RPCServer for handling individual client connections.
Released under the Apache License V2.0 license by the JEMM Project
| Field Summary | |
|---|---|
protected RPCClientId |
clientId
|
protected boolean |
connected
|
protected Connection |
connection
|
protected RPCHandler |
rpcHandler
|
protected RPCServer |
server
|
protected java.util.concurrent.CountDownLatch |
shutdownLatch
|
| Constructor Summary | |
|---|---|
ServerThread(RPCServer server,
Connection connection,
RPCClientId clientId,
java.util.Map<java.lang.Class<?>,java.lang.Object> offeredIfs,
java.util.concurrent.ExecutorService threadPool)
Creates a server thread to handle a specific client connection. |
|
| Method Summary | |
|---|---|
void |
connectionTerminated()
Notification that the connection has been closed. |
java.lang.Object |
getClientIF(java.lang.Class<?> ifClass)
Gets the proxy for the given client interface. |
void |
shutdown()
Shutdown the thread by closing its socket connection. |
void |
start()
Start the server thread, initialising the connection and listening to client requests. |
void |
waitForShutdown()
Utility method to allow a thread to wait for this thread to have completely terminated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.concurrent.CountDownLatch shutdownLatch
protected volatile boolean connected
protected RPCClientId clientId
protected RPCServer server
protected RPCHandler rpcHandler
protected Connection connection
| Constructor Detail |
|---|
public ServerThread(RPCServer server,
Connection connection,
RPCClientId clientId,
java.util.Map<java.lang.Class<?>,java.lang.Object> offeredIfs,
java.util.concurrent.ExecutorService threadPool)
server - The server instance this client belongs toconnection - The client socketclientId - The server assigned client id;offeredIfs - The interfaces offered to the client by the serverthreadPool - The threadpool to use for servicing requests| Method Detail |
|---|
public void start()
public void connectionTerminated()
connectionTerminated in interface RPCHandlerListenerpublic void shutdown()
public void waitForShutdown()
public java.lang.Object getClientIF(java.lang.Class<?> ifClass)
ifClass - The requesting interface implementation.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||