org.apache.hivemind.management.mbeans
Class NamingService

java.lang.Object
  extended by org.apache.hivemind.management.mbeans.NamingService
All Implemented Interfaces:
javax.management.MBeanRegistration, NamingServiceMBean

public class NamingService
extends java.lang.Object
implements NamingServiceMBean, javax.management.MBeanRegistration

MBean that starts an rmiregistry.

Calling start() will launch rmiregistry in the same JVM; this way rmiregistry will have in its classpath the same classes the JVM has.

Since:
1.1
Author:
Achim Huegen

Constructor Summary
NamingService()
          Creates a new instance of NamingService with the default rmiregistry port (1099).
NamingService(int port)
          Creates a new instance of NamingService with the specified port.
 
Method Summary
 int getPort()
           
 boolean isRunning()
           
 void postDeregister()
           
 void postRegister(java.lang.Boolean arg0)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 void setPort(int port)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamingService

public NamingService()
Creates a new instance of NamingService with the default rmiregistry port (1099).


NamingService

public NamingService(int port)
Creates a new instance of NamingService with the specified port.

Method Detail

setPort

public void setPort(int port)
Specified by:
setPort in interface NamingServiceMBean

getPort

public int getPort()
Specified by:
getPort in interface NamingServiceMBean

isRunning

public boolean isRunning()
Specified by:
isRunning in interface NamingServiceMBean

start

public void start()
           throws java.rmi.RemoteException
Specified by:
start in interface NamingServiceMBean
Throws:
java.rmi.RemoteException

stop

public void stop()
          throws java.rmi.NoSuchObjectException
Specified by:
stop in interface NamingServiceMBean
Throws:
java.rmi.NoSuchObjectException

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws java.lang.Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception
See Also:
MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName)

postRegister

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

preDeregister

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

postDeregister

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