2362N/A * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This is the base class for MBean manipulation on the agent side. It 0N/A * contains the methods necessary for the creation, registration, and 0N/A * deletion of MBeans as well as the access methods for registered MBeans. 0N/A * This is the core component of the JMX infrastructure. 0N/A * Every MBean which is added to the MBean server becomes manageable: 0N/A * its attributes and operations become remotely accessible through 0N/A * A Java object cannot be registered in the MBean server unless it is a 0N/A * JMX compliant MBean. 0N/A * When an MBean is registered or unregistered in the MBean server an 0N/A * {@link javax.management.MBeanServerNotification MBeanServerNotification} 0N/A * Notification is emitted. To register an object as listener to 0N/A * MBeanServerNotifications you should call the MBean server method 0N/A * {@link #addNotificationListener addNotificationListener} with 0N/A * the <CODE>ObjectName</CODE> of the 0N/A * {@link javax.management.MBeanServerDelegate MBeanServerDelegate}. 0N/A * This <CODE>ObjectName</CODE> is: 0N/A * <CODE>JMImplementation:type=MBeanServerDelegate</CODE>. 0N/A /** Control the default locking policy of the repository. 0N/A * By default, we will be using a fair locking policy. 0N/A /** true if interceptors are enabled **/ 528N/A /** The MBeanServerDelegate object representing the MBean Server */ 0N/A * <b>Package:</b> Creates an MBeanServer with the 0N/A * specified default domain name, outer interface, and delegate. 0N/A * <p>The default domain name is used as the domain part in the ObjectName 0N/A * of MBeans if no domain is specified by the user. 0N/A * <ul><b>Note:</b>Using this constructor directly is strongly 0N/A * discouraged. You should use 0N/A * {@link javax.management.MBeanServerFactory#createMBeanServer(java.lang.String)} 0N/A * {@link javax.management.MBeanServerFactory#newMBeanServer(java.lang.String)} 699N/A * By default, interceptors are disabled. Use 0N/A * {@link #JmxMBeanServer(java.lang.String,javax.management.MBeanServer,javax.management.MBeanServerDelegate,boolean)} to enable them. 0N/A * @param domain The default domain name used by this MBeanServer. 0N/A * @param outer A pointer to the MBeanServer object that must be 0N/A * passed to the MBeans when invoking their 0N/A * {@link javax.management.MBeanRegistration} interface. 0N/A * @param delegate A pointer to the MBeanServerDelegate associated 0N/A * with the new MBeanServer. The new MBeanServer must register 0N/A * this MBean in its MBean repository. 0N/A * @exception IllegalArgumentException if the instantiator is null. 0N/A * <b>Package:</b> Creates an MBeanServer with the 0N/A * specified default domain name, outer interface, and delegate. 0N/A * <p>The default domain name is used as the domain part in the ObjectName 0N/A * of MBeans if no domain is specified by the user. 0N/A * <ul><b>Note:</b>Using this constructor directly is strongly 0N/A * discouraged. You should use 0N/A * {@link javax.management.MBeanServerFactory#createMBeanServer(java.lang.String)} 0N/A * {@link javax.management.MBeanServerFactory#newMBeanServer(java.lang.String)} 0N/A * @param domain The default domain name used by this MBeanServer. 0N/A * @param outer A pointer to the MBeanServer object that must be 0N/A * passed to the MBeans when invoking their 0N/A * {@link javax.management.MBeanRegistration} interface. 0N/A * @param delegate A pointer to the MBeanServerDelegate associated 0N/A * with the new MBeanServer. The new MBeanServer must register 0N/A * this MBean in its MBean repository. 0N/A * @param interceptors If <code>true</code>, 0N/A * {@link MBeanServerInterceptor} will be enabled (default is 0N/A * <code>false</code>) 0N/A * Note: this parameter is not taken into account by this 0N/A * implementation - the default value <code>false</code> is 0N/A * @exception IllegalArgumentException if the instantiator is null. 0N/A * <b>Package:</b> Creates an MBeanServer. 0N/A * @param domain The default domain name used by this MBeanServer. 0N/A * @param outer A pointer to the MBeanServer object that must be 0N/A * passed to the MBeans when invoking their 0N/A * {@link javax.management.MBeanRegistration} interface. 0N/A * @param delegate A pointer to the MBeanServerDelegate associated 0N/A * with the new MBeanServer. The new MBeanServer must register 0N/A * this MBean in its MBean repository. 0N/A * @param instantiator The MBeanInstantiator that will be used to 0N/A * instantiate MBeans and take care of class loading issues. 0N/A * @param metadata The MetaData object that will be used by the 0N/A * MBean server in order to invoke the MBean interface of 0N/A * the registered MBeans. 0N/A * @param interceptors If <code>true</code>, 0N/A * {@link MBeanServerInterceptor} will be enabled (default is 0N/A * <code>false</code>). 0N/A * <b>Package:</b> Creates an MBeanServer. 0N/A * @param domain The default domain name used by this MBeanServer. 0N/A * @param outer A pointer to the MBeanServer object that must be 0N/A * passed to the MBeans when invoking their 0N/A * {@link javax.management.MBeanRegistration} interface. 0N/A * @param delegate A pointer to the MBeanServerDelegate associated 0N/A * with the new MBeanServer. The new MBeanServer must register 0N/A * this MBean in its MBean repository. 0N/A * @param instantiator The MBeanInstantiator that will be used to 0N/A * instantiate MBeans and take care of class loading issues. 0N/A * @param metadata The MetaData object that will be used by the 0N/A * MBean server in order to invoke the MBean interface of 0N/A * the registered MBeans. 0N/A * @param interceptors If <code>true</code>, 0N/A * {@link MBeanServerInterceptor} will be enabled (default is 0N/A * <code>false</code>). 0N/A * @param fairLock If {@code true}, the MBean repository will use a {@link 0N/A * java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean) 0N/A * fair locking} policy. 0N/A * Tell whether {@link MBeanServerInterceptor}s are enabled on this 0N/A * @return <code>true</code> if {@link MBeanServerInterceptor}s are 0N/A * @see #newMBeanServer(java.lang.String,javax.management.MBeanServer,javax.management.MBeanServerDelegate,boolean) 0N/A * Return the MBeanInstantiator associated to this MBeanServer. 0N/A * @exception UnsupportedOperationException if 0N/A * {@link MBeanServerInterceptor}s 0N/A * are not enabled on this object. 0N/A * @see #interceptorsEnabled 0N/A "MBeanServerInterceptors are disabled.");
0N/A * Instantiates and registers an MBean in the MBean server. 0N/A * The MBean server will use its 0N/A * {@link javax.management.loading.ClassLoaderRepository Default Loader Repository} 0N/A * to load the class of the MBean. 0N/A * An object name is associated to the MBean. 0N/A * If the object name given is null, the MBean can automatically 0N/A * provide its own name by implementing the 0N/A * {@link javax.management.MBeanRegistration MBeanRegistration} interface. 0N/A * The call returns an <CODE>ObjectInstance</CODE> object representing 0N/A * the newly created MBean. 0N/A * @param className The class name of the MBean to be instantiated. 0N/A * @param name The object name of the MBean. May be null. 0N/A * @return An <CODE>ObjectInstance</CODE>, containing the 0N/A * <CODE>ObjectName</CODE> and the Java class name of the newly 0N/A * instantiated MBean. 0N/A * @exception ReflectionException Wraps an 0N/A * <CODE>{@link java.lang.ClassNotFoundException}</CODE> or an 0N/A * <CODE>{@link java.lang.Exception}</CODE> that occurred 0N/A * when trying to invoke the MBean's constructor. 0N/A * @exception InstanceAlreadyExistsException The MBean is already 0N/A * under the control of the MBean server. 0N/A * @exception MBeanRegistrationException The <CODE>preRegister()</CODE> 0N/A * (<CODE>MBeanRegistration</CODE> interface) method of the MBean 0N/A * has thrown an exception. The MBean will not be registered. 0N/A * @exception MBeanException The constructor of the MBean has thrown 0N/A * @exception NotCompliantMBeanException This class is not a JMX 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: 0N/A * The className passed in parameter is null, the 0N/A * <CODE>ObjectName</CODE> passed in parameter contains a pattern 0N/A * or no <CODE>ObjectName</CODE> is specified for the MBean. 0N/A * Instantiates and registers an MBean in the MBean server. 0N/A * The class loader to be used is identified by its object name. 0N/A * An object name is associated to the MBean. 0N/A * If the object name of the loader is null, the ClassLoader that 0N/A * loaded the MBean server will be used. 0N/A * If the MBean's object name given is null, the MBean can 0N/A * automatically provide its own name by implementing the 0N/A * {@link javax.management.MBeanRegistration MBeanRegistration} interface. 0N/A * The call returns an <CODE>ObjectInstance</CODE> object representing 0N/A * the newly created MBean. 0N/A * @param className The class name of the MBean to be instantiated. 0N/A * @param name The object name of the MBean. May be null. 0N/A * @param loaderName The object name of the class loader to be used. 0N/A * @return An <CODE>ObjectInstance</CODE>, containing the 0N/A * <CODE>ObjectName</CODE> and the Java class name 0N/A * of the newly instantiated MBean. 0N/A * @exception ReflectionException Wraps an 0N/A * <CODE>{@link java.lang.ClassNotFoundException}</CODE> or an 0N/A * <CODE>{@link java.lang.Exception}</CODE> that occurred when trying 0N/A * to invoke the MBean's constructor. 0N/A * @exception InstanceAlreadyExistsException The MBean is already 0N/A * under the control of the MBean server. 0N/A * @exception MBeanRegistrationException The <CODE>preRegister()</CODE> 0N/A * (<CODE>MBeanRegistration</CODE> interface) method of the MBean 0N/A * has thrown an exception. The MBean will not be registered. 0N/A * @exception MBeanException The constructor of the MBean has thrown 0N/A * @exception NotCompliantMBeanException This class is not a JMX 0N/A * @exception InstanceNotFoundException The specified class loader 0N/A * is not registered in the MBean server. 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: The 0N/A * className passed in parameter is null, the <CODE>ObjectName</CODE> 0N/A * passed in parameter contains a pattern or no 0N/A * <CODE>ObjectName</CODE> is specified for the MBean. 0N/A * Instantiates and registers an MBean in the MBean server. 0N/A * The MBean server will use its 0N/A * {@link javax.management.loading.ClassLoaderRepository Default Loader Repository} 0N/A * to load the class of the MBean. 0N/A * An object name is associated to the MBean. 0N/A * If the object name given is null, the MBean can automatically 0N/A * provide its own name by implementing the 0N/A * {@link javax.management.MBeanRegistration MBeanRegistration} interface. 0N/A * The call returns an <CODE>ObjectInstance</CODE> object representing 0N/A * the newly created MBean. 0N/A * @param className The class name of the MBean to be instantiated. 0N/A * @param name The object name of the MBean. May be null. 0N/A * @param params An array containing the parameters of the constructor 0N/A * @param signature An array containing the signature of the 0N/A * constructor to be invoked. 0N/A * @return An <CODE>ObjectInstance</CODE>, containing the 0N/A * <CODE>ObjectName</CODE> and the Java class name 0N/A * of the newly instantiated MBean. 0N/A * @exception ReflectionException Wraps a 0N/A * <CODE>{@link java.lang.ClassNotFoundException}</CODE> or an 0N/A * <CODE>{@link java.lang.Exception}</CODE> that occurred 0N/A * when trying to invoke the MBean's constructor. 0N/A * @exception InstanceAlreadyExistsException The MBean is already 0N/A * under the control of the MBean server. 0N/A * @exception MBeanRegistrationException The <CODE>preRegister()</CODE> 0N/A * (<CODE>MBeanRegistration</CODE> interface) method of the MBean 0N/A * has thrown an exception. The MBean will not be registered. 0N/A * @exception MBeanException The constructor of the MBean has 0N/A * thrown an exception. 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: The 0N/A * className passed in parameter is null, the <CODE>ObjectName</CODE> 0N/A * passed in parameter contains a pattern or no 0N/A * <CODE>ObjectName</CODE> is specified for the MBean. 0N/A * Instantiates and registers an MBean in the MBean server. 0N/A * The class loader to be used is identified by its object name. 0N/A * An object name is associated to the MBean. If the object name 0N/A * of the loader is not specified, the ClassLoader that loaded the 0N/A * MBean server will be used. 0N/A * If the MBean object name given is null, the MBean can automatically 0N/A * provide its own name by implementing the 0N/A * {@link javax.management.MBeanRegistration MBeanRegistration} interface. 0N/A * The call returns an <CODE>ObjectInstance</CODE> object representing 0N/A * the newly created MBean. 0N/A * @param className The class name of the MBean to be instantiated. 0N/A * @param name The object name of the MBean. May be null. 0N/A * @param params An array containing the parameters of the constructor 0N/A * @param signature An array containing the signature of the 0N/A * constructor to be invoked. 0N/A * @param loaderName The object name of the class loader to be used. 0N/A * @return An <CODE>ObjectInstance</CODE>, containing the 0N/A * <CODE>ObjectName</CODE> and the Java class name of the newly 0N/A * instantiated MBean. 0N/A * @exception ReflectionException Wraps a 0N/A * <CODE>{@link java.lang.ClassNotFoundException}</CODE> or an 0N/A * <CODE>{@link java.lang.Exception}</CODE> 0N/A * that occurred when trying to invoke the MBean's constructor. 0N/A * @exception InstanceAlreadyExistsException The MBean is already 0N/A * under the control of the MBean server. 0N/A * @exception MBeanRegistrationException The <CODE>preRegister()</CODE> 0N/A * (<CODE>MBeanRegistration</CODE> interface) method of the MBean 0N/A * has thrown an exception. The MBean will not be registered. 0N/A * @exception MBeanException The constructor of the MBean has 0N/A * thrown an exception 0N/A * @exception InstanceNotFoundException The specified class loader is 0N/A * not registered in the MBean server. 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: The 0N/A * className passed in parameter is null, the <CODE>ObjectName</CODE> 0N/A * passed in parameter contains a pattern or no 0N/A * <CODE>ObjectName</CODE> is specified for the MBean. 0N/A * Registers a pre-existing object as an MBean with the MBean server. 0N/A * If the object name given is null, the MBean may automatically 0N/A * provide its own name by implementing the 0N/A * {@link javax.management.MBeanRegistration MBeanRegistration} interface. 0N/A * The call returns an <CODE>ObjectInstance</CODE> object representing 0N/A * the registered MBean. 0N/A * @param object The MBean to be registered as an MBean. 0N/A * @param name The object name of the MBean. May be null. 0N/A * @return The <CODE>ObjectInstance</CODE> for the MBean that has been 0N/A * @exception InstanceAlreadyExistsException The MBean is already 0N/A * under the control of the MBean server. 0N/A * @exception MBeanRegistrationException The <CODE>preRegister()</CODE> 0N/A * (<CODE>MBeanRegistration</CODE> interface) method of the MBean 0N/A * has thrown an exception. The MBean will not be registered. 0N/A * @exception NotCompliantMBeanException This object is not a JMX 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: The 0N/A * object passed in parameter is null or no object name is specified. 0N/A * De-registers an MBean from the MBean server. The MBean is identified by 0N/A * its object name. Once the method has been invoked, the MBean may 0N/A * no longer be accessed by its object name. 0N/A * @param name The object name of the MBean to be de-registered. 0N/A * @exception InstanceNotFoundException The MBean specified is not 0N/A * registered in the MBean server. 0N/A * @exception MBeanRegistrationException The <code>preDeregister()</code> 0N/A * (<CODE>MBeanRegistration</CODE> interface) method of the MBean 0N/A * has thrown an exception. 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: The 0N/A * object name in parameter is null or the MBean you are when 0N/A * trying to de-register is the 0N/A * {@link javax.management.MBeanServerDelegate MBeanServerDelegate} 0N/A * Gets the <CODE>ObjectInstance</CODE> for a given MBean registered 0N/A * with the MBean server. 0N/A * @param name The object name of the MBean. 0N/A * @return The <CODE>ObjectInstance</CODE> associated to the MBean 0N/A * specified by <VAR>name</VAR>. 0N/A * @exception InstanceNotFoundException The MBean specified is not 0N/A * registered in the MBean server. 0N/A * Gets MBeans controlled by the MBean server. This method allows any 0N/A * of the following to be obtained: All MBeans, a set of MBeans specified 0N/A * by pattern matching on the <CODE>ObjectName</CODE> and/or a Query 0N/A * expression, a specific MBean. When the object name is null or no 0N/A * domain and key properties are specified, all objects are to be 0N/A * selected (and filtered if a query is specified). It returns the 0N/A * set of <CODE>ObjectInstance</CODE> objects (containing the 0N/A * <CODE>ObjectName</CODE> and the Java Class name) for 0N/A * the selected MBeans. 0N/A * @param name The object name pattern identifying the MBeans to 0N/A * be retrieved. If null or or no domain and key properties 0N/A * are specified, all the MBeans registered will be retrieved. 0N/A * @param query The query expression to be applied for selecting 0N/A * MBeans. If null no query expression will be applied for 0N/A * @return A set containing the <CODE>ObjectInstance</CODE> objects 0N/A * for the selected MBeans. 0N/A * If no MBean satisfies the query an empty list is returned. 0N/A * Gets the names of MBeans controlled by the MBean server. This method 0N/A * enables any of the following to be obtained: The names of all MBeans, 0N/A * the names of a set of MBeans specified by pattern matching on the 0N/A * <CODE>ObjectName</CODE> and/or a Query expression, a specific 0N/A * MBean name (equivalent to testing whether an MBean is registered). 0N/A * When the object name is null or or no domain and key properties are 0N/A * specified, all objects are selected (and filtered if a query is 0N/A * specified). It returns the set of ObjectNames for the MBeans 0N/A * @param name The object name pattern identifying the MBeans to be 0N/A * retrieved. If null or no domain and key properties are 0N/A * specified, all the MBeans registered will be retrieved. 0N/A * @param query The query expression to be applied for selecting 0N/A * MBeans. If null no query expression will be applied for 0N/A * @return A set containing the ObjectNames for the MBeans selected. 0N/A * If no MBean satisfies the query, an empty list is returned. 0N/A * Checks whether an MBean, identified by its object name, is already 0N/A * registered with the MBean server. 0N/A * @param name The object name of the MBean to be checked. 0N/A * @return True if the MBean is already registered in the MBean server, 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: The object 0N/A * name in parameter is null. 0N/A * Returns the number of MBeans registered in the MBean server. 0N/A * Gets the value of a specific attribute of a named MBean. The MBean 0N/A * is identified by its object name. 0N/A * @param name The object name of the MBean from which the attribute 0N/A * is to be retrieved. 0N/A * @param attribute A String specifying the name of the attribute to be 0N/A * @return The value of the retrieved attribute. 0N/A * @exception AttributeNotFoundException The attribute specified 0N/A * is not accessible in the MBean. 0N/A * @exception MBeanException Wraps an exception thrown by the 0N/A * @exception InstanceNotFoundException The MBean specified is not 0N/A * registered in the MBean server. 0N/A * @exception ReflectionException Wraps an 0N/A * <CODE>{@link java.lang.Exception}</CODE> thrown when trying to 0N/A * invoke the setter. 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: 0N/A * The object name in parameter is null or the attribute in 0N/A * parameter is null. 0N/A * Enables the values of several attributes of a named MBean. The MBean 0N/A * is identified by its object name. 0N/A * @param name The object name of the MBean from which the attributes are 0N/A * @param attributes A list of the attributes to be retrieved. 0N/A * @return The list of the retrieved attributes. 0N/A * @exception InstanceNotFoundException The MBean specified is not 0N/A * registered in the MBean server. 0N/A * @exception ReflectionException An exception occurred when trying 0N/A * to invoke the getAttributes method of a Dynamic MBean. 0N/A * @exception RuntimeOperationsException Wrap an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: The 0N/A * object name in parameter is null or attributes in parameter 0N/A * Sets the value of a specific attribute of a named MBean. The MBean 0N/A * is identified by its object name. 0N/A * @param name The name of the MBean within which the attribute is 0N/A * @param attribute The identification of the attribute to be set 0N/A * and the value it is to be set to. 0N/A * @exception InstanceNotFoundException The MBean specified is 0N/A * not registered in the MBean server. 0N/A * @exception AttributeNotFoundException The attribute specified is 0N/A * not accessible in the MBean. 0N/A * @exception InvalidAttributeValueException The value specified for 0N/A * the attribute is not valid. 0N/A * @exception MBeanException Wraps an exception thrown by the 0N/A * @exception ReflectionException Wraps an 0N/A * <CODE>{@link java.lang.Exception}</CODE> thrown when trying 0N/A * to invoke the setter. 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: The 0N/A * object name in parameter is null or the attribute in parameter 0N/A * Sets the values of several attributes of a named MBean. The MBean is 0N/A * identified by its object name. 0N/A * @param name The object name of the MBean within which the 0N/A * attributes are to be set. 0N/A * @param attributes A list of attributes: The identification of the 0N/A * attributes to be set and the values they are to be set to. 0N/A * @return The list of attributes that were set, with their new values. 0N/A * @exception InstanceNotFoundException The MBean specified is not 0N/A * registered in the MBean server. 0N/A * @exception ReflectionException An exception occurred when trying 0N/A * to invoke the getAttributes method of a Dynamic MBean. 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: 0N/A * The object name in parameter is null or attributes in 0N/A * parameter is null. 0N/A * Invokes an operation on an MBean. 0N/A * @param name The object name of the MBean on which the method is to be 0N/A * @param operationName The name of the operation to be invoked. 0N/A * @param params An array containing the parameters to be set when 0N/A * the operation is invoked 0N/A * @param signature An array containing the signature of the operation. 0N/A * The class objects will be loaded using the same class loader as 0N/A * the one used for loading the MBean on which the operation was 0N/A * @return The object returned by the operation, which represents the 0N/A * result ofinvoking the operation on the MBean specified. 0N/A * @exception InstanceNotFoundException The MBean specified is not 0N/A * registered in the MBean server. 0N/A * @exception MBeanException Wraps an exception thrown by the MBean's 0N/A * @exception ReflectionException Wraps an 0N/A * <CODE>{@link java.lang.Exception}</CODE> thrown while trying 0N/A * to invoke the method. 0N/A * Returns the default domain used for naming the MBean. 0N/A * The default domain name is used as the domain part in the ObjectName 0N/A * of MBeans if no domain is specified by the user. 0N/A * Adds a listener to a registered MBean. 0N/A * @param name The name of the MBean on which the listener should be added. 0N/A * @param listener The listener object which will handle the 0N/A * notifications emitted by the registered MBean. 0N/A * @param filter The filter object. If filter is null, no filtering 0N/A * will be performed before handling notifications. 0N/A * @param handback The context to be sent to the listener when a 0N/A * notification is emitted. 0N/A * @exception InstanceNotFoundException The MBean name provided does 0N/A * not match any of the registered MBeans. 0N/A * Adds a listener to a registered MBean. 0N/A * @param name The name of the MBean on which the listener should be added. 0N/A * @param listener The object name of the listener which will handle the 0N/A * notifications emitted by the registered MBean. 0N/A * @param filter The filter object. If filter is null, no filtering will 0N/A * be performed before handling notifications. 0N/A * @param handback The context to be sent to the listener when a 0N/A * notification is emitted. 0N/A * @exception InstanceNotFoundException The MBean name of the 0N/A * notification listener or of the notification broadcaster 0N/A * does not match any of the registered MBeans. 0N/A * This method discovers the attributes and operations that an MBean exposes 0N/A * @param name The name of the MBean to analyze 0N/A * @return An instance of <CODE>MBeanInfo</CODE> allowing the retrieval of 0N/A * all attributes and operations of this MBean. 0N/A * @exception IntrospectionException An exception occurs during 0N/A * @exception InstanceNotFoundException The MBean specified is not found. 0N/A * @exception ReflectionException An exception occurred when trying to 0N/A * invoke the getMBeanInfo of a Dynamic MBean. 0N/A * Instantiates an object using the list of all class loaders registered 0N/A * in the MBean server (using its 0N/A * {@link javax.management.loading.ClassLoaderRepository Default Loader Repository}). 0N/A * The object's class should have a public constructor. 0N/A * It returns a reference to the newly created object. 0N/A * The newly created object is not registered in the MBean server. 0N/A * @param className The class name of the object to be instantiated. 0N/A * @return The newly instantiated object. 0N/A * @exception ReflectionException Wraps the 0N/A * <CODE>{@link java.lang.ClassNotFoundException}</CODE> or the 0N/A * <CODE>{@link java.lang.Exception}</CODE> that 0N/A * occurred when trying to invoke the object's constructor. 0N/A * @exception MBeanException The constructor of the object has thrown 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: 0N/A * The className passed in parameter is null. 0N/A /* Permission check */ 0N/A * Instantiates an object using the class Loader specified by its 0N/A * <CODE>ObjectName</CODE>. 0N/A * If the loader name is null, the ClassLoader that loaded the 0N/A * MBean Server will be used. 0N/A * The object's class should have a public constructor. 0N/A * It returns a reference to the newly created object. 0N/A * The newly created object is not registered in the MBean server. 0N/A * @param className The class name of the MBean to be instantiated. 0N/A * @param loaderName The object name of the class loader to be used. 0N/A * @return The newly instantiated object. 0N/A * @exception ReflectionException Wraps the 0N/A * <CODE>{@link java.lang.ClassNotFoundException}</CODE> or the 0N/A * <CODE>{@link java.lang.Exception}</CODE> that 0N/A * occurred when trying to invoke the object's constructor. 0N/A * @exception MBeanException The constructor of the object has thrown 0N/A * @exception InstanceNotFoundException The specified class loader 0N/A * is not registered in the MBaenServer. 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: The 0N/A * className passed in parameter is null. 0N/A /* Permission check */ 0N/A * Instantiates an object using the list of all class loaders registered 0N/A * in the MBean server (using its 0N/A * {@link javax.management.loading.ClassLoaderRepository Default Loader Repository}). 0N/A * The object's class should have a public constructor. 0N/A * The call returns a reference to the newly created object. 0N/A * The newly created object is not registered in the MBean server. 0N/A * @param className The class name of the object to be instantiated. 0N/A * @param params An array containing the parameters of the constructor 0N/A * @param signature An array containing the signature of the 0N/A * constructor to be invoked. 0N/A * @return The newly instantiated object. 0N/A * @exception ReflectionException Wraps the 0N/A * <CODE>{@link java.lang.ClassNotFoundException}</CODE> or the 0N/A * <CODE>{@link java.lang.Exception}</CODE> that 0N/A * occurred when trying to invoke the object's constructor. 0N/A * @exception MBeanException The constructor of the object has thrown 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: 0N/A * The className passed in parameter is null. 0N/A /* Permission check */ 0N/A * Instantiates an object. The class loader to be used is identified 0N/A * by its object name. If the object name of the loader is null, 0N/A * the ClassLoader that loaded the MBean server will be used. 0N/A * The object's class should have a public constructor. 0N/A * The call returns a reference to the newly created object. 0N/A * The newly created object is not registered in the MBean server. 0N/A * @param className The class name of the object to be instantiated. 0N/A * @param params An array containing the parameters of the constructor 0N/A * @param signature An array containing the signature of the constructor 0N/A * @param loaderName The object name of the class loader to be used. 0N/A * @return The newly instantiated object. 0N/A * @exception ReflectionException Wraps the 0N/A * <CODE>{@link java.lang.ClassNotFoundException}</CODE> or the 0N/A * <CODE>{@link java.lang.Exception}</CODE> that 0N/A * occurred when trying to invoke the object's constructor. 0N/A * @exception MBeanException The constructor of the object has thrown 0N/A * @exception InstanceNotFoundException The specified class loader 0N/A * is not registered in the MBean server. 0N/A * @exception RuntimeOperationsException Wraps an 0N/A * <CODE>{@link java.lang.IllegalArgumentException}</CODE>: 0N/A * The className passed in parameter is null. 0N/A /* Permission check */ 0N/A * Returns true if the MBean specified is an instance of the specified 0N/A * class, false otherwise. 0N/A * @param name The <CODE>ObjectName</CODE> of the MBean. 0N/A * @param className The name of the class. 0N/A * @return true if the MBean specified is an instance of the specified 0N/A * class, false otherwise. 0N/A * @exception InstanceNotFoundException The MBean specified is not 0N/A * registered in the MBean server. 0N/A * De-serializes a byte array in the context of the class loader 0N/A * @param name The name of the MBean whose class loader should 0N/A * be used for the de-serialization. 0N/A * @param data The byte array to be de-sererialized. 0N/A * @return The de-serialized object stream. 0N/A * @exception InstanceNotFoundException The MBean specified is not 0N/A * related exceptions. 0N/A /* Permission check */ 0N/A // This call requires MBeanPermission 'getClassLoaderFor' 0N/A * De-serializes a byte array in the context of a given MBean class loader. 0N/A * The class loader is the one that loaded the class with name "className". 0N/A * @param className The name of the class whose class loader should be 0N/A * used for the de-serialization. 0N/A * @param data The byte array to be de-sererialized. 0N/A * @return The de-serialized object stream. 0N/A * related exceptions. 0N/A * @exception ReflectionException The specified class could not be 0N/A * loaded by the default loader repository 0N/A "Null className passed in parameter");
0N/A /* Permission check */ 0N/A // This call requires MBeanPermission 'getClassLoaderRepository' 0N/A "The given class could not be " +
0N/A "loaded by the default loader " +
0N/A * De-serializes a byte array in the context of a given MBean class loader. 0N/A * The class loader is the one that loaded the class with name "className". 0N/A * The name of the class loader to be used for loading the specified 0N/A * class is specified. 0N/A * If null, the MBean Server's class loader will be used. 0N/A * @param className The name of the class whose class loader should be 0N/A * used for the de-serialization. 0N/A * @param data The byte array to be de-sererialized. 0N/A * @param loaderName The name of the class loader to be used for 0N/A * loading the specified class. 0N/A * If null, the MBean Server's class loader will be used. 0N/A * @return The de-serialized object stream. 0N/A * @exception InstanceNotFoundException The specified class loader 0N/A * MBean is not found. 0N/A * related exceptions. 0N/A * @exception ReflectionException The specified class could not 0N/A * be loaded by the specified class loader. 0N/A /* Permission check */ 0N/A // Make this call just to force the 'getClassLoader' 0N/A * Initializes this MBeanServer, registering the MBeanServerDelegate. 0N/A * <p>This method must be called once, before using the MBeanServer. 0N/A // Registers the MBeanServer identification MBean 0N/A "Unexpected security exception occurred", e);
0N/A "Unexpected exception occurred", e);
0N/A /* Add my class loader to the repository 0N/A This can be null if my class loader is the bootstrap 0N/A class loader. The ClassLoaderRepository knows how 0N/A to handle that case. */ 0N/A /* Add the system class loader, so that if the MBean server is 0N/A loaded by the bootstrap class loader we can still load 0N/A MBeans from the classpath using 0N/A createMBean(className, objectName). 0N/A If this class (JmxMBeanServer) was not loaded by the 0N/A system class loader or a parent of it, then the caller 0N/A must have RuntimePermission("getClassLoader") for the 0N/A getSystemClassLoader() call to succeed. If the caller 0N/A does not have that permission, any call to 0N/A Class.getClassLoader() will fail. Since there are lots 0N/A of those in JMX, we better throw the exception now. 0N/A This permission question is irrelevant when JMX is part 0N/A of J2SE (as of 1.5). */ 0N/A * Return the MBeanServerInterceptor. 0N/A * @exception UnsupportedOperationException if 0N/A * {@link MBeanServerInterceptor}s 0N/A * are not enabled on this object. 0N/A * @see #interceptorsEnabled 0N/A "MBeanServerInterceptors are disabled.");
0N/A * Set the MBeanServerInterceptor. 0N/A * @exception UnsupportedOperationException if 0N/A * {@link MBeanServerInterceptor}s 0N/A * are not enabled on this object. 0N/A * @see #interceptorsEnabled 0N/A public synchronized void 0N/A "MBeanServerInterceptors are disabled.");
0N/A * <p>Return the {@link java.lang.ClassLoader} that was used for 0N/A * loading the class of the named MBean. 0N/A * @param mbeanName The ObjectName of the MBean. 0N/A * @return The ClassLoader used for that MBean. 0N/A * @exception InstanceNotFoundException if the named MBean is not found. 0N/A * <p>Return the named {@link java.lang.ClassLoader}. 0N/A * @param loaderName The ObjectName of the ClassLoader. 0N/A * @return The named ClassLoader. 0N/A * @exception InstanceNotFoundException if the named ClassLoader 0N/A * <p>Return the ClassLoaderRepository for that MBeanServer. 0N/A * @return The ClassLoaderRepository for that MBeanServer. 0N/A /* Permission check */ 0N/A "MBeanServerInterceptors are disabled.");
0N/A // These methods are called by the JMX MBeanServerBuilder. 0N/A * This method creates a new MBeanServerDelegate for a new MBeanServer. 0N/A * When creating a new MBeanServer the 0N/A * {@link javax.management.MBeanServerBuilder} first calls this method 0N/A * in order to create a new MBeanServerDelegate. 0N/A * <code>newMBeanServer(defaultDomain,outer,delegate,interceptors)</code> 0N/A * passing the <var>delegate</var> that should be used by the MBeanServer 0N/A * <p>Note that the passed <var>delegate</var> might not be directly the 0N/A * MBeanServerDelegate that was returned by this method. It could 0N/A * be, for instance, a new object wrapping the previously 0N/A * @return A new {@link javax.management.MBeanServerDelegate}. 0N/A * This method creates a new MBeanServer implementation object. 0N/A * When creating a new MBeanServer the 0N/A * {@link javax.management.MBeanServerBuilder} first calls 0N/A * <code>newMBeanServerDelegate()</code> in order to obtain a new 0N/A * {@link javax.management.MBeanServerDelegate} for the new 0N/A * MBeanServer. Then it calls 0N/A * <code>newMBeanServer(defaultDomain,outer,delegate)</code> 0N/A * passing the <var>delegate</var> that should be used by the 0N/A * MBeanServer implementation. 0N/A * <p>Note that the passed <var>delegate</var> might not be directly the 0N/A * MBeanServerDelegate that was returned by this implementation. It could 0N/A * be, for instance, a new object wrapping the previously 0N/A * returned delegate. 0N/A * <p>The <var>outer</var> parameter is a pointer to the MBeanServer that 0N/A * should be passed to the {@link javax.management.MBeanRegistration} 0N/A * interface when registering MBeans inside the MBeanServer. 0N/A * If <var>outer</var> is <code>null</code>, then the MBeanServer 0N/A * implementation is free to use its own <code>this</code> pointer when 0N/A * invoking the {@link javax.management.MBeanRegistration} interface. 0N/A * <p>This makes it possible for a MBeanServer implementation to wrap 0N/A * another MBeanServer implementation, in order to implement, e.g, 0N/A * security checks, or to prevent access to the actual MBeanServer 0N/A * implementation by returning a pointer to a wrapping object. 0N/A * @param defaultDomain Default domain of the new MBeanServer. 0N/A * @param outer A pointer to the MBeanServer object that must be 0N/A * passed to the MBeans when invoking their 0N/A * {@link javax.management.MBeanRegistration} interface. 0N/A * @param delegate A pointer to the MBeanServerDelegate associated 0N/A * with the new MBeanServer. The new MBeanServer must register 0N/A * this MBean in its MBean repository. 0N/A * @param interceptors If <code>true</code>, 0N/A * {@link MBeanServerInterceptor}s will be enabled (default is 0N/A * <code>false</code>). 0N/A * Note: this parameter is not taken into account by this 0N/A * implementation - the default value <code>false</code> is 0N/A * @return A new private implementation of an MBeanServer. 0N/A * @see #interceptorsEnabled 0N/A * @see javax.management.MBeanServerBuilder 0N/A * @see com.sun.jmx.mbeanserver.JmxMBeanServerBuilder 0N/A // Determine whether to use fair locking for the repository. 0N/A // This constructor happens to disregard the value of the interceptors 0N/A // flag - that is, it always uses the default value - false. 0N/A // This is admitedly a bug, but we chose not to fix it for now 0N/A // since we would rather not have anybody depending on the Sun private 0N/A // interceptor APIs - which is most probably going to be removed and 0N/A // replaced by a public (javax) feature in the future. 0N/A // JMX OBJECT CLONING 0N/A //------------------- 0N/A * Clone object name. 0N/A * Clone attribute list. 0N/A // Create new attribute list 0N/A // Iterate through list and replace non JMX attributes 0N/A // Iterate through list and replace non JMX attributes