|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.jonas.discovery.DiscoveryComm
public class DiscoveryComm
Field Summary | |
---|---|
protected java.lang.String |
domainName
Domain name that this instance belongs to. |
protected java.lang.String |
jonasName
Name for this jonas instance. |
protected java.net.MulticastSocket |
multicastSocket
Used to multicast a discovery event on run() execution |
protected boolean |
notStopped
Set to false if the thread is stopped |
static int |
RECEIVE_BUFFER_SIZE
Size of buffer to read incoming packets into. |
protected java.lang.String |
serverId
The server ID of the jonas instance. |
protected java.net.DatagramSocket |
unicastSocket
Uset to send a discovery event as response to a discovey message |
protected java.lang.String[] |
urls
MBean server connection URLs for this server. |
Constructor Summary | |
---|---|
DiscoveryComm(DiscoveryManager dm)
Constructs a DiscoveryComm associated to the DiscoveryManager |
Method Summary | |
---|---|
DiscEvent |
createNotifMessage(java.lang.String state)
Create a discovery event to notify about a state change of the event sender |
protected java.net.DatagramPacket |
getDatagram(int length)
Construct a new datagram. |
java.lang.String |
getServerId()
|
protected void |
join()
Creates a MulticastSocket and joins the group of multicas host identified by the InetAddress destAddress |
void |
run()
|
void |
sendNotif(DiscMessage msg)
sends (multicasts) a Discovery Message to the group. |
protected void |
sendResponse(DiscMessage msg,
java.net.InetAddress destAddress,
int port)
Send response to a DiscoveryMessage |
protected void |
setDomainName(java.lang.String domainName)
|
protected void |
setJonasName(java.lang.String jonasName)
|
void |
setServerId(java.lang.String serverId)
|
protected void |
setUrls(java.lang.String[] urls)
|
void |
stop()
sends a notification message to notify that the server is stopping. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int RECEIVE_BUFFER_SIZE
protected java.net.MulticastSocket multicastSocket
protected java.net.DatagramSocket unicastSocket
protected boolean notStopped
protected java.lang.String jonasName
protected java.lang.String domainName
protected java.lang.String serverId
protected java.lang.String[] urls
Constructor Detail |
---|
public DiscoveryComm(DiscoveryManager dm)
dm
- DiscoveryManager to which this thread is associatedMethod Detail |
---|
protected void join()
destAddress
public void sendNotif(DiscMessage msg)
msg
- The message to send.protected void sendResponse(DiscMessage msg, java.net.InetAddress destAddress, int port)
msg
- Containes a DiscoveryMessage allowing to inform about the responder
(name, state, URLs)destAddress
- the destination address picked up from the requestport
- the destination port picked up from the requestpublic DiscEvent createNotifMessage(java.lang.String state) throws java.lang.Exception
state
- - RUNNING if the sender notifies that it gets running
- STOPPING if the sender notifies that it stops running
java.lang.Exception
- is thrown if the jmx service is not reached.protected java.net.DatagramPacket getDatagram(int length)
length
- packets length to be received
public void run()
run
in interface java.lang.Runnable
Runnable.run()
public void stop()
protected void setJonasName(java.lang.String jonasName)
jonasName
- The jonasName to set.protected void setDomainName(java.lang.String domainName)
domainName
- The domainName to set.protected void setUrls(java.lang.String[] urls)
urls
- The urls to set.public java.lang.String getServerId()
public void setServerId(java.lang.String serverId)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |