APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.jmx.mbeanserver

public final Class JmxMBeanServer

extends Object
implements SunJmxMBeanServer
Class Inheritance
All Implemented Interfaces
com.sun.jmx.mbeanserver.SunJmxMBeanServer, javax.management.MBeanServer, javax.management.MBeanServerConnection
Imports
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor, .MBeanServerInterceptor, java.io.ObjectInputStream, java.util.List, .Set, java.lang.System.Logger.Level, javax.management.Attribute, .AttributeList, .AttributeNotFoundException, .InstanceAlreadyExistsException, .InstanceNotFoundException, .IntrospectionException, .InvalidAttributeValueException, .ListenerNotFoundException, .MBeanException, .MBeanInfo, .MBeanRegistrationException, .MBeanServer, .MBeanServerDelegate, .NotCompliantMBeanException, .NotificationFilter, .NotificationListener, .ObjectInstance, .ObjectName, .OperationsException, .QueryExp, .ReflectionException, .RuntimeOperationsException, javax.management.loading.ClassLoaderRepository

This is the base class 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.

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 the ObjectName of the MBeanServerDelegate. This ObjectName is:
JMImplementation:type=MBeanServerDelegate.

Since
1.5

Field Summary

Modifier and TypeField and Description
public static final boolean
DEFAULT_FAIR_LOCK_POLICY

Control the default locking policy of the repository.

private final MBeanInstantiator
private final boolean
interceptorsEnabled

true if interceptors are enabled

private final MBeanServerDelegate
mBeanServerDelegateObject

The MBeanServerDelegate object representing the MBean Server

private volatile MBeanServer
private final MBeanServer
private final SecureClassLoaderRepository

Constructor Summary

AccessConstructor and Description
pack-priv
JmxMBeanServer(String
The default domain name used by this MBeanServer.
domain
,
MBeanServer
A pointer to the MBeanServer object that must be passed to the MBeans when invoking their javax.management.MBeanRegistration interface.
outer
,
MBeanServerDelegate
A pointer to the MBeanServerDelegate associated with the new MBeanServer. The new MBeanServer must register this MBean in its MBean repository.
delegate
)

Package: Creates an MBeanServer with the specified default domain name, outer interface, and delegate.

pack-priv
JmxMBeanServer(String
The default domain name used by this MBeanServer.
domain
,
MBeanServer
A pointer to the MBeanServer object that must be passed to the MBeans when invoking their javax.management.MBeanRegistration interface.
outer
,
MBeanServerDelegate
A pointer to the MBeanServerDelegate associated with the new MBeanServer. The new MBeanServer must register this MBean in its MBean repository.
delegate
,
boolean
If true, MBeanServerInterceptor will be enabled (default is false) Note: this parameter is not taken into account by this implementation - the default value false is always used.
interceptors
)

Package: Creates an MBeanServer with the specified default domain name, outer interface, and delegate.

pack-priv
JmxMBeanServer(String
The default domain name used by this MBeanServer.
domain
,
MBeanServer
A pointer to the MBeanServer object that must be passed to the MBeans when invoking their javax.management.MBeanRegistration interface.
outer
,
MBeanServerDelegate
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
,
boolean
If true, MBeanServerInterceptor will be enabled (default is false).
interceptors
)

Package: Creates an MBeanServer.

pack-priv
JmxMBeanServer(String
The default domain name used by this MBeanServer.
domain
,
MBeanServer
A pointer to the MBeanServer object that must be passed to the MBeans when invoking their javax.management.MBeanRegistration interface.
outer
,
MBeanServerDelegate
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
,
boolean
If true, MBeanServerInterceptor will be enabled (default is false).
interceptors
,
boolean
If true, the MBean repository will use a fair locking policy.
fairLock
)

Package: Creates an MBeanServer.

Method Summary

Modifier and TypeMethod and Description
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.management.MBeanServer.addNotificationListener.

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.management.MBeanServer.addNotificationListener.

Adds a listener to a registered MBean.

private Attribute
cloneAttribute(Attribute attribute)

Clone attribute.

private AttributeList
cloneAttributeList(AttributeList list)

Clone attribute list.

private ObjectName
cloneObjectName(ObjectName name)

Clone object name.

public ObjectInstance

Returns:

An ObjectInstance, containing the ObjectName and the Java class name of the newly instantiated MBean.
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.management.MBeanServer.createMBean.

