|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ow2.jonas.discovery.internal.comm.DiscoveryComm
public class DiscoveryComm
Field Summary | |
---|---|
protected String |
domainName
Domain name that this instance belongs to. |
protected String |
jonasName
Name for this jonas instance. |
protected 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 String |
serverId
The server ID of the jonas instance. |
protected DatagramSocket |
unicastSocket
Uset to send a discovery event as response to a discovey message |
protected 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(String state)
Create a discovery event to notify about a state change of the event sender |
protected DatagramPacket |
getDatagram(int length)
Construct a new datagram. |
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,
InetAddress destAddress,
int port)
Send response to a DiscoveryMessage |
protected void |
setDomainName(String domainName)
|
protected void |
setJonasName(String jonasName)
|
void |
setServerId(String serverId)
|
protected void |
setUrls(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 MulticastSocket multicastSocket
protected DatagramSocket unicastSocket
protected boolean notStopped
protected String jonasName
protected String domainName
protected String serverId
protected 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, 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(String state) throws Exception
state
- - RUNNING if the sender notifies that it gets running
- STOPPING if the sender notifies that it stops running
Exception
- is thrown if the jmx service is not reached.protected DatagramPacket getDatagram(int length)
length
- packets length to be received
public void run()
run
in interface Runnable
Runnable.run()
public void stop()
protected void setJonasName(String jonasName)
jonasName
- The jonasName to set.protected void setDomainName(String domainName)
domainName
- The domainName to set.protected void setUrls(String[] urls)
urls
- The urls to set.public String getServerId()
public void setServerId(String serverId)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |