public class MBeanServerLocator
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static MBeanServerLocator |
getInstance()
Returns a singleton instance of the MBeanServerLocator class.
|
javax.management.MBeanServer |
getMBeanServer()
Returns the
MBeanServer wrapped by this MBeanServerLocator instance. |
boolean |
isRegistered(javax.management.ObjectName name)
Returns true if a MBean is registered under the supplied name.
|
void |
register(java.lang.Object mbean,
javax.management.ObjectName name)
Register the mbean object with the supplied name.
|
void |
register(java.lang.Object mbean,
javax.management.ObjectName name,
boolean replace)
Register the mbean object with the supplied name.
|
void |
unregister(javax.management.ObjectName name)
Unregister any mbean registered under the supplied name.
|
public static MBeanServerLocator getInstance()
MBeanServer.public javax.management.MBeanServer getMBeanServer()
MBeanServer wrapped by this MBeanServerLocator instance.MBeanServer.public void register(java.lang.Object mbean,
javax.management.ObjectName name)
throws javax.management.MBeanRegistrationException,
javax.management.InstanceNotFoundException,
javax.management.InstanceAlreadyExistsException,
javax.management.NotCompliantMBeanException
register(Object, ObjectName, boolean) with its
last parameter set to false.mbean - the mbean to register.name - the name used for registration.javax.management.MBeanRegistrationException - rethrown from the wrapped MBeanServerjavax.management.InstanceNotFoundException - rethrown from the wrapped MBeanServerjavax.management.InstanceAlreadyExistsException - rethrown from the wrapped MBeanServerjavax.management.NotCompliantMBeanException - rethrown from the wrapped MBeanServerpublic void register(java.lang.Object mbean,
javax.management.ObjectName name,
boolean replace)
throws javax.management.MBeanRegistrationException,
javax.management.InstanceNotFoundException,
javax.management.InstanceAlreadyExistsException,
javax.management.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.javax.management.MBeanRegistrationException - rethrown from the wrapped MBeanServerjavax.management.InstanceNotFoundException - rethrown from the wrapped MBeanServerjavax.management.InstanceAlreadyExistsException - rethrown from the wrapped MBeanServerjavax.management.NotCompliantMBeanException - rethrown from the wrapped MBeanServerpublic boolean isRegistered(javax.management.ObjectName name)
name - the name to test for registration.public void unregister(javax.management.ObjectName name)
throws javax.management.InstanceNotFoundException,
javax.management.MBeanRegistrationException
name - the name of mbean to unregister.javax.management.InstanceNotFoundException - rethrown from the wrapped MBeanServerjavax.management.MBeanRegistrationException - rethrown from the wrapped MBeanServer