service.id
Class IdentificationServiceUDP
java.lang.Object
service.Service
service.id.IdentificationServiceUDP
- All Implemented Interfaces:
- java.lang.Runnable, IIdentification
public class IdentificationServiceUDP
- extends Service
- implements IIdentification, java.lang.Runnable
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
identifiers
protected java.util.Vector<ProcessIdentifier> identifiers
IdentificationServiceUDP
public IdentificationServiceUDP()
getMyIdentifier
public ProcessIdentifier getMyIdentifier()
- Specified by:
getMyIdentifier
in interface IIdentification
- Returns:
- the identifier of the current process
setCommunicationElement
public void setCommunicationElement(CommunicationElement elt)
getAllIdentifiers
public java.util.Vector<ProcessIdentifier> getAllIdentifiers()
- Specified by:
getAllIdentifiers
in interface IIdentification
- Returns:
- the list of identifiers of all processes of the system (excepting the one
of the current process)
sendData
protected void sendData(IdentificationData data)
receiveData
protected IdentificationData receiveData()
sendIdRequestToServer
protected void sendIdRequestToServer()
initialize
public void initialize(MessageDispatcher dispatcher,
ICommunication commElt,
MessageType myType)
- Description copied from class:
Service
- Initialize the service: register the service on the message dispatcher
- Overrides:
initialize
in class Service
- Parameters:
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 service
printIdentifiers
protected void printIdentifiers()
leaveSystem
public void leaveSystem()
- Description copied from interface:
IIdentification
- 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.
- Specified by:
leaveSystem
in interface IIdentification
run
public void run()
- Specified by:
run
in interface java.lang.Runnable