MBeanServer (Java SE 20 & JDK 20) (original) (raw)

All Superinterfaces:

[MBeanServerConnection](MBeanServerConnection.html "interface in javax.management")

All Known Subinterfaces:

[MBeanServerForwarder](remote/MBeanServerForwarder.html "interface in javax.management.remote")


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 MBeanServerFactory 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 theObjectName of the MBeanServerDelegate. ThisObjectName is:
JMImplementation:type=MBeanServerDelegate.

An object obtained from the createMBeanServer ornewMBeanServer methods of the MBeanServerFactory class applies security checks to its methods, as follows.

First, if there is no security manager (System.getSecurityManager() is null), then an implementation of this interface is free not to make any checks.

Assuming that there is a security manager, or that the implementation chooses to make checks anyway, the checks are made as detailed below. In what follows, and unless otherwise specified,className is the string returned by MBeanInfo.getClassName() for the target MBean.

If a security check fails, the method throws SecurityException.

For methods that can throw InstanceNotFoundException, this exception is thrown for a non-existent MBean, regardless of permissions. This is because a non-existent MBean has noclassName.

Since:

1.5

void
Adds a listener to a registered MBean.
void
Adds a listener to a registered MBean.
Instantiates and registers an MBean in the MBean server.
Instantiates and registers an MBean in the MBean server.
Instantiates and registers an MBean in the MBean server.
Instantiates and registers an MBean in the MBean server.
[deserialize](#deserialize%28java.lang.String,byte%5B%5D%29)([String](../../../java.base/java/lang/String.html "class in java.lang") className, byte[] data)
Gets the value of a specific attribute of a named MBean.
Retrieves the values of several attributes of a named MBean.
Return the ClassLoader that was used for loading the class of the named MBean.
Return the ClassLoaderRepository for this MBeanServer.
Returns the default domain used for naming the MBean.
Returns the list of domains in which any MBean is currently registered.
Returns the number of MBeans registered in the MBean server.
This method discovers the attributes and operations that an MBean exposes for management.
Gets the ObjectInstance for a given MBean registered with the MBean server.
Instantiates an object using the list of all class loaders registered in the MBean server's Class Loader Repository.
Instantiates an object using the class Loader specified by itsObjectName.
Invokes an operation on an MBean.
boolean
Returns true if the MBean specified is an instance of the specified class, false otherwise.
boolean
Checks whether an MBean, identified by its object name, is already registered with the MBean server.
Gets MBeans controlled by the MBean server.
Gets the names of MBeans controlled by the MBean server.
Registers a pre-existing object as an MBean with the MBean server.
void
Removes a listener from a registered MBean.
void
Removes a listener from a registered MBean.
void
Removes a listener from a registered MBean.
void
Removes a listener from a registered MBean.
void
Sets the value of a specific attribute of a named MBean.
Sets the values of several attributes of a named MBean.
void
Unregisters an MBean from the MBean server.