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
The name of the MBean on which the listener should
be added. name, NotificationListener The listener object which will handle the
notifications emitted by the registered MBean. listener, NotificationFilter The filter object. If filter is null, no
filtering will be performed before handling notifications. filter, Object The context to be sent to the listener when a
notification is emitted. handback)Implements javax. Adds a listener to a registered MBean. |
public void | addNotificationListener(ObjectName
The name of the MBean on which the listener should
be added. name, ObjectName The object name of the listener which will
handle the notifications emitted by the registered MBean. listener, NotificationFilter The filter object. If filter is null, no
filtering will be performed before handling notifications. filter, Object The context to be sent to the listener when a
notification is emitted. handback)Implements javax. Adds a listener to a registered MBean. |
private static void | |
private static void | |
private static void | |
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
The class name of the MBean to be instantiated. className, ObjectName The object name of the MBean. May be null. name)Implements javax. Instantiates and registers an MBean in the MBean server. |
public ObjectInstance | createMBean(String
The class name of the MBean to be instantiated. className, ObjectName The object name of the MBean. May be null. name, ObjectName The object name of the class loader to be used. loaderName)Implements javax. Instantiates and registers an MBean in the MBean server. |
public ObjectInstance | createMBean(String
The class name of the MBean to be instantiated. className, ObjectName The object name of the MBean. May be null. name, Object[] An array containing the parameters of the
constructor to be invoked. params, String[] An array containing the signature of the
constructor to be invoked. signature)Implements javax. Instantiates and registers an MBean in the MBean server. |
public ObjectInstance | createMBean(String
The class name of the MBean to be instantiated. className, ObjectName The object name of the MBean. May be null. name, ObjectName The object name of the class loader to be used. loaderName, Object[] An array containing the parameters of the
constructor to be invoked. params, String[] An array containing the signature of the
constructor to be invoked. 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 | |
private Set | filterListOfObjectInstances(Set<ObjectInstance> list, QueryExp query)
Applies the specified queries to the set of ObjectInstances. |
public Object | getAttribute(ObjectName
The object name of the MBean from which the
attribute is to be retrieved. name, String A String specifying the name of the attribute
to be retrieved. attribute)Implements javax. Gets the value of a specific attribute of a named MBean. |
public AttributeList | getAttributes(ObjectName
The object name of the MBean from which the
attributes are retrieved. name, String[] A list of the attributes to be retrieved. 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
The name of the MBean to analyze 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
The object name of the MBean. name)Implements javax. Gets the |
private static Object | |
public Object | instantiate(String
The class name of the object to be instantiated. className)Implements com. This method should never be called. |
public Object | instantiate(String
The class name of the MBean to be instantiated. className, ObjectName The object name of the class loader to be used. loaderName)Implements com. This method should never be called. |
public Object | instantiate(String
The class name of the object to be instantiated. className, Object[] An array containing the parameters of the
constructor to be invoked. params, String[] An array containing the signature of the
constructor to be invoked. signature)Implements com. This method should never be called. |
public Object | instantiate(String
The class name of the object to be instantiated. className, ObjectName The object name of the class loader to be used. loaderName, Object[] An array containing the parameters of the
constructor to be invoked. params, String[] An array containing the signature of the
constructor to be invoked. signature)Implements com. This method should never be called. |
public Object | invoke(ObjectName
The object name of the MBean on which the method is
to be invoked. name, String The name of the operation to be invoked. operationName, Object[] An array containing the parameters to be set when
the operation is invoked params, String[] An array containing the signature of the
operation, an array of class names in the format returned by
signature)Class#getName() . The class objects will be loaded using the same
class loader as the one used for loading the MBean on which the
operation was invoked.Implements javax. Invokes an operation on an MBean. |
public boolean | isInstanceOf(ObjectName
The name, String ObjectName of the MBean.The name of the class. className)Implements javax. Returns true if the MBean specified is an instance of the specified class, false otherwise. |
public boolean | isRegistered(ObjectName
The object name of the MBean to be checked. 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
The object name pattern identifying the MBeans to
be retrieved. If null or no domain and key properties are
specified, all the MBeans registered will be retrieved. name, QueryExp The query expression to be applied for selecting
MBeans. If null no query expression will be applied for
selecting MBeans. query)Implements javax. Gets MBeans controlled by the MBean server. |
private Set | |
public Set | queryNames(ObjectName
The object name pattern identifying the MBean names
to be retrieved. If null or no domain and key properties are
specified, the name of all registered MBeans will be retrieved. name, QueryExp The query expression to be applied for selecting
MBeans. If null no query expression will be applied for
selecting MBeans. query)Implements javax. Gets the names of MBeans controlled by the MBean server. |
private Set | |
private ObjectInstance | |
public ObjectInstance | registerMBean(Object
The MBean to be registered as an MBean. object, ObjectName The object name of the MBean. May be null. 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
The name of the MBean on which the listener should
be removed. name, NotificationListener The listener to be removed. listener)Implements javax. Removes a listener from a registered MBean. |
public void | removeNotificationListener(ObjectName
The name of the MBean on which the listener should
be removed. name, NotificationListener The listener to be removed. listener, NotificationFilter The filter that was specified when the listener
was added. filter, Object The handback that was specified when the
listener was added. handback)Implements javax. Removes a listener from a registered MBean. |
public void | removeNotificationListener(ObjectName
The name of the MBean on which the listener should
be removed. name, ObjectName The object name of the listener to be removed. listener)Implements javax. Removes a listener from a registered MBean. |
public void | removeNotificationListener(ObjectName
The name of the MBean on which the listener should
be removed. name, ObjectName The object name of the listener to be removed. listener, NotificationFilter The filter that was specified when the listener
was added. filter, Object The handback that was specified when the
listener was added. 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
The name of the MBean within which the attribute is
to be set. name, Attribute The identification of the attribute to be set
and the value it is to be set to. attribute)Implements javax. Sets the value of a specific attribute of a named MBean. |
public AttributeList | setAttributes(ObjectName
The object name of the MBean within which the
attributes are to be set. name, AttributeList A list of attributes: The identification of
the attributes to be set and the values they are to be set to. 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
The object name of the MBean to be unregistered. name)Implements javax. Unregisters an MBean from the MBean server. |