Instantiates and registers an MBean in the MBean server.

public ObjectInstance

Returns:

An ObjectInstance, containing the ObjectName and the Java class name of the newly instantiated MBean.
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.management.MBeanServer.createMBean.

Instantiates and registers an MBean in the MBean server.

public ObjectInstance

Returns:

An ObjectInstance, containing the ObjectName and the Java class name of the newly instantiated MBean.
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.management.MBeanServer.createMBean.

Instantiates and registers an MBean in the MBean server.

public ObjectInstance

Returns:

An ObjectInstance, containing the ObjectName and the Java class name of the newly instantiated MBean.
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.management.MBeanServer.createMBean.

Instantiates and registers an MBean in the MBean server.

public ObjectInputStream

Returns:

The de-serialized object stream.
deserialize
(ObjectName
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
)

Overrides default javax.management.MBeanServer.deserialize.

Deprecated

De-serializes a byte array in the context of the class loader of an MBean.

public ObjectInputStream

Returns:

The de-serialized object stream.
deserialize
(String
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
)

Overrides default javax.management.MBeanServer.deserialize.

Deprecated

De-serializes a byte array in the context of a given MBean class loader.

public ObjectInputStream

Returns:

The de-serialized object stream.
deserialize
(String
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
)

Overrides default javax.management.MBeanServer.deserialize.

Deprecated

De-serializes a byte array in the context of a given MBean class loader.

public Object

Returns:

The value of the retrieved attribute.
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.management.MBeanServer.getAttribute.

Gets the value of a specific attribute of a named MBean.

public AttributeList

Returns:

The list of the retrieved attributes.
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.management.MBeanServer.getAttributes.

Enables the values of several attributes of a named MBean.

public ClassLoader

Returns:

The named ClassLoader.
getClassLoader
(ObjectName
The ObjectName of the ClassLoader.
loaderName
)

Implements javax.management.MBeanServer.getClassLoader.

Return the named java.lang.ClassLoader.

public ClassLoader

Returns:

The ClassLoader used for that MBean.
getClassLoaderFor
(ObjectName
The ObjectName of the MBean.
mbeanName
)

Implements javax.management.MBeanServer.getClassLoaderFor.

Return the java.lang.ClassLoader that was used for loading the class of the named MBean.

public ClassLoaderRepository

Returns:

The ClassLoaderRepository for that MBeanServer.
getClassLoaderRepository
()

Implements javax.management.MBeanServer.getClassLoaderRepository.

Return the ClassLoaderRepository for that MBeanServer.

public String
getDefaultDomain()

Implements javax.management.MBeanServer.getDefaultDomain.

Returns the default domain used for naming the MBean.

public String[]
getDomains()

Implements javax.management.MBeanServer.getDomains.

Returns the list of domains in which any MBean is currently registered.

public Integer
getMBeanCount()

Implements javax.management.MBeanServer.getMBeanCount.

Returns the number of MBeans registered in the MBean server.

public MBeanInfo

Returns:

An instance of MBeanInfo allowing the retrieval of all attributes and operations of this MBean.
getMBeanInfo
(ObjectName
The name of the MBean to analyze
name
)

Implements javax.management.MBeanServer.getMBeanInfo.

This method discovers the attributes and operations that an MBean exposes for management.

public MBeanInstantiator
getMBeanInstantiator()

Implements com.sun.jmx.mbeanserver.SunJmxMBeanServer.getMBeanInstantiator.

Return the MBeanInstantiator associated to this MBeanServer.

public MBeanServerDelegate
getMBeanServerDelegate()

Implements com.sun.jmx.mbeanserver.SunJmxMBeanServer.getMBeanServerDelegate.

Return the MBeanServerDelegate representing the MBeanServer.

public synchronized MBeanServer
public ObjectInstance

Returns:

The ObjectInstance associated to the MBean specified by name.
getObjectInstance
(ObjectName
The object name of the MBean.
name
)

Implements javax.management.MBeanServer.getObjectInstance.

Gets the ObjectInstance for a given MBean registered with the MBean server.

private void
initialize()

Initializes this MBeanServer, registering the MBeanServerDelegate.

public Object

Returns:

The newly instantiated object.
instantiate
(String
The class name of the object to be instantiated.
className
)

Implements javax.management.MBeanServer.instantiate.

Instantiates an object using the list of all class loaders registered in the MBean server (using its Default Loader Repository).

public Object

Returns:

The newly instantiated 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 javax.management.MBeanServer.instantiate.

Instantiates an object using the class Loader specified by its ObjectName.

public Object

Returns:

The newly instantiated 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 javax.management.MBeanServer.instantiate.

Instantiates an object using the list of all class loaders registered in the MBean server (using its Default Loader Repository).

public Object

Returns:

The newly instantiated 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 javax.management.MBeanServer.instantiate.

Instantiates an object.

public boolean

Returns:

true if MBeanServerInterceptors are enabled.
interceptorsEnabled
()

Implements com.sun.jmx.mbeanserver.SunJmxMBeanServer.interceptorsEnabled.

Tell whether MBeanServerInterceptors are enabled on this object.

public Object

Returns:

The object returned by the operation, which represents the result ofinvoking the operation on the MBean specified.
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. 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.
signature
)

Implements javax.management.MBeanServer.invoke.

Invokes an operation on an MBean.

public boolean

Returns:

true if the MBean specified is an instance of the specified class, false otherwise.
isInstanceOf
(ObjectName
The ObjectName of the MBean.
name
,
String
The name of the class.
className
)

Implements javax.management.MBeanServer.isInstanceOf.

Returns true if the MBean specified is an instance of the specified class, false otherwise.

public boolean

Returns:

True if the MBean is already registered in the MBean server, false otherwise.
isRegistered
(ObjectName
The object name of the MBean to be checked.
name
)

Implements javax.management.MBeanServer.isRegistered.

Checks whether an MBean, identified by its object name, is already registered with the MBean server.

public static MBeanServer

Returns:

A new private implementation of an MBeanServer.
newMBeanServer
(String
Default domain of the new MBeanServer.
defaultDomain
,
MBeanServer
A pointer to the MBeanServer object that must be passed to the MBeans when invoking their javax.management.MBeanRegistration interface.
outer
,
MBeanServerDelegate
A pointer to the MBeanServerDelegate associated with the new MBeanServer. The new MBeanServer must register this MBean in its MBean repository.
delegate
,
boolean
If true, MBeanServerInterceptors will be enabled (default is false).

Note

this parameter is not taken into account by this implementation - the default value false is always used.

interceptors
)

This method creates a new MBeanServer implementation object.

public static MBeanServerDelegate
newMBeanServerDelegate()

This method creates a new MBeanServerDelegate for a new MBeanServer.

public Set<ObjectInstance>

Returns:

A set containing the ObjectInstance objects for the selected MBeans. If no MBean satisfies the query an empty list is returned.
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.management.MBeanServer.queryMBeans.

Gets MBeans controlled by the MBean server.

public Set<ObjectName>

Returns:

A set containing the ObjectNames for the MBeans selected. If no MBean satisfies the query, an empty list is returned.
queryNames
(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.management.MBeanServer.queryNames.

Gets the names of MBeans controlled by the MBean server.

public ObjectInstance

Returns:

The ObjectInstance for the MBean that has been registered.
registerMBean
(Object
The MBean to be registered as an MBean.
object
,
ObjectName
The object name of the MBean. May be null.
name
)

Implements javax.management.MBeanServer.registerMBean.

Registers a pre-existing object as an MBean with the MBean server.

public void
removeNotificationListener(ObjectName name, NotificationListener listener)

Implements javax.management.MBeanServer.removeNotificationListener.

Removes a listener from a registered MBean.

public void
removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)

Implements javax.management.MBeanServer.removeNotificationListener.

Removes a listener from a registered MBean.

public void
removeNotificationListener(ObjectName name, ObjectName listener)

Implements javax.management.MBeanServer.removeNotificationListener.

Removes a listener from a registered MBean.

public void
removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback)

Implements javax.management.MBeanServer.removeNotificationListener.

Removes a listener from a registered MBean.

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.management.MBeanServer.setAttribute.

Sets the value of a specific attribute of a named MBean.

public AttributeList

Returns:

The list of attributes that were set, with their new values.
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.management.MBeanServer.setAttributes.

Sets the values of several attributes of a named MBean.

public synchronized void
public void
unregisterMBean(ObjectName
The object name of the MBean to be de-registered.
name
)

Implements javax.management.MBeanServer.unregisterMBean.

De-registers an MBean from the MBean server.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait