|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object service.Service service.id.IdentificationService
public class IdentificationService
Identification service allowing for a process to know all process identifiers of the system.
Field Summary | |
---|---|
protected java.net.InetAddress |
group
IP address of the multicast group |
protected java.util.Vector<ProcessIdentifier> |
identifiers
Identifiers of all processes of the system. |
protected java.net.MulticastSocket |
socket
Multicast socket used to communication with the identification server. |
Fields inherited from class service.Service |
---|
buffer, commElt, dispatcher, myType |
Fields inherited from interface service.IIdentification |
---|
ipGroup, port |
Constructor Summary | |
---|---|
IdentificationService()
|
Method Summary | |
---|---|
java.util.Vector<ProcessIdentifier> |
getAllIdentifiers()
|
ProcessIdentifier |
getMyIdentifier()
|
void |
initialize(MessageDispatcher dispatcher,
ICommunication commElt,
MessageType myType)
Initialize the service: register the service on the message dispatcher |
void |
leaveSystem()
Leave the system: the identification server remove the current process from the process list identifiers and inform the other processes of the leaving of the current process. |
protected void |
printIdentifiers()
Print on the standard output the set of process identifiers. |
void |
run()
Wait for data coming from the identification server. |
protected void |
sendData(IdentificationData data)
Send a data (i.e. a request) to the identification server. |
protected void |
sendIdRequestToServer()
Send a request to the identification server for getting the process identifier. |
Methods inherited from class service.Service |
---|
sendMessage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector<ProcessIdentifier> identifiers
protected java.net.MulticastSocket socket
protected java.net.InetAddress group
Constructor Detail |
---|
public IdentificationService()
Method Detail |
---|
public ProcessIdentifier getMyIdentifier()
getMyIdentifier
in interface IIdentification
public java.util.Vector<ProcessIdentifier> getAllIdentifiers()
getAllIdentifiers
in interface IIdentification
public void leaveSystem()
IIdentification
leaveSystem
in interface IIdentification
protected void sendIdRequestToServer()
protected void sendData(IdentificationData data)
data
- the data to sendpublic void initialize(MessageDispatcher dispatcher, ICommunication commElt, MessageType myType)
Service
initialize
in class Service
dispatcher
- the message dispatcher to use for associating the current service with its type of messagecommElt
- the communication element to use to send messages to service parts on other processesmyType
- the type of the serviceprotected void printIdentifiers()
public void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |