org.ow2.jonas.discovery.internal.manager
Class DiscoveryManager

java.lang.Object
  extended by org.ow2.jonas.discovery.internal.manager.DiscoveryManager
All Implemented Interfaces:
EventListener, MBeanRegistration, NotificationListener, DiscoveryManagerMBean

public class DiscoveryManager
extends Object
implements DiscoveryManagerMBean, MBeanRegistration, NotificationListener

DiscoveryManager goal is to listen to a well known and reconfigurable IpAddress and to give appropriate JMXURL to manage remotely Jonas server.

Version:
1.0
Author:
Takoua Abdellatif , Vivek Lakshmanan

Constructor Summary
DiscoveryManager(String serverId, int listeningPort, String listeningIp, int greetingListeningPort, int greetingAckTimeOut)
           
 
Method Summary
 String getDomainName()
           
 int getGreetingAckTimeOut()
          gets the time out period within which the host will listen for acknowledgement messages after sending a greeting.
 int getGreetingListeningPort()
          gets the port on which the DiscoveryManager is listening for a discovery greeting response.
 String getJonasName()
           
 String getListeningIp()
           
 int getListeningPort()
          gets the port on which the DiscoveryManager is listening for a discovery request.
 String getServerId()
           
 int getTimeToLive()
          gets the time to live of the multicast socket.
 String[] getUrls()
           
 void handleNotification(Notification notification, Object handback)
           
 void postDeregister()
           
 void postRegister(Boolean arg0)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer mbeanServer, ObjectName on)
           
 void setDomainName(String domainNamle)
           
 void setGreetingAckTimeOut(int greetingAckTimeOut)
          sets the time out period within which the host will listen for acknowledgement messages after sending a greeting.
 void setGreetingListeningPort(int greetingListeningPort)
          sets the port on which the DiscoveryManager is listening for a discovery greeting response.
 void setJonasName(String jonasName)
           
 void setListeningIp(String listeningIp)
          sets the IP address the listening manager uses.
 void setListeningPort(int listeningPort)
          sets the port on which the DiscoveryManager is listening.
 void setServerId(String serverId)
           
 void setTimeToLive(int ttl)
          sets the time to live value to ttl.
 void setUrls(String[] urls)
           
 void start()
          starts the listening task on the listeningPort and listening Ip defined with the parameters.
 void stop()
          Stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscoveryManager

public DiscoveryManager(String serverId,
                        int listeningPort,
                        String listeningIp,
                        int greetingListeningPort,
                        int greetingAckTimeOut)
Parameters:
serverId - TODO
listeningPort - Port to listen to for multicast messages.
listeningIp - IP where the multicast group will listen.
greetingListeningPort - Port to listen to greeting replies on. A message on this port signifies that a server already in the group has the same server name as used by this instance.
greetingAckTimeOut - The amount of time the server will listen to greetingListeningPort for replies.
Method Detail

start

public void start()
Description copied from interface: DiscoveryManagerMBean
starts the listening task on the listeningPort and listening Ip defined with the parameters.

Specified by:
start in interface DiscoveryManagerMBean

getGreetingAckTimeOut

public int getGreetingAckTimeOut()
Description copied from interface: DiscoveryManagerMBean
gets the time out period within which the host will listen for acknowledgement messages after sending a greeting.

Specified by:
getGreetingAckTimeOut in interface DiscoveryManagerMBean
Returns:
time out period within which the host will listen for acknowledgement messages after sending a greeting.

setGreetingAckTimeOut

public void setGreetingAckTimeOut(int greetingAckTimeOut)
Description copied from interface: DiscoveryManagerMBean
sets the time out period within which the host will listen for acknowledgement messages after sending a greeting.

Specified by:
setGreetingAckTimeOut in interface DiscoveryManagerMBean

getGreetingListeningPort

public int getGreetingListeningPort()
Description copied from interface: DiscoveryManagerMBean
gets the port on which the DiscoveryManager is listening for a discovery greeting response.

Specified by:
getGreetingListeningPort in interface DiscoveryManagerMBean
Returns:
port to listen to for greeting responses.

setGreetingListeningPort

public void setGreetingListeningPort(int greetingListeningPort)
Description copied from interface: DiscoveryManagerMBean
sets the port on which the DiscoveryManager is listening for a discovery greeting response.

Specified by:
setGreetingListeningPort in interface DiscoveryManagerMBean

getListeningPort

public int getListeningPort()
Description copied from interface: DiscoveryManagerMBean
gets the port on which the DiscoveryManager is listening for a discovery request.

Specified by:
getListeningPort in interface DiscoveryManagerMBean
Returns:
notification port.

setListeningPort

public void setListeningPort(int listeningPort)
Description copied from interface: DiscoveryManagerMBean
sets the port on which the DiscoveryManager is listening.

Specified by:
setListeningPort in interface DiscoveryManagerMBean

getListeningIp

public String getListeningIp()
Specified by:
getListeningIp in interface DiscoveryManagerMBean
Returns:
IP address the DiscoveryManager uses.

setListeningIp

public void setListeningIp(String listeningIp)
Description copied from interface: DiscoveryManagerMBean
sets the IP address the listening manager uses.

Specified by:
setListeningIp in interface DiscoveryManagerMBean

setTimeToLive

public void setTimeToLive(int ttl)
Description copied from interface: DiscoveryManagerMBean
sets the time to live value to ttl. Defines the number of hops the multicast socket does.

Specified by:
setTimeToLive in interface DiscoveryManagerMBean

getTimeToLive

public int getTimeToLive()
Description copied from interface: DiscoveryManagerMBean
gets the time to live of the multicast socket.

Specified by:
getTimeToLive in interface DiscoveryManagerMBean
Returns:
ttl value.

preRegister

public ObjectName preRegister(MBeanServer mbeanServer,
                              ObjectName on)
                       throws Exception
Specified by:
preRegister in interface MBeanRegistration
Throws:
Exception
See Also:
MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName)

postRegister

public void postRegister(Boolean arg0)
Specified by:
postRegister in interface MBeanRegistration
See Also:
MBeanRegistration.postRegister(java.lang.Boolean)

preDeregister

public void preDeregister()
                   throws Exception
Specified by:
preDeregister in interface MBeanRegistration
Throws:
Exception
See Also:
MBeanRegistration.preDeregister()

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface MBeanRegistration
See Also:
MBeanRegistration.postDeregister()

handleNotification

public void handleNotification(Notification notification,
                               Object handback)
Specified by:
handleNotification in interface NotificationListener
See Also:
NotificationListener.handleNotification(javax.management.Notification, java.lang.Object)

getJonasName

public String getJonasName()
Returns:
jonasName The jonasName.

setJonasName

public void setJonasName(String jonasName)
Parameters:
jonasName - The jonasName to set.

getDomainName

public String getDomainName()
Returns:
jonasName The domain name.

setDomainName

public void setDomainName(String domainNamle)
Parameters:
domainNamle - The domainName to set.

getUrls

public String[] getUrls()
Parameters:
urls - The urls.

setUrls

public void setUrls(String[] urls)
Parameters:
urls - The urls to set.

stop

public void stop()
Stop

Specified by:
stop in interface DiscoveryManagerMBean

getServerId

public String getServerId()

setServerId

public void setServerId(String serverId)


Copyright © 2010 OW2 Consortium. All Rights Reserved.