org.ow2.jonas.discovery.internal.enroller
Class Enroller

java.lang.Object
  extended by org.ow2.jonas.discovery.internal.enroller.Enroller
All Implemented Interfaces:
MBeanRegistration, EnrollerMBean

public class Enroller
extends Object
implements MBeanRegistration, EnrollerMBean

In charge of waiting for starting or stopping notifications and notifies the appropriate listeners.

Version:
1.0
Author:
Takoua Abdellatif

Constructor Summary
Enroller(int listeningPort, String listeningIp)
           
 
Method Summary
 String getListeningIp()
           
 int getListeningPort()
          gets the port on which the Enroller is listening for a discovery request.
 int getTimeToLive()
          gets the time to live of the multicast socket.
 void postDeregister()
           
 void postRegister(Boolean arg0)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer mbeanServer, ObjectName on)
           
 void setListeningIp(String listeningIp)
          sets the IP address the listening manager uses.
 void setListeningPort(int listeningPort)
          sets the port on which the Enroller is listening.
 void setTimeToLive(int ttl)
          sets the time to live value to ttl.
 void start()
          starts the listening task on the listeningPort and listening Ip defined with the parameters.
 void stop()
          stops the listening task
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Enroller

public Enroller(int listeningPort,
                String listeningIp)
Method Detail

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()

getListeningPort

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

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

setListeningPort

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

Specified by:
setListeningPort in interface EnrollerMBean
Parameters:
listeningPort - port on which the Enroller is listening.

getListeningIp

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

setListeningIp

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

Specified by:
setListeningIp in interface EnrollerMBean

setTimeToLive

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

Specified by:
setTimeToLive in interface EnrollerMBean
Parameters:
ttl - time to live

getTimeToLive

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

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

start

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

Specified by:
start in interface EnrollerMBean

stop

public void stop()
Description copied from interface: EnrollerMBean
stops the listening task

Specified by:
stop in interface EnrollerMBean


Copyright © 2010 OW2 Consortium. All Rights Reserved.