Every MBean which is added to the MBean server becomes manageable: its attributes and operations become remotely accessible through the connectors/adaptors connected to that MBean server. A Java object cannot be registered in the MBean server unless it is a JMX compliant MBean.
When an MBean is registered or unregistered in the MBean server an
MBeanServerNotification
Notification is emitted. To register an object as listener to MBeanServerNotifications
you should call the MBean server method addNotificationListener with ObjectName
the ObjectName of the MBeanServerDelegate.
This ObjectName is:
JMImplementation:type=MBeanServerDelegate.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static interface | DefaultMBeanServerInterceptor.
A RegistrationContext that makes it possible to perform additional post registration actions (or post unregistration actions) outside of the repository lock, once postRegister (or postDeregister) has been called. |
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private final transient MBeanServerDelegate | delegate
The MBean server delegate object that is associated to the DefaultMBeanServerInterceptor |
| private final String | domain
The default domain of the object names |
| private final transient MBeanInstantiator | instantiator
The MBeanInstantiator object used by the DefaultMBeanServerInterceptor |
| private final transient WeakHashMap | listenerWrappers
Wrappers for client listeners. |
| private final transient Repository | repository
The Repository object used by the DefaultMBeanServerInterceptor |
| private transient MBeanServer | server
The MBean server object that is associated to the DefaultMBeanServerInterceptor |
| Access | Constructor and Description |
|---|---|
| public | DefaultMBeanServerInterceptor(MBeanServer
A pointer to the MBeanServer object that must be
passed to the MBeans when invoking their
outer, MBeanServerDelegate javax. interface.A pointer to the MBeanServerDelegate associated
with the new MBeanServer. The new MBeanServer must register
this MBean in its MBean repository. delegate, MBeanInstantiator The MBeanInstantiator that will be used to
instantiate MBeans and take care of class loading issues. instantiator, Repository The repository to use for this MBeanServer. repository)Creates a DefaultMBeanServerInterceptor with the specified repository instance. |
| Modifier and Type | Method and Description |
|---|---|
| private void | addClassLoader(ClassLoader
The ClassLoader. loader, final ObjectName The ClassLoader MBean ObjectName. logicalName)Registers a ClassLoader with the CLR. |
| public void | addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
Implements javax. Adds a listener to a registered MBean. |
| public void | addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
Implements javax. Adds a listener to a registered MBean. |
| private DefaultMBeanServerInterceptor. | Returns: a ResourceContext that takes in charge the addition or removal of the loader to or from the CLR.The ClassLoader MBean being registered or
unregistered. loader, final ObjectName The name of the ClassLoader MBean. logicalName)Creates a ResourceContext for a ClassLoader MBean. |
| public ObjectInstance | createMBean(String className, ObjectName name)
Implements javax. Instantiates and registers an MBean in the MBean server. |
| public ObjectInstance | createMBean(String className, ObjectName name, ObjectName loaderName)
Implements javax. Instantiates and registers an MBean in the MBean server. |
| public ObjectInstance | createMBean(String className, ObjectName name, Object[] params, String[] signature)
Implements javax. Instantiates and registers an MBean in the MBean server. |
| public ObjectInstance | createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature)
Implements javax. Instantiates and registers an MBean in the MBean server. |
| private ObjectInstance | createMBean(String className, ObjectName name, ObjectName loaderName, boolean withDefaultLoaderRepository, Object[] params, String[] signature)
|
| private void | |
| public Object | getAttribute(ObjectName name, String attribute)
Implements javax. Gets the value of a specific attribute of a named MBean. |
| public AttributeList | getAttributes(ObjectName name, String[] attributes)
Implements javax. Retrieves the values of several attributes of a named MBean. |
| public ClassLoader | Returns: The named ClassLoader.The ObjectName of the ClassLoader. loaderName)Implements javax. Return the named |
| public ClassLoader | Returns: The ClassLoader used for that MBean.The ObjectName of the MBean. mbeanName)Implements javax. Return the |
| public ClassLoaderRepository | getClassLoaderRepository()
Implements com. This method should never be called. |
| private static String | |
| public String | getDefaultDomain()
Implements javax. Returns the default domain used for naming the MBean. |
| public String[] | getDomains()
Implements javax. Returns the list of domains in which any MBean is currently registered. |
| private ModifiableClassLoaderRepository | |
| private NotificationListener | |
| private NotificationListener | |
| private DynamicMBean | |
| public Integer | getMBeanCount()
Implements javax. Returns the number of MBeans registered in the MBean server. |
| public MBeanInfo | getMBeanInfo(ObjectName name)
Implements javax. This method discovers the attributes and operations that an MBean exposes for management. |
| private static String | |
| private static <T extends NotificationBroadcaster> T | |
| public ObjectInstance | getObjectInstance(ObjectName name)
Implements javax. Gets the |
| private static Object | |
| public Object | instantiate(String className)
Implements com. This method should never be called. |
| public Object | instantiate(String className, ObjectName loaderName)
Implements com. This method should never be called. |
| public Object | instantiate(String className, Object[] params, String[] signature)
Implements com. This method should never be called. |
| public Object | instantiate(String className, ObjectName loaderName, Object[] params, String[] signature)
Implements com. This method should never be called. |
| public Object | invoke(ObjectName name, String operationName, Object[] params, String[] signature)
Implements javax. Invokes an operation on an MBean. |
| public boolean | isInstanceOf(ObjectName name, String className)
Implements javax. Returns true if the MBean specified is an instance of the specified class, false otherwise. |
| public boolean | isRegistered(ObjectName name)
Implements javax. Checks whether an MBean, identified by its object name, is already registered with the MBean server. |
| private DefaultMBeanServerInterceptor. | makeResourceContextFor(Object
The resource being registered or unregistered. resource, ObjectName The name of the associated MBean. logicalName)Creates a ResourceContext for the given resource. |
| private ObjectName | |
| private Set | objectInstancesFromFilteredNamedObjects(Set<NamedObject> list, QueryExp query)
Applies the specified queries to the set of NamedObjects. |
| private Set | objectNamesFromFilteredNamedObjects(Set<NamedObject> list, QueryExp query)
Applies the specified queries to the set of NamedObjects. |
| private static void | |
| private static void | postRegister(ObjectName logicalName, DynamicMBean mbean, boolean registrationDone, boolean registerFailed)
|
| private static void | |
| private static ObjectName | |
| public Set | queryMBeans(ObjectName name, QueryExp query)
Implements javax. Gets MBeans controlled by the MBean server. |
| private Set | |
| public Set | queryNames(ObjectName name, QueryExp query)
Implements javax. Gets the names of MBeans controlled by the MBean server. |
| private Set | |
| private ObjectInstance | |
| public ObjectInstance | registerMBean(Object object, ObjectName name)
Implements javax. Registers a pre-existing object as an MBean with the MBean server. |
| private ObjectInstance | Returns: the actual ObjectName with which the object was registered.A reference to a MBean compliant object. object, ObjectName The ObjectName of the name)object MBean.Register |
| private DefaultMBeanServerInterceptor. | Returns: a ResourceContext for special resources such as ClassLoaders or JMXNamespaces.Adds a MBean in the repository, sends MBeanServerNotification.REGISTRATION_NOTIFICATION, returns ResourceContext for special resources such as ClassLoaders or JMXNamespaces. |
| private void | removeClassLoader(ClassLoader
The ClassLoader. loader, final ObjectName The ClassLoader MBean ObjectName. logicalName)Unregisters a ClassLoader from the CLR. |
| public void | removeNotificationListener(ObjectName name, NotificationListener listener)
Implements javax. Removes a listener from a registered MBean. |
| public void | removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
Implements javax. Removes a listener from a registered MBean. |
| public void | removeNotificationListener(ObjectName name, ObjectName listener)
Implements javax. Removes a listener from a registered MBean. |
| public void | removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
Implements javax. Removes a listener from a registered MBean. |
| private void | removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback, boolean removeAll)
|
| private static void | |
| private static void | |
| private static String | |
| private void | sendNotification(String NotifType, ObjectName name)
Sends an MBeanServerNotifications with the specified type for the MBean with the specified ObjectName |
| public void | setAttribute(ObjectName name, Attribute attribute)
Implements javax. Sets the value of a specific attribute of a named MBean. |
| public AttributeList | setAttributes(ObjectName name, AttributeList attributes)
Implements javax. Sets the values of several attributes of a named MBean. |
| private static void | |
| private DefaultMBeanServerInterceptor. | Returns: a ResourceContext for special resources such as ClassLoaders or JMXNamespaces.Removes a MBean in the repository, sends MBeanServerNotification.UNREGISTRATION_NOTIFICATION, returns ResourceContext for special resources such as ClassLoaders or JMXNamespaces, or null. |
| public void | unregisterMBean(ObjectName name)
Implements javax. Unregisters an MBean from the MBean server. |