public class MBeanServerLocator extends Object
| Modifier and Type | Method and Description |
|---|---|
static MBeanServerLocator |
getInstance()
Returns a singleton instance of the MBeanServerLocator class.
|
MBeanServer |
getMBeanServer()
Returns the
MBeanServer wrapped by this MBeanServerLocator instance. |
boolean |
isRegistered(ObjectName name)
Returns true if a MBean is registered under the supplied name.
|
void |
register(Object mbean,
ObjectName name)
Register the mbean object with the supplied name.
|
void |
register(Object mbean,
ObjectName name,
boolean replace)
Register the mbean object with the supplied name.
|
void |
unregister(ObjectName name)
Unregister any mbean registered under the supplied name.
|
public static MBeanServerLocator getInstance()
MBeanServer.public MBeanServer getMBeanServer()
MBeanServer wrapped by this MBeanServerLocator instance.MBeanServer.public void register(Object mbean, ObjectName name) throws MBeanRegistrationException, InstanceNotFoundException, InstanceAlreadyExistsException, NotCompliantMBeanException
register(Object, ObjectName, boolean) with its
last parameter set to false.mbean - the mbean to register.name - the name used for registration.MBeanRegistrationException - rethrown from the wrapped MBeanServerInstanceNotFoundException - rethrown from the wrapped MBeanServerInstanceAlreadyExistsException - rethrown from the wrapped MBeanServerNotCompliantMBeanException - rethrown from the wrapped MBeanServerpublic void register(Object mbean, ObjectName name, boolean replace) throws MBeanRegistrationException, InstanceNotFoundException, InstanceAlreadyExistsException, NotCompliantMBeanException
mbean - the mbean to register.name - the name used for registration.replace - if true, a mbean registered under the same name will be first
unregistered.MBeanRegistrationException - rethrown from the wrapped MBeanServerInstanceNotFoundException - rethrown from the wrapped MBeanServerInstanceAlreadyExistsException - rethrown from the wrapped MBeanServerNotCompliantMBeanException - rethrown from the wrapped MBeanServerpublic boolean isRegistered(ObjectName name)
name - the name to test for registration.public void unregister(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException
name - the name of mbean to unregister.InstanceNotFoundException - rethrown from the wrapped MBeanServerMBeanRegistrationException - rethrown from the wrapped MBeanServer