|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sourceforge.jemmrpc.server.ServerThread
public class ServerThread
ServerThread is used by RPCServer for handling individual client connections.
Field Summary | |
---|---|
protected ClientId |
clientId
|
protected boolean |
connected
|
protected static org.apache.log4j.Logger |
LOG
|
protected RPCHandler |
rpcHandler
|
protected RPCServer |
server
|
protected java.util.concurrent.CountDownLatch |
shutdownLatch
|
protected java.net.Socket |
socket
|
Constructor Summary | |
---|---|
ServerThread(RPCServer fServer,
java.net.Socket fSocket,
ClientId fClientId,
java.util.Map<java.lang.Class<?>,java.lang.Object> fOfferedIfs,
java.util.concurrent.ExecutorService fThreadPool)
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 static final org.apache.log4j.Logger LOG
protected final java.util.concurrent.CountDownLatch shutdownLatch
protected final ClientId clientId
protected final RPCServer server
protected final RPCHandler rpcHandler
protected final java.net.Socket socket
protected volatile boolean connected
Constructor Detail |
---|
public ServerThread(RPCServer fServer, java.net.Socket fSocket, ClientId fClientId, java.util.Map<java.lang.Class<?>,java.lang.Object> fOfferedIfs, java.util.concurrent.ExecutorService fThreadPool)
fServer
- The server instance this client belongs tofSocket
- The client socketfClientId
- The server assigned client id;fOfferedIfs
- The interfaces offered to the client by the serverfThreadPool
- The threadpool to use for servicing requestsMethod Detail |
---|
public void start()
public void connectionTerminated()
connectionTerminated
in interface RPCHandlerListener
public 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 |