This is the interface for MBean manipulation on the agent side. It contains the methods necessary for the creation, registration, and deletion of MBeans as well as the access methods for registered MBeans. This is the core component of the JMX infrastructure.
User code does not usually implement this interface. Instead,
an object that implements this interface is obtained with one of
the methods in the javax. class.
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 a 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.
Methods of MBeanServer and its subclasses may throw
SecurityException if the implementation doesn't authorize
access to the underlying resource.
| Modifier and Type | Method and Description |
|---|---|
| public void | addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
Redeclares javax. Adds a listener to a registered MBean. |
| public void | addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
Redeclares javax. Adds a listener to a registered MBean. |
| public ObjectInstance | createMBean(String className, ObjectName name)
Redeclares javax. Instantiates and registers an MBean in the MBean server. |
| public ObjectInstance | createMBean(String className, ObjectName name, ObjectName loaderName)
Redeclares javax. Instantiates and registers an MBean in the MBean server. |
| public ObjectInstance | createMBean(String className, ObjectName name, Object[] params, String[] signature)
Redeclares javax. Instantiates and registers an MBean in the MBean server. |
| public ObjectInstance | createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature)
Redeclares javax. Instantiates and registers an MBean in the MBean server. |
| public default ObjectInputStream | Returns: The de-serialized object stream.The name of the MBean whose class loader should be
used for the de-serialization. name, byte[] The byte array to be de-sererialized. data)
Deprecated
since 1.5. Use
getClassLoaderFor to
obtain the appropriate class loader for deserialization.
De-serializes a byte array in the context of the class loader of an MBean. |
| public default ObjectInputStream | Returns: The de-serialized object stream.The name of the class whose class loader should be
used for the de-serialization. className, byte[] The byte array to be de-sererialized. data)
Deprecated
since 1.5. Use
getClassLoaderRepository to obtain the
class loader repository and use it to deserialize.
De-serializes a byte array in the context of a given MBean class loader. |
| public default ObjectInputStream | Returns: The de-serialized object stream.The name of the class whose class loader should be
used for the de-serialization. className, ObjectName The name of the class loader to be used for
loading the specified class. If null, the MBean Server's class
loader will be used. loaderName, byte[] The byte array to be de-sererialized. data)
Deprecated
since 1.5. Use
getClassLoader to obtain
the class loader for deserialization.
De-serializes a byte array in the context of a given MBean class loader. |
| public Object | getAttribute(ObjectName name, String attribute)
Redeclares javax. Gets the value of a specific attribute of a named MBean. |
| public AttributeList | getAttributes(ObjectName name, String[] attributes)
Redeclares javax. Retrieves the values of several attributes of a named MBean. |
| public ClassLoader | Returns: The named ClassLoader. If l is the actual ClassLoader with that name, and r is the returned value, then either:
The ObjectName of the ClassLoader. May be
null, in which case the MBean server's own ClassLoader is
returned. loaderName)Return the named |
| public ClassLoader | Returns: The ClassLoader used for that MBean. If l is the MBean's actual ClassLoader, and r is the returned value, then either:
The ObjectName of the MBean. mbeanName)Return the |
| public ClassLoaderRepository | Returns: The ClassLoaderRepository for this MBeanServer.Return the ClassLoaderRepository for this MBeanServer. |
| public String | getDefaultDomain()
Redeclares javax. Returns the default domain used for naming the MBean. |
| public String[] | getDomains()
Redeclares javax. Returns the list of domains in which any MBean is currently registered. |
| public Integer | Returns: the number of registered MBeans, wrapped in an Integer. If the caller's permissions are restricted, this number may be greater than the number of MBeans the caller can access.Redeclares javax. Returns the number of MBeans registered in the MBean server. |
| public MBeanInfo | getMBeanInfo(ObjectName name)
Redeclares javax. This method discovers the attributes and operations that an MBean exposes for management. |
| public ObjectInstance | getObjectInstance(ObjectName name)
Redeclares javax. Gets the |
| public Object | Returns: The newly instantiated object.The class name of the object to be instantiated. className)Instantiates an object using the list of all class loaders
registered in the MBean server's |
| public Object | Returns: The newly instantiated object.The class name of the MBean to be instantiated. className, ObjectName The object name of the class loader to be used. loaderName)Instantiates an object using the class Loader specified by its
|
| public Object | Returns: The newly instantiated object.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)Instantiates an object using the list of all class loaders
registered in the MBean server |
| public Object | Returns: The newly instantiated object.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)Instantiates an object. |
| public Object | invoke(ObjectName name, String operationName, Object[] params, String[] signature)
Redeclares javax. Invokes an operation on an MBean. |
| public boolean | isInstanceOf(ObjectName name, String className)
Redeclares javax. Returns true if the MBean specified is an instance of the specified class, false otherwise. |
| public boolean | isRegistered(ObjectName name)
Redeclares javax. Checks whether an MBean, identified by its object name, is already registered with the MBean server. |
| public Set | queryMBeans(ObjectName name, QueryExp query)
Redeclares javax. Gets MBeans controlled by the MBean server. |
| public Set | queryNames(ObjectName name, QueryExp query)
Redeclares javax. Gets the names of MBeans controlled by the MBean server. |
| public ObjectInstance | Returns: AnObjectInstance, containing the
ObjectName and the Java class name of the newly
registered MBean. If the contained ObjectName
is n, the contained Java class name is
.The MBean to be registered as an MBean. object, ObjectName The object name of the MBean. May be null. name)Registers a pre-existing object as an MBean with the MBean server. |
| public void | removeNotificationListener(ObjectName name, ObjectName listener)
Redeclares javax. Removes a listener from a registered MBean. |
| public void | removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)
Redeclares javax. Removes a listener from a registered MBean. |
| public void | removeNotificationListener(ObjectName name, NotificationListener listener)
Redeclares javax. Removes a listener from a registered MBean. |
| public void | removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
Redeclares javax. Removes a listener from a registered MBean. |
| public void | setAttribute(ObjectName name, Attribute attribute)
Redeclares javax. Sets the value of a specific attribute of a named MBean. |
| public AttributeList | setAttributes(ObjectName name, AttributeList attributes)
Redeclares javax. Sets the values of several attributes of a named MBean. |
| public void | unregisterMBean(ObjectName name)
Redeclares javax. Unregisters an MBean from the MBean server. |