|
||||||||||
| 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.ClientListener
This class implements the client listener that the SLAMD server uses to listen for connections from clients. If fewer than the maximum connections are established, then the connection will be accepted and a new connection thread will be spawned to handle operations on that connection. If the maximum number of connections are already in use, then the new connection will be rejected.
| Field Summary |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
ClientListener(SLAMDServer slamdServer)
Creates a new listener to accept client connections. |
|
| Method Summary | |
void |
connectionLost(ClientConnection clientConnection)
Indicates that the specified connection is closing and all refrences to it should be removed. |
boolean |
connectionsAvailable(Job job)
Indicates whether the client listener currently has connections available that satisfy the requirements for the indicated job. |
boolean |
forceDisconnect(java.lang.String clientID)
Forcefully closes the connection to the specified client and removes all references to it from the SLAMD server. |
void |
forcefullyDisconnectAll()
Forcefully closes the connections for all clients connected to the SLAMD server. |
ClientConnection[] |
getClientConnections(Job job)
Retrieves the set of client connections for processing the specified job. |
ClientConnection[] |
getConnectionList()
Retrieves the set of connections that are currently established. |
int |
getKeepAliveInterval()
Retrieves the length of time that should pass between keepalive messages. |
int |
getMaxClients()
Retrieves the maximum number of concurrent client connections that should be allowed for this listener. |
int |
getMaxResponseWaitTime()
Retrieves the maximum amount of time in seconds that a client connection should wait for a response to a solicited message before returning an error. |
java.lang.String |
getNewConnectionID()
Retrieves a connection ID that can be used to uniquely identify each client connection. |
java.lang.String |
getSubscriberName()
Retrieves the name that the client listener uses to subscribe to the configuration handler in order to be notified of configuration changes. |
ParameterList |
getSubscriberParameters()
Retrieves the set of configuration parameters associated with this configuration subscriber. |
void |
refreshSubscriberConfiguration()
Re-reads all configuration information used by the client listener. |
void |
refreshSubscriberConfiguration(java.lang.String parameterName)
Re-reads the configuration for the specified parameter if the parameter is applicable to the client listener. |
boolean |
requestDisconnect(java.lang.String clientID)
Sends a message to the specified client indicating that it should disconnect from the SLAMD server. |
void |
requestDisconnectAll()
Sends a message to each client indicating that it should disconnect itself from the SLAMD server. |
boolean |
requireAuthentication()
Indicates whether this client listener requries clients to authenticate. |
void |
run()
Creates the server socket and listens for new connections. |
void |
setAvailableForProcessing(ClientConnection clientConnection)
Indicates that the specified client connection is available for processing new jobs. |
void |
startListening()
Indicates that the listener should start listening for client connections. |
void |
stopListening()
Indicates that the listener should stop listening for client connections. |
boolean |
useSSL()
Indicates whether this client listener is configured to use SSL. |
void |
waitForStop()
This method will not return until the client listener has actually stopped. |
| 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 ClientListener(SLAMDServer slamdServer)
slamdServer - The SLAMD server with which this listener is
associated.| Method Detail |
public void startListening()
public void stopListening()
public void waitForStop()
stopListening method to signal the listener that it needs to
stop.
public void run()
run in interface java.lang.Runnablepublic boolean connectionsAvailable(Job job)
job - The job for which to make the determination.
true if this client listener has an appropriate set
of clients available, or false if not.public ClientConnection[] getClientConnections(Job job)
job - The job for which the connections are to be retrieved.
null if there is not an appropriate set of
connections available.public ClientConnection[] getConnectionList()
public java.lang.String getNewConnectionID()
public boolean requireAuthentication()
true if clients are required to authenticate, or
false if they are not.public boolean requestDisconnect(java.lang.String clientID)
clientID - The client ID of the client to which the request is to be
sent.
true if a request was sent to the specified client,
or false if not.public void requestDisconnectAll()
public boolean forceDisconnect(java.lang.String clientID)
clientID - The client ID of the client to be disconnected.
true if the client was disconnected, or
false if not.public void forcefullyDisconnectAll()
public void connectionLost(ClientConnection clientConnection)
clientConnection - The connection that is shutting down.public void setAvailableForProcessing(ClientConnection clientConnection)
clientConnection - The connection that is announcing its
availability.public int getKeepAliveInterval()
public int getMaxClients()
public int getMaxResponseWaitTime()
public boolean useSSL()
true if this client listener is configured to use
SSL, or false if it is not.public java.lang.String getSubscriberName()
getSubscriberName in interface ConfigSubscriberpublic ParameterList getSubscriberParameters()
getSubscriberParameters in interface ConfigSubscriber
public void refreshSubscriberConfiguration()
throws SLAMDServerException
refreshSubscriberConfiguration in interface ConfigSubscriberSLAMDServerException - If there is a problem reading or applying
the changes.
public void refreshSubscriberConfiguration(java.lang.String parameterName)
throws SLAMDServerException
refreshSubscriberConfiguration in interface ConfigSubscriberparameterName - The name of the parameter for which to reread the
configuration.
SLAMDServerException - If there is a problem reading or applying
the specified change.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||