|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectweb.jonas.discovery.DiscoveryComm
org.objectweb.jonas.discovery.DiscoveryGreetingResponder
This class sends a multicast message stating the servername and the port at which it will listen for messages. It listens at the unicast port for a pre-determined time (greetingTimeOut) and if it receives a message indicating that a server with the same ID already exists in the domain then it terminates the discovery service.
| Field Summary | |
protected int |
greetingPort
Port to listen to for greeting responses. |
protected int |
greetingTimeOut
Time out period to listen to greetingPort for replies. |
protected java.net.DatagramSocket |
recvUnicastSocket
Used to recieve responses to the initial greeting message sent out on the multicast port. |
| Fields inherited from class org.objectweb.jonas.discovery.DiscoveryComm |
domainName, jonasName, multicastSocket, notStopped, RECEIVE_BUFFER_SIZE, serverId, unicastSocket, urls |
| Constructor Summary | |
DiscoveryGreetingResponder(DiscoveryManager dm)
Constructs a DiscoveryGreetingResponder associated to the DiscoveryManager |
|
| Method Summary | |
protected DiscGreeting |
createDiscGreeting(boolean startup)
Create a discovery greeting message |
void |
handleGreeting()
Creates a new thread to send the greeting message and listens for rejection messages in response. |
void |
run()
|
void |
stop()
Throw the run time exception to state that a server with the same name already exists. |
| Methods inherited from class org.objectweb.jonas.discovery.DiscoveryComm |
createNotifMessage, getDatagram, getServerId, join, sendNotif, sendResponse, setDomainName, setJonasName, setServerId, setUrls |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.net.DatagramSocket recvUnicastSocket
protected int greetingPort
protected int greetingTimeOut
| Constructor Detail |
public DiscoveryGreetingResponder(DiscoveryManager dm)
dm - DiscoveryManager to which this instance is associated| Method Detail |
protected DiscGreeting createDiscGreeting(boolean startup)
startup - -
true: means that is a greeting message at the point of start
up of the discovery service. false: means this is a reply to
a previous greeting message.
public void run()
run in interface java.lang.Runnablerun in class DiscoveryCommRunnable.run()
public void handleGreeting()
throws DuplicateServerNameException
DuplicateServerNameException - - If a server with the same ID
is found in the domain.public void stop()
stop in class DiscoveryComm
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||