org.objectweb.jonas.discovery
Class DiscoveryComm

java.lang.Object
  extended byorg.objectweb.jonas.discovery.DiscoveryComm
All Implemented Interfaces:
java.lang.Runnable

public class DiscoveryComm
extends java.lang.Object
implements java.lang.Runnable

Version:
1.0
Author:
Takoua Abdellatif

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
 void run()
           
 void sendNotif(DiscEvent msg)
          sends (multicasts) a DiscoveryEvent to the group.
protected  void setDomainName(java.lang.String domainName)
           
protected  void setJonasName(java.lang.String jonasName)
           
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
 

Constructor Detail

DiscoveryComm

public DiscoveryComm(DiscoveryManager dm)
Constructs a DiscoveryComm associated to the DiscoveryManager

Parameters:
dm - DiscoveryManager to which this thread is associated
Method Detail

sendNotif

public void sendNotif(DiscEvent msg)
sends (multicasts) a DiscoveryEvent to the group.


createNotifMessage

public DiscEvent createNotifMessage(java.lang.String state)
                             throws java.lang.Exception
Create a discovery event to notify about a state change of the event sender

Parameters:
state - - RUNNING if the sender notifies that it gets running - STOPPING if the sender notifies that it stops running
Returns:
a Discovery event (notification)
Throws:
java.lang.Exception - is thrown if the jmx service is not reached.

run

public void run()
Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

stop

public void stop()
sends a notification message to notify that the server is stopping.


setJonasName

protected void setJonasName(java.lang.String jonasName)
Parameters:
jonasName - The jonasName to set.

setDomainName

protected void setDomainName(java.lang.String domainName)

setUrls

protected void setUrls(java.lang.String[] urls)
Parameters:
urls - The urls to set.