|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
com.slamd.server.ClientManagerConnection
public class ClientManagerConnection
This class encapsulates a connection to a client manager, and it is used to keep track of information about them.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
ClientManagerConnection(SLAMDServer slamdServer,
ClientManagerListener listener,
java.net.Socket clientManagerSocket)
Creates a new client manager connection using the provided socket. |
|
| Method Summary | |
|---|---|
void |
clientConnectionLost()
Indicates that a client believed to have been started by this client manager has been lost and that the list of active connections should be updated accordingly. |
int |
compareTo(java.lang.Object o)
Compares this client manager connection with the provided object. |
void |
disconnect(boolean sendShutdownMessage)
Closes the connection to the client manager. |
java.lang.String |
getClientID()
Retrieves the ID of the client associated with this client manager connection. |
java.lang.String |
getClientIPAddress()
Retrieves the IP address of the client manager system. |
java.lang.String |
getClientVersion()
Retrieves the software version of the client associated with this client manager connection. |
java.util.Date |
getEstablishedTime()
Retrieves the time at which this connection was established. |
int |
getMaxClients()
Retrieves the maximum number of clients that may be started for this client manager. |
Message |
getMessage(int messageID)
Retrieves the message with the specified message ID from the receive queue. |
int |
getStartedClients()
Retrieves the number of clients associated with this client manager that are currently running. |
int |
nextMessageID()
Retrieves the message ID that should be used for the next request sent to the client manager. |
void |
run()
Create a loop that waits for new communication to arrive from the client manager. |
void |
startClients(int numClients)
Requests that the client manager start the specified number of clients. |
void |
stopClients(int numClients)
Requests that the client manager start the specified number of clients. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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 ClientManagerConnection(SLAMDServer slamdServer,
ClientManagerListener listener,
java.net.Socket clientManagerSocket)
throws SLAMDException
slamdServer - The SLAMD server with which this client
manager connection is associated.listener - The client manager listener associated with
this connection.clientManagerSocket - The socket used to communicate with the client
manager.
SLAMDException - If a problem occurs while creating the client
manager connection.| Method Detail |
|---|
public java.lang.String getClientID()
public java.lang.String getClientIPAddress()
public java.lang.String getClientVersion()
public java.util.Date getEstablishedTime()
public int getMaxClients()
public int getStartedClients()
public void startClients(int numClients)
throws SLAMDException
numClients - The number of clients to be started by this client
manager.
SLAMDException - If the number of clients requested would cause the
client manager to start more than the maximum
allowed number of clients, or if there is a
problem starting any of the clients.
public void stopClients(int numClients)
throws SLAMDException
numClients - The number of clients to be stopped by this client
manager. A negative value will indicate that all
clients should be stopped.
SLAMDException - If the requested number of clients is greater
than the number of clients actually running, or if
a problem occurs while trying to stop the clients.public void disconnect(boolean sendShutdownMessage)
sendShutdownMessage - Indicates whether a server shutdown message
should be sent to the client manager before
the connection is closed.public void clientConnectionLost()
public int nextMessageID()
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 run()
run in interface java.lang.Runnablerun in class java.lang.Thread
public int compareTo(java.lang.Object o)
throws java.lang.ClassCastException
compareTo in interface java.lang.Comparableo - The client manager connection object to compare against this
client manager connection.
java.lang.ClassCastException - If the provided object is not a client manager
connection object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||