|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.sun.slamd.server.StatClientConnection
This class defines a thread that is spawned by the server to handle each stat client connection. It takes care of reading messages in from the client and provides methods for sending messages to the client.
| Field Summary |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
StatClientConnection(SLAMDServer slamdServer,
StatListener listener,
java.net.Socket clientSocket)
Creates a new stat client connection based on the provided information. |
|
| Method Summary | |
java.lang.String |
getClientID()
Retrieves the client ID associated with this stat client connection. |
java.lang.String |
getClientIPAddress()
Retrieves the IP address of the client system associated with this connection. |
java.lang.String |
getClientVersion()
Retrieves the version of the client software that the client system is running. |
Message |
getMessage(int messageID)
Retrieves the message with the specified message ID from the receive queue. |
void |
run()
Listens for messages from the client and either handles them or hands them off to be handled elsewhere. |
void |
sendServerShutdownMessage(boolean closeSocket)
Sends a message to the client that indicates the server is shutting down, and then optionally closes the connection to the client. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public StatClientConnection(SLAMDServer slamdServer,
StatListener listener,
java.net.Socket clientSocket)
throws SLAMDException
slamdServer - The SLAMD server with which this client is
associated.listener - The listener that accepted this connection.clientSocket - The socket used to communicate with the client.
SLAMDException - If a problem occurs while creating the connection.| Method Detail |
public java.lang.String getClientID()
public java.lang.String getClientIPAddress()
public java.lang.String getClientVersion()
public Message getMessage(int messageID)
messageID - The message ID of the message to retrieve.
null if an appropriate
response does not arrive within an appropriate timeout period.public void sendServerShutdownMessage(boolean closeSocket)
closeSocket - Indicates whether the connection to the client should
be closed.public void run()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||