public class NamingService extends java.lang.Object implements NamingServiceMBean
Calling start() will launch rmiregistry in the same JVM; this way
rmiregistry will have in its classpath the same classes the JVM has.
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getPort()
Returns the port on which rmiregistry listens for incoming connections
|
boolean |
isRunning()
Returns whether this MBean has been started and not yet stopped.
|
java.lang.String[] |
list()
Returns an array of the names bound in the rmiregistry
|
void |
setPort(int port)
Sets the port on which rmiregistry listens for incoming connections.
|
void |
start()
Starts this MBean: rmiregistry can now accept incoming calls
|
void |
stop()
Stops this MBean: rmiregistry cannot accept anymore incoming calls
|
void |
unbind(java.lang.String name)
Removes the binding for the specified
name in the rmiregistry |
public NamingService()
public NamingService(int port)
public void setPort(int port)
NamingServiceMBeanrunning.setPort in interface NamingServiceMBeanNamingServiceMBean.getPort()public int getPort()
NamingServiceMBeangetPort in interface NamingServiceMBeanNamingServiceMBean.setPort(int)public boolean isRunning()
NamingServiceMBeanisRunning in interface NamingServiceMBeanNamingServiceMBean.start()public void start()
throws java.rmi.RemoteException
NamingServiceMBeanstart in interface NamingServiceMBeanjava.rmi.RemoteExceptionNamingServiceMBean.stop(),
NamingServiceMBean.isRunning()public void stop()
throws java.rmi.NoSuchObjectException
NamingServiceMBeanstop in interface NamingServiceMBeanjava.rmi.NoSuchObjectExceptionNamingServiceMBean.start()public java.lang.String[] list()
throws java.rmi.RemoteException
NamingServiceMBeanlist in interface NamingServiceMBeanjava.rmi.RemoteExceptionRegistry.list()public void unbind(java.lang.String name)
throws java.rmi.RemoteException,
java.rmi.NotBoundException
NamingServiceMBeanname in the rmiregistryunbind in interface NamingServiceMBeanjava.rmi.RemoteExceptionjava.rmi.NotBoundExceptionRegistry.unbind(String)