|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.jlab.coda.cMsg.cMsgDomain.server.cMsgNameServer
public class cMsgNameServer
This class implements a cMsg name server in the cMsg domain. A word of caution. If multiple cMsgNameServer objects exist in a single JVM and they both service clients in the cMsg subdomain, then there will be undesirable effects. In other words, the cMsg subdomain uses static data in some of its implementing classes (cMsgServerBridge & subdomains.cMsg).
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 | |
---|---|
cMsgNameServer(int port,
int udpPort,
boolean timeOrdered,
boolean standAlone,
java.lang.String clientPassword,
java.lang.String cloudPassword,
int debug)
Constructor which reads environmental variables and opens listening sockets. |
Method Summary | |
---|---|
void |
cloudLock()
This method locks a lock used in adding servers to the server cloud and in adding clients to servers. |
boolean |
cloudLock(int delay)
This method locks a lock used in adding servers to the server cloud and in adding clients to servers. |
void |
cloudUnlock()
This method unlocks a lock used in adding servers to the server cloud and in adding clients to servers. |
int |
getCloudStatus()
Get the status of the relationship of this server to the cMsg subdomain server cloud. |
boolean |
getKillAllThreads()
Gets boolean value specifying whether to kill this and all spawned threads. |
int |
getPort()
Get the name server's listening port. |
java.lang.String |
getServerName()
Get this server's name (host:port). |
static void |
main(java.lang.String[] args)
Run as a stand-alone application. |
void |
printSizes()
This method prints out the sizes of all objects which store other objects. |
void |
run()
This method is executed as a thread. |
void |
setCloudStatus(int status)
Set the status of the relationship of this server to the cMsg subdomain server cloud. |
void |
setKillAllThreads(boolean b)
Sets boolean to kill this and all spawned threads. |
void |
startServer(java.lang.String serverToJoin)
Method to start up this server and join the cMsg server cloud that the argument, serverToJoin, is a part of. |
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 cMsgNameServer(int port, int udpPort, boolean timeOrdered, boolean standAlone, java.lang.String clientPassword, java.lang.String cloudPassword, int debug)
port
- TCP listening port for communication from clientsudpPort
- UDP listening port for receiving broadcasts from clientstimeOrdered
- if true all client commands are processed in the order receivedstandAlone
- if true no other cMsg servers are allowed to attached to this one and form a cloudclientPassword
- password client needs to provide to connect to this servercloudPassword
- password server needs to provide to connect to this server to become part of a clouddebug
- desired level of debug outputMethod Detail |
---|
public void setKillAllThreads(boolean b)
b
- setting to true will kill this and all spawned threadspublic boolean getKillAllThreads()
public void cloudLock()
public boolean cloudLock(int delay)
delay
- time in milliseconds to wait for the lock before timing out
public void cloudUnlock()
public int getCloudStatus()
INCLOUD
, NONCLOUD
,
or BECOMINGCLOUD
public void setCloudStatus(int status)
INCLOUD
, NONCLOUD
,
or BECOMINGCLOUD
.
status
- status of the relationship of this server to the cMsg subdomain
server cloudpublic java.lang.String getServerName()
public int getPort()
public void printSizes()
public static void main(java.lang.String[] args)
public void startServer(java.lang.String serverToJoin)
serverToJoin
- server whose cloud this server is to be joined topublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |