|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread service.id.IdentificationServer
public class IdentificationServer
The identification server has to started before launching any process. Its goal is
to set the identifiers of the processes of the system and to make them knowing
the identifiers of all the processes.
The server communicates with the processes in two ways, depending on the communication direction:
service.IIdentification
interface. Moreover, as the communication element of a process can loose messages and
considering that the communication with the identification server must be reliable, a process sends
messages to the server only through UDP multicast.
Nested Class Summary | |
---|---|
protected class |
IdentificationServer.PingManager
The heartbreak thread send regularly an hearbreak message to each process. |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected CommunicationElement |
commElt
The communication element used for sending data to processes |
protected java.net.InetAddress |
group
The multicast IP group address |
protected java.util.Vector<ProcessIdentifier> |
identifiers
Set of all the process identifiers of the system |
protected int |
lastId
The last identifier used. |
protected java.net.MulticastSocket |
socket
The UDP multicast socket that is used by a process to contact the identification server |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
IdentificationServer()
|
Method Summary | |
---|---|
java.util.Vector<ProcessIdentifier> |
getIdentifiers()
|
protected void |
initialize()
Initialize the server by creating its multicast socket. |
static void |
main(java.lang.String[] argv)
|
protected void |
printIdentifiers()
Print on standard output all process identifiers. |
protected IdentificationData |
receiveData()
Wait for a data received on the UDP multicast group. |
void |
run()
|
protected void |
sendAllId()
Send all process identifiers to each process. |
void |
setIdentifiers(java.util.Vector<ProcessIdentifier> identifiers)
|
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 |
Field Detail |
---|
protected java.util.Vector<ProcessIdentifier> identifiers
protected int lastId
protected CommunicationElement commElt
protected java.net.MulticastSocket socket
protected java.net.InetAddress group
Constructor Detail |
---|
public IdentificationServer() throws CommunicationException
CommunicationException
Method Detail |
---|
public java.util.Vector<ProcessIdentifier> getIdentifiers()
public void setIdentifiers(java.util.Vector<ProcessIdentifier> identifiers)
identifiers
- set the process identifier setprotected void printIdentifiers()
protected void sendAllId()
protected IdentificationData receiveData()
null
in case of problemprotected void initialize()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |