jdk/src/share/classes/javax/management/MBeanServerConnection.java
author rriggs
Tue, 12 Nov 2013 14:03:28 -0500
changeset 21656 d4c777ccb1db
parent 5506 202f599c92aa
child 23010 6dadb192ad81
permissions -rw-r--r--
8028014: Doclint warning/error cleanup in javax.management Summary: Improve generated html by fixing doclint warnings Reviewed-by: sla, jbachorik
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4156
diff changeset
     2
 * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4156
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4156
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4156
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4156
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4156
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.management;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
// java import
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.util.Set;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * This interface represents a way to talk to an MBean server, whether
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * local or remote.  The {@link MBeanServer} interface, representing a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * local MBean server, extends this interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 */
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
    42
public interface MBeanServerConnection {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     * <p>Instantiates and registers an MBean in the MBean server.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     * MBean server will use its {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * javax.management.loading.ClassLoaderRepository Default Loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     * Repository} to load the class of the MBean.  An object name is
1700
4506662fb2ee 6675526: Define an Annotation to name registered MBeans
jfdenise
parents: 1571
diff changeset
    48
     * associated with the MBean.  If the object name given is null, the
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
    49
     * MBean must provide its own name by implementing the {@link
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     * javax.management.MBeanRegistration MBeanRegistration} interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * and returning the name from the {@link
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
    52
     * MBeanRegistration#preRegister preRegister} method.</p>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     * <p>This method is equivalent to {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * #createMBean(String,ObjectName,Object[],String[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * createMBean(className, name, (Object[]) null, (String[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     * null)}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * @param className The class name of the MBean to be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * @param name The object name of the MBean. May be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * @return An <CODE>ObjectInstance</CODE>, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * <CODE>ObjectName</CODE> and the Java class name of the newly
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * instantiated MBean.  If the contained <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * is <code>n</code>, the contained Java class name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * <code>{@link #getMBeanInfo getMBeanInfo(n)}.getClassName()</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * @exception ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * <CODE>java.lang.ClassNotFoundException</CODE> or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * <CODE>java.lang.Exception</CODE> that occurred
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * when trying to invoke the MBean's constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * @exception InstanceAlreadyExistsException The MBean is already
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * under the control of the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * @exception MBeanRegistrationException The
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * <CODE>preRegister</CODE> (<CODE>MBeanRegistration</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * interface) method of the MBean has thrown an exception. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * MBean will not be registered.
1517
4ca99a6fc74e 6766173: Spec should say that createMBean wraps a constructor RuntimeException in a RuntimeMBeanException
emcmanus
parents: 1247
diff changeset
    78
     * @exception RuntimeMBeanException If the MBean's constructor or its
4ca99a6fc74e 6766173: Spec should say that createMBean wraps a constructor RuntimeException in a RuntimeMBeanException
emcmanus
parents: 1247
diff changeset
    79
     * {@code preRegister} or {@code postRegister} method threw
4ca99a6fc74e 6766173: Spec should say that createMBean wraps a constructor RuntimeException in a RuntimeMBeanException
emcmanus
parents: 1247
diff changeset
    80
     * a {@code RuntimeException}. If the <CODE>postRegister</CODE>
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    81
     * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws a
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
    82
     * <CODE>RuntimeException</CODE>, the <CODE>createMBean</CODE> method will
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    83
     * throw a <CODE>RuntimeMBeanException</CODE>, although the MBean creation
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    84
     * and registration succeeded. In such a case, the MBean will be actually
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
    85
     * registered even though the <CODE>createMBean</CODE> method
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    86
     * threw an exception. Note that <CODE>RuntimeMBeanException</CODE> can
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    87
     * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    88
     * will not be registered.
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    89
     * @exception RuntimeErrorException If the <CODE>postRegister</CODE>
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    90
     * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws an
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
    91
     * <CODE>Error</CODE>, the <CODE>createMBean</CODE> method will
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    92
     * throw a <CODE>RuntimeErrorException</CODE>, although the MBean creation
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    93
     * and registration succeeded. In such a case, the MBean will be actually
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
    94
     * registered even though the <CODE>createMBean</CODE> method
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    95
     * threw an exception.  Note that <CODE>RuntimeErrorException</CODE> can
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    96
     * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
    97
     * will not be registered.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * @exception MBeanException The constructor of the MBean has
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * thrown an exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * @exception NotCompliantMBeanException This class is not a JMX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * compliant MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * <CODE>java.lang.IllegalArgumentException</CODE>: The className
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * passed in parameter is null, the <CODE>ObjectName</CODE> passed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * in parameter contains a pattern or no <CODE>ObjectName</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * is specified for the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * talking to the MBean server.
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   109
     * @see javax.management.MBeanRegistration
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    public ObjectInstance createMBean(String className, ObjectName name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
            throws ReflectionException, InstanceAlreadyExistsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
                   MBeanRegistrationException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                   NotCompliantMBeanException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * <p>Instantiates and registers an MBean in the MBean server.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * class loader to be used is identified by its object name. An
1700
4506662fb2ee 6675526: Define an Annotation to name registered MBeans
jfdenise
parents: 1571
diff changeset
   119
     * object name is associated with the MBean. If the object name of
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * the loader is null, the ClassLoader that loaded the MBean
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   121
     * server will be used.  If the MBean's object name given is null,
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   122
     * the MBean must provide its own name by implementing the {@link
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * javax.management.MBeanRegistration MBeanRegistration} interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * and returning the name from the {@link
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   125
     * MBeanRegistration#preRegister preRegister} method.</p>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * <p>This method is equivalent to {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * #createMBean(String,ObjectName,ObjectName,Object[],String[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * createMBean(className, name, loaderName, (Object[]) null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * (String[]) null)}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * @param className The class name of the MBean to be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * @param name The object name of the MBean. May be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @param loaderName The object name of the class loader to be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * @return An <CODE>ObjectInstance</CODE>, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * <CODE>ObjectName</CODE> and the Java class name of the newly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * instantiated MBean.  If the contained <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * is <code>n</code>, the contained Java class name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * <code>{@link #getMBeanInfo getMBeanInfo(n)}.getClassName()</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * @exception ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * <CODE>java.lang.ClassNotFoundException</CODE> or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * <CODE>java.lang.Exception</CODE> that occurred when trying to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * invoke the MBean's constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * @exception InstanceAlreadyExistsException The MBean is already
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * under the control of the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * @exception MBeanRegistrationException The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * <CODE>preRegister</CODE> (<CODE>MBeanRegistration</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * interface) method of the MBean has thrown an exception. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * MBean will not be registered.
1517
4ca99a6fc74e 6766173: Spec should say that createMBean wraps a constructor RuntimeException in a RuntimeMBeanException
emcmanus
parents: 1247
diff changeset
   152
     * @exception RuntimeMBeanException If the MBean's constructor or its
4ca99a6fc74e 6766173: Spec should say that createMBean wraps a constructor RuntimeException in a RuntimeMBeanException
emcmanus
parents: 1247
diff changeset
   153
     * {@code preRegister} or {@code postRegister} method threw
4ca99a6fc74e 6766173: Spec should say that createMBean wraps a constructor RuntimeException in a RuntimeMBeanException
emcmanus
parents: 1247
diff changeset
   154
     * a {@code RuntimeException}. If the <CODE>postRegister</CODE>
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   155
     * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws a
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   156
     * <CODE>RuntimeException</CODE>, the <CODE>createMBean</CODE> method will
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   157
     * throw a <CODE>RuntimeMBeanException</CODE>, although the MBean creation
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   158
     * and registration succeeded. In such a case, the MBean will be actually
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   159
     * registered even though the <CODE>createMBean</CODE> method
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   160
     * threw an exception.  Note that <CODE>RuntimeMBeanException</CODE> can
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   161
     * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   162
     * will not be registered.
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   163
     * @exception RuntimeErrorException If the <CODE>postRegister</CODE>
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   164
     * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws an
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   165
     * <CODE>Error</CODE>, the <CODE>createMBean</CODE> method will
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   166
     * throw a <CODE>RuntimeErrorException</CODE>, although the MBean creation
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   167
     * and registration succeeded. In such a case, the MBean will be actually
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   168
     * registered even though the <CODE>createMBean</CODE> method
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   169
     * threw an exception.  Note that <CODE>RuntimeErrorException</CODE> can
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   170
     * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   171
     * will not be registered.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * @exception MBeanException The constructor of the MBean has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * thrown an exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * @exception NotCompliantMBeanException This class is not a JMX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * compliant MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * @exception InstanceNotFoundException The specified class loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * is not registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * <CODE>java.lang.IllegalArgumentException</CODE>: The className
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * passed in parameter is null, the <CODE>ObjectName</CODE> passed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * in parameter contains a pattern or no <CODE>ObjectName</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * is specified for the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * talking to the MBean server.
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   185
     * @see javax.management.MBeanRegistration
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    public ObjectInstance createMBean(String className, ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                                      ObjectName loaderName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            throws ReflectionException, InstanceAlreadyExistsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                   MBeanRegistrationException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                   NotCompliantMBeanException, InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                   IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * Instantiates and registers an MBean in the MBean server.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * MBean server will use its {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * javax.management.loading.ClassLoaderRepository Default Loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Repository} to load the class of the MBean.  An object name is
1700
4506662fb2ee 6675526: Define an Annotation to name registered MBeans
jfdenise
parents: 1571
diff changeset
   200
     * associated with the MBean.  If the object name given is null, the
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   201
     * MBean must provide its own name by implementing the {@link
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * javax.management.MBeanRegistration MBeanRegistration} interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * and returning the name from the {@link
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   204
     * MBeanRegistration#preRegister preRegister} method.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * @param className The class name of the MBean to be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * @param name The object name of the MBean. May be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * @param params An array containing the parameters of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * constructor to be invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * @param signature An array containing the signature of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * constructor to be invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * @return An <CODE>ObjectInstance</CODE>, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * <CODE>ObjectName</CODE> and the Java class name of the newly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * instantiated MBean.  If the contained <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * is <code>n</code>, the contained Java class name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * <code>{@link #getMBeanInfo getMBeanInfo(n)}.getClassName()</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * @exception ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * <CODE>java.lang.ClassNotFoundException</CODE> or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * <CODE>java.lang.Exception</CODE> that occurred when trying to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * invoke the MBean's constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * @exception InstanceAlreadyExistsException The MBean is already
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * under the control of the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * @exception MBeanRegistrationException The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * <CODE>preRegister</CODE> (<CODE>MBeanRegistration</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * interface) method of the MBean has thrown an exception. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * MBean will not be registered.
1517
4ca99a6fc74e 6766173: Spec should say that createMBean wraps a constructor RuntimeException in a RuntimeMBeanException
emcmanus
parents: 1247
diff changeset
   229
     * @exception RuntimeMBeanException If the MBean's constructor or its
4ca99a6fc74e 6766173: Spec should say that createMBean wraps a constructor RuntimeException in a RuntimeMBeanException
emcmanus
parents: 1247
diff changeset
   230
     * {@code preRegister} or {@code postRegister} method threw
4ca99a6fc74e 6766173: Spec should say that createMBean wraps a constructor RuntimeException in a RuntimeMBeanException
emcmanus
parents: 1247
diff changeset
   231
     * a {@code RuntimeException}. If the <CODE>postRegister</CODE>
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   232
     * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws a
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   233
     * <CODE>RuntimeException</CODE>, the <CODE>createMBean</CODE> method will
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   234
     * throw a <CODE>RuntimeMBeanException</CODE>, although the MBean creation
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   235
     * and registration succeeded. In such a case, the MBean will be actually
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   236
     * registered even though the <CODE>createMBean</CODE> method
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   237
     * threw an exception.  Note that <CODE>RuntimeMBeanException</CODE> can
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   238
     * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   239
     * will not be registered.
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   240
     * @exception RuntimeErrorException If the <CODE>postRegister</CODE>
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   241
     * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws an
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   242
     * <CODE>Error</CODE>, the <CODE>createMBean</CODE> method will
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   243
     * throw a <CODE>RuntimeErrorException</CODE>, although the MBean creation
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   244
     * and registration succeeded. In such a case, the MBean will be actually
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   245
     * registered even though the <CODE>createMBean</CODE> method
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   246
     * threw an exception.  Note that <CODE>RuntimeErrorException</CODE> can
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   247
     * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   248
     * will not be registered.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * @exception MBeanException The constructor of the MBean has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * thrown an exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * @exception NotCompliantMBeanException This class is not a JMX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * compliant MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * <CODE>java.lang.IllegalArgumentException</CODE>: The className
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * passed in parameter is null, the <CODE>ObjectName</CODE> passed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * in parameter contains a pattern or no <CODE>ObjectName</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * is specified for the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * talking to the MBean server.
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   260
     * @see javax.management.MBeanRegistration
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    public ObjectInstance createMBean(String className, ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
                                      Object params[], String signature[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
            throws ReflectionException, InstanceAlreadyExistsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
                   MBeanRegistrationException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
                   NotCompliantMBeanException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    /**
1700
4506662fb2ee 6675526: Define an Annotation to name registered MBeans
jfdenise
parents: 1571
diff changeset
   269
     * <p>Instantiates and registers an MBean in the MBean server.  The
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * class loader to be used is identified by its object name. An
1700
4506662fb2ee 6675526: Define an Annotation to name registered MBeans
jfdenise
parents: 1571
diff changeset
   271
     * object name is associated with the MBean. If the object name of
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * the loader is not specified, the ClassLoader that loaded the
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   273
     * MBean server will be used.  If the MBean object name given is
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   274
     * null, the MBean must provide its own name by implementing the
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   275
     * {@link javax.management.MBeanRegistration MBeanRegistration}
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   276
     * interface and returning the name from the {@link
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   277
     * MBeanRegistration#preRegister preRegister} method.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * @param className The class name of the MBean to be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * @param name The object name of the MBean. May be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * @param params An array containing the parameters of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * constructor to be invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * @param signature An array containing the signature of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * constructor to be invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * @param loaderName The object name of the class loader to be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * @return An <CODE>ObjectInstance</CODE>, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * <CODE>ObjectName</CODE> and the Java class name of the newly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * instantiated MBean.  If the contained <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * is <code>n</code>, the contained Java class name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * <code>{@link #getMBeanInfo getMBeanInfo(n)}.getClassName()</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * @exception ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * <CODE>java.lang.ClassNotFoundException</CODE> or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * <CODE>java.lang.Exception</CODE> that occurred when trying to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * invoke the MBean's constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * @exception InstanceAlreadyExistsException The MBean is already
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * under the control of the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * @exception MBeanRegistrationException The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * <CODE>preRegister</CODE> (<CODE>MBeanRegistration</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * interface) method of the MBean has thrown an exception. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * MBean will not be registered.
1517
4ca99a6fc74e 6766173: Spec should say that createMBean wraps a constructor RuntimeException in a RuntimeMBeanException
emcmanus
parents: 1247
diff changeset
   303
     * @exception RuntimeMBeanException The MBean's constructor or its
4ca99a6fc74e 6766173: Spec should say that createMBean wraps a constructor RuntimeException in a RuntimeMBeanException
emcmanus
parents: 1247
diff changeset
   304
     * {@code preRegister} or {@code postRegister} method threw
4ca99a6fc74e 6766173: Spec should say that createMBean wraps a constructor RuntimeException in a RuntimeMBeanException
emcmanus
parents: 1247
diff changeset
   305
     * a {@code RuntimeException}. If the <CODE>postRegister</CODE>
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   306
     * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws a
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   307
     * <CODE>RuntimeException</CODE>, the <CODE>createMBean</CODE> method will
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   308
     * throw a <CODE>RuntimeMBeanException</CODE>, although the MBean creation
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   309
     * and registration succeeded. In such a case, the MBean will be actually
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   310
     * registered even though the <CODE>createMBean</CODE> method
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   311
     * threw an exception.  Note that <CODE>RuntimeMBeanException</CODE> can
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   312
     * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   313
     * will not be registered.
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   314
     * @exception RuntimeErrorException If the <CODE>postRegister</CODE> method
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   315
     * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws an
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   316
     * <CODE>Error</CODE>, the <CODE>createMBean</CODE> method will
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   317
     * throw a <CODE>RuntimeErrorException</CODE>, although the MBean creation
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   318
     * and registration succeeded. In such a case, the MBean will be actually
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   319
     * registered even though the <CODE>createMBean</CODE> method
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   320
     * threw an exception.  Note that <CODE>RuntimeErrorException</CODE> can
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   321
     * also be thrown by <CODE>preRegister</CODE>, in which case the MBean
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   322
     * will not be registered.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * @exception MBeanException The constructor of the MBean has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * thrown an exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * @exception NotCompliantMBeanException This class is not a JMX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * compliant MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * @exception InstanceNotFoundException The specified class loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * is not registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * <CODE>java.lang.IllegalArgumentException</CODE>: The className
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * passed in parameter is null, the <CODE>ObjectName</CODE> passed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * in parameter contains a pattern or no <CODE>ObjectName</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * is specified for the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * talking to the MBean server.
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   336
     * @see javax.management.MBeanRegistration
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
    public ObjectInstance createMBean(String className, ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
                                      ObjectName loaderName, Object params[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
                                      String signature[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
            throws ReflectionException, InstanceAlreadyExistsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
                   MBeanRegistrationException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
                   NotCompliantMBeanException, InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
                   IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * Unregisters an MBean from the MBean server. The MBean is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * identified by its object name. Once the method has been
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     * invoked, the MBean may no longer be accessed by its object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * @param name The object name of the MBean to be unregistered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * @exception InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * @exception MBeanRegistrationException The preDeregister
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     * ((<CODE>MBeanRegistration</CODE> interface) method of the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * has thrown an exception.
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   359
     * @exception RuntimeMBeanException If the <CODE>postDeregister</CODE>
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   360
     * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws a
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   361
     * <CODE>RuntimeException</CODE>, the <CODE>unregisterMBean</CODE> method
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   362
     * will throw a <CODE>RuntimeMBeanException</CODE>, although the MBean
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   363
     * unregistration succeeded. In such a case, the MBean will be actually
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   364
     * unregistered even though the <CODE>unregisterMBean</CODE> method
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   365
     * threw an exception.  Note that <CODE>RuntimeMBeanException</CODE> can
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   366
     * also be thrown by <CODE>preDeregister</CODE>, in which case the MBean
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   367
     * will remain registered.
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   368
     * @exception RuntimeErrorException If the <CODE>postDeregister</CODE>
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   369
     * (<CODE>MBeanRegistration</CODE> interface) method of the MBean throws an
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   370
     * <CODE>Error</CODE>, the <CODE>unregisterMBean</CODE> method will
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   371
     * throw a <CODE>RuntimeErrorException</CODE>, although the MBean
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   372
     * unregistration succeeded. In such a case, the MBean will be actually
1154
4561ee1fb2b7 6405862: Allow CompositeType to have zero items
emcmanus
parents: 1004
diff changeset
   373
     * unregistered even though the <CODE>unregisterMBean</CODE> method
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   374
     * threw an exception.  Note that <CODE>RuntimeMBeanException</CODE> can
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   375
     * also be thrown by <CODE>preDeregister</CODE>, in which case the MBean
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   376
     * will remain registered.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * name in parameter is null or the MBean you are when trying to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * unregister is the {@link javax.management.MBeanServerDelegate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * MBeanServerDelegate} MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * talking to the MBean server.
1002
1e6a1b77f22a 6730926: Document that create/registerMBean can throw RuntimeMBeanException from postRegister
dfuchs
parents: 833
diff changeset
   384
     * @see javax.management.MBeanRegistration
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    public void unregisterMBean(ObjectName name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
            throws InstanceNotFoundException, MBeanRegistrationException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
                   IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     * Gets the <CODE>ObjectInstance</CODE> for a given MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * registered with the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * @param name The object name of the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * @return The <CODE>ObjectInstance</CODE> associated with the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * specified by <VAR>name</VAR>.  The contained <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * is <code>name</code> and the contained class name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * <code>{@link #getMBeanInfo getMBeanInfo(name)}.getClassName()</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * @exception InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
    public ObjectInstance getObjectInstance(ObjectName name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
            throws InstanceNotFoundException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * Gets MBeans controlled by the MBean server. This method allows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * any of the following to be obtained: All MBeans, a set of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * MBeans specified by pattern matching on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * <CODE>ObjectName</CODE> and/or a Query expression, a specific
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * MBean. When the object name is null or no domain and key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * properties are specified, all objects are to be selected (and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * filtered if a query is specified). It returns the set of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * <CODE>ObjectInstance</CODE> objects (containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * <CODE>ObjectName</CODE> and the Java Class name) for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * selected MBeans.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * @param name The object name pattern identifying the MBeans to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * be retrieved. If null or no domain and key properties are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * specified, all the MBeans registered will be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * @param query The query expression to be applied for selecting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * MBeans. If null no query expression will be applied for
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   426
     * selecting MBeans.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * @return A set containing the <CODE>ObjectInstance</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * objects for the selected MBeans.  If no MBean satisfies the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * query an empty list is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
    public Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
            throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * Gets the names of MBeans controlled by the MBean server. This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * method enables any of the following to be obtained: The names
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     * of all MBeans, the names of a set of MBeans specified by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * pattern matching on the <CODE>ObjectName</CODE> and/or a Query
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * expression, a specific MBean name (equivalent to testing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * whether an MBean is registered). When the object name is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * or no domain and key properties are specified, all objects are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * selected (and filtered if a query is specified). It returns the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * set of ObjectNames for the MBeans selected.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * @param name The object name pattern identifying the MBean names
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * to be retrieved. If null or no domain and key properties are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     * specified, the name of all registered MBeans will be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * @param query The query expression to be applied for selecting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * MBeans. If null no query expression will be applied for
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   454
     * selecting MBeans.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * @return A set containing the ObjectNames for the MBeans
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * selected.  If no MBean satisfies the query, an empty list is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
    public Set<ObjectName> queryNames(ObjectName name, QueryExp query)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
            throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     * Checks whether an MBean, identified by its object name, is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     * already registered with the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * @param name The object name of the MBean to be checked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * @return True if the MBean is already registered in the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     * server, false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     * name in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
    public boolean isRegistered(ObjectName name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
            throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * Returns the number of MBeans registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * @return the number of MBeans registered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
    public Integer getMBeanCount()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
            throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * Gets the value of a specific attribute of a named MBean. The MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * is identified by its object name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * @param name The object name of the MBean from which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * attribute is to be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * @param attribute A String specifying the name of the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * to be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * @return  The value of the retrieved attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * @exception AttributeNotFoundException The attribute specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * is not accessible in the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     * @exception MBeanException Wraps an exception thrown by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * MBean's getter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     * @exception InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * @exception ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * <CODE>java.lang.Exception</CODE> thrown when trying to invoke
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     * the setter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * name in parameter is null or the attribute in parameter is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * @see #setAttribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
    public Object getAttribute(ObjectName name, String attribute)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
            throws MBeanException, AttributeNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
                   InstanceNotFoundException, ReflectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
                   IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
    /**
1571
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   534
     * <p>Retrieves the values of several attributes of a named MBean. The MBean
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   535
     * is identified by its object name.</p>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   536
     *
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   537
     * <p>If one or more attributes cannot be retrieved for some reason, they
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   538
     * will be omitted from the returned {@code AttributeList}.  The caller
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   539
     * should check that the list is the same size as the {@code attributes}
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   540
     * array.  To discover what problem prevented a given attribute from being
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   541
     * retrieved, call {@link #getAttribute getAttribute} for that attribute.</p>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   542
     *
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   543
     * <p>Here is an example of calling this method and checking that it
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   544
     * succeeded in retrieving all the requested attributes:</p>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   545
     *
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   546
     * <pre>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   547
     * String[] attrNames = ...;
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   548
     * AttributeList list = mbeanServerConnection.getAttributes(objectName, attrNames);
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   549
     * if (list.size() == attrNames.length)
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   550
     *     System.out.println("All attributes were retrieved successfully");
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   551
     * else {
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   552
     *     {@code List<String>} missing = new {@code ArrayList<String>}(<!--
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   553
     * -->{@link java.util.Arrays#asList Arrays.asList}(attrNames));
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   554
     *     for (Attribute a : list.asList())
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   555
     *         missing.remove(a.getName());
1571
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   556
     *     System.out.println("Did not retrieve: " + missing);
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   557
     * }
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   558
     * </pre>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * @param name The object name of the MBean from which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * attributes are retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     * @param attributes A list of the attributes to be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     * @return The list of the retrieved attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     * @exception InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * @exception ReflectionException An exception occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * trying to invoke the getAttributes method of a Dynamic MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     * @exception RuntimeOperationsException Wrap a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     * name in parameter is null or attributes in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     * @see #setAttributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
    public AttributeList getAttributes(ObjectName name, String[] attributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
            throws InstanceNotFoundException, ReflectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
                   IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
1571
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   582
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     * Sets the value of a specific attribute of a named MBean. The MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * is identified by its object name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     * @param name The name of the MBean within which the attribute is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     * to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     * @param attribute The identification of the attribute to be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * and the value it is to be set to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
     * @exception InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     * @exception AttributeNotFoundException The attribute specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * is not accessible in the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     * @exception InvalidAttributeValueException The value specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * for the attribute is not valid.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * @exception MBeanException Wraps an exception thrown by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     * MBean's setter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     * @exception ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     * <CODE>java.lang.Exception</CODE> thrown when trying to invoke
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     * the setter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     * name in parameter is null or the attribute in parameter is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
     * null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
     * @see #getAttribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
    public void setAttribute(ObjectName name, Attribute attribute)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
            throws InstanceNotFoundException, AttributeNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
                   InvalidAttributeValueException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
                   ReflectionException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
    /**
1571
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   619
     * <p>Sets the values of several attributes of a named MBean. The MBean is
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   620
     * identified by its object name.</p>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   621
     *
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   622
     * <p>If one or more attributes cannot be set for some reason, they will be
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   623
     * omitted from the returned {@code AttributeList}.  The caller should check
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   624
     * that the input {@code AttributeList} is the same size as the output one.
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   625
     * To discover what problem prevented a given attribute from being retrieved,
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   626
     * it will usually be possible to call {@link #setAttribute setAttribute}
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   627
     * for that attribute, although this is not guaranteed to work.  (For
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   628
     * example, the values of two attributes may have been rejected because
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   629
     * they were inconsistent with each other.  Setting one of them alone might
21656
d4c777ccb1db 8028014: Doclint warning/error cleanup in javax.management
rriggs
parents: 5506
diff changeset
   630
     * be allowed.)
1571
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   631
     *
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   632
     * <p>Here is an example of calling this method and checking that it
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   633
     * succeeded in setting all the requested attributes:</p>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   634
     *
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   635
     * <pre>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   636
     * AttributeList inputAttrs = ...;
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   637
     * AttributeList outputAttrs = mbeanServerConnection.setAttributes(<!--
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   638
     * -->objectName, inputAttrs);
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   639
     * if (inputAttrs.size() == outputAttrs.size())
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   640
     *     System.out.println("All attributes were set successfully");
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   641
     * else {
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   642
     *     {@code List<String>} missing = new {@code ArrayList<String>}();
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   643
     *     for (Attribute a : inputAttrs.asList())
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   644
     *         missing.add(a.getName());
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   645
     *     for (Attribute a : outputAttrs.asList())
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   646
     *         missing.remove(a.getName());
1571
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   647
     *     System.out.println("Did not set: " + missing);
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   648
     * }
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   649
     * </pre>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * @param name The object name of the MBean within which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
     * attributes are to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
     * @param attributes A list of attributes: The identification of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
     * the attributes to be set and the values they are to be set to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
     * @return The list of attributes that were set, with their new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
     * values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
     * @exception InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
     * @exception ReflectionException An exception occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     * trying to invoke the getAttributes method of a Dynamic MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     * name in parameter is null or attributes in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     * @see #getAttributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
    public AttributeList setAttributes(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
                                       AttributeList attributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
        throws InstanceNotFoundException, ReflectionException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
    /**
1571
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   676
     * <p>Invokes an operation on an MBean.</p>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   677
     *
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   678
     * <p>Because of the need for a {@code signature} to differentiate
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   679
     * possibly-overloaded operations, it is much simpler to invoke operations
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   680
     * through an {@linkplain JMX#newMBeanProxy(MBeanServerConnection, ObjectName,
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   681
     * Class) MBean proxy} where possible.  For example, suppose you have a
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   682
     * Standard MBean interface like this:</p>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   683
     *
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   684
     * <pre>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   685
     * public interface FooMBean {
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   686
     *     public int countMatches(String[] patterns, boolean ignoreCase);
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   687
     * }
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   688
     * </pre>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   689
     *
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   690
     * <p>The {@code countMatches} operation can be invoked as follows:</p>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   691
     *
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   692
     * <pre>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   693
     * String[] myPatterns = ...;
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   694
     * int count = (Integer) mbeanServerConnection.invoke(
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   695
     *         objectName,
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   696
     *         "countMatches",
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   697
     *         new Object[] {myPatterns, true},
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   698
     *         new String[] {String[].class.getName(), boolean.class.getName()});
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   699
     * </pre>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   700
     *
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   701
     * <p>Alternatively, it can be invoked through a proxy as follows:</p>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   702
     *
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   703
     * <pre>
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   704
     * String[] myPatterns = ...;
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   705
     * FooMBean fooProxy = JMX.newMBeanProxy(
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   706
     *         mbeanServerConnection, objectName, FooMBean.class);
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   707
     * int count = fooProxy.countMatches(myPatterns, true);
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   708
     * </pre>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     * @param name The object name of the MBean on which the method is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     * to be invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
     * @param operationName The name of the operation to be invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     * @param params An array containing the parameters to be set when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     * the operation is invoked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
     * @param signature An array containing the signature of the
1571
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   716
     * operation, an array of class names in the format returned by
421ef5172dd3 6336968: Methods to convert AttributeList to/from Map
emcmanus
parents: 1517
diff changeset
   717
     * {@link Class#getName()}. The class objects will be loaded using the same
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
     * class loader as the one used for loading the MBean on which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
     * operation was invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     * @return The object returned by the operation, which represents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     * the result of invoking the operation on the MBean specified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     * @exception InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     * @exception MBeanException Wraps an exception thrown by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
     * MBean's invoked method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
     * @exception ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
     * <CODE>java.lang.Exception</CODE> thrown while trying to invoke
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     * the method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
    public Object invoke(ObjectName name, String operationName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
                         Object params[], String signature[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
            throws InstanceNotFoundException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
                   ReflectionException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
     * Returns the default domain used for naming the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
     * The default domain name is used as the domain part in the ObjectName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
     * of MBeans if no domain is specified by the user.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
     * @return the default domain.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
    public String getDefaultDomain()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
            throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
     * <p>Returns the list of domains in which any MBean is currently
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
     * registered.  A string is in the returned array if and only if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
     * there is at least one MBean registered with an ObjectName whose
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
     * {@link ObjectName#getDomain() getDomain()} is equal to that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
     * string.  The order of strings within the returned array is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     * not defined.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     * @return the list of domains.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
    public String[] getDomains()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
            throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   772
    /**
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   773
     * <p>Adds a listener to a registered MBean.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   774
     * Notifications emitted by the MBean will be forwarded to the listener.</p>
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   775
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   776
     * @param name The name of the MBean on which the listener should
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   777
     * be added.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   778
     * @param listener The listener object which will handle the
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   779
     * notifications emitted by the registered MBean.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   780
     * @param filter The filter object. If filter is null, no
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   781
     * filtering will be performed before handling notifications.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   782
     * @param handback The context to be sent to the listener when a
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   783
     * notification is emitted.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   784
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   785
     * @exception InstanceNotFoundException The MBean name provided
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   786
     * does not match any of the registered MBeans.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   787
     * @exception IOException A communication problem occurred when
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   788
     * talking to the MBean server.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   789
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   790
     * @see #removeNotificationListener(ObjectName, NotificationListener)
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   791
     * @see #removeNotificationListener(ObjectName, NotificationListener,
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   792
     * NotificationFilter, Object)
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   793
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
    public void addNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
                                        NotificationListener listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
                                        NotificationFilter filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
                                        Object handback)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
            throws InstanceNotFoundException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
     * <p>Adds a listener to a registered MBean.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
     * <p>A notification emitted by an MBean will be forwarded by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
     * MBeanServer to the listener.  If the source of the notification
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
     * is a reference to an MBean object, the MBean server will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
     * replace it by that MBean's ObjectName.  Otherwise the source is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
     * unchanged.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
     * <p>The listener object that receives notifications is the one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
     * that is registered with the given name at the time this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
     * is called.  Even if it is subsequently unregistered, it will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
     * continue to receive notifications.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
     * @param name The name of the MBean on which the listener should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
     * be added.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
     * @param listener The object name of the listener which will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
     * handle the notifications emitted by the registered MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
     * @param filter The filter object. If filter is null, no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
     * filtering will be performed before handling notifications.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
     * @param handback The context to be sent to the listener when a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
     * notification is emitted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     * @exception InstanceNotFoundException The MBean name of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     * notification listener or of the notification broadcaster does
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     * not match any of the registered MBeans.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
     * @exception RuntimeOperationsException Wraps an {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
     * IllegalArgumentException}.  The MBean named by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
     * <code>listener</code> exists but does not implement the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
     * NotificationListener} interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
     * @see #removeNotificationListener(ObjectName, ObjectName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
     * @see #removeNotificationListener(ObjectName, ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
     * NotificationFilter, Object)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
    public void addNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
                                        ObjectName listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
                                        NotificationFilter filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
                                        Object handback)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
            throws InstanceNotFoundException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
     * Removes a listener from a registered MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
     * <P> If the listener is registered more than once, perhaps with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
     * different filters or callbacks, this method will remove all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
     * those registrations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
     * @param name The name of the MBean on which the listener should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
     * be removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     * @param listener The object name of the listener to be removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
     * @exception InstanceNotFoundException The MBean name provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
     * does not match any of the registered MBeans.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
     * @exception ListenerNotFoundException The listener is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
     * registered in the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
     * @see #addNotificationListener(ObjectName, ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
     * NotificationFilter, Object)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
    public void removeNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
                                           ObjectName listener)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
        throws InstanceNotFoundException, ListenerNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
               IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
     * <p>Removes a listener from a registered MBean.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
     * <p>The MBean must have a listener that exactly matches the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
     * given <code>listener</code>, <code>filter</code>, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
     * <code>handback</code> parameters.  If there is more than one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
     * such listener, only one is removed.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
     * <p>The <code>filter</code> and <code>handback</code> parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
     * may be null if and only if they are null in a listener to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
     * removed.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
     * @param name The name of the MBean on which the listener should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
     * be removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
     * @param listener The object name of the listener to be removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
     * @param filter The filter that was specified when the listener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
     * was added.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
     * @param handback The handback that was specified when the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
     * listener was added.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
     * @exception InstanceNotFoundException The MBean name provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
     * does not match any of the registered MBeans.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
     * @exception ListenerNotFoundException The listener is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
     * registered in the MBean, or it is not registered with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
     * filter and handback.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
     * @see #addNotificationListener(ObjectName, ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
     * NotificationFilter, Object)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
    public void removeNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
                                           ObjectName listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
                                           NotificationFilter filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
                                           Object handback)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
            throws InstanceNotFoundException, ListenerNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
                   IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   910
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   911
    /**
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   912
     * <p>Removes a listener from a registered MBean.</p>
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   913
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   914
     * <P> If the listener is registered more than once, perhaps with
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   915
     * different filters or callbacks, this method will remove all
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   916
     * those registrations.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   917
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   918
     * @param name The name of the MBean on which the listener should
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   919
     * be removed.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   920
     * @param listener The listener to be removed.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   921
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   922
     * @exception InstanceNotFoundException The MBean name provided
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   923
     * does not match any of the registered MBeans.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   924
     * @exception ListenerNotFoundException The listener is not
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   925
     * registered in the MBean.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   926
     * @exception IOException A communication problem occurred when
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   927
     * talking to the MBean server.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   928
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   929
     * @see #addNotificationListener(ObjectName, NotificationListener,
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   930
     * NotificationFilter, Object)
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   931
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
    public void removeNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
                                           NotificationListener listener)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
            throws InstanceNotFoundException, ListenerNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
                   IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
4156
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   937
    /**
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   938
     * <p>Removes a listener from a registered MBean.</p>
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   939
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   940
     * <p>The MBean must have a listener that exactly matches the
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   941
     * given <code>listener</code>, <code>filter</code>, and
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   942
     * <code>handback</code> parameters.  If there is more than one
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   943
     * such listener, only one is removed.</p>
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   944
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   945
     * <p>The <code>filter</code> and <code>handback</code> parameters
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   946
     * may be null if and only if they are null in a listener to be
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   947
     * removed.</p>
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   948
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   949
     * @param name The name of the MBean on which the listener should
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   950
     * be removed.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   951
     * @param listener The listener to be removed.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   952
     * @param filter The filter that was specified when the listener
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   953
     * was added.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   954
     * @param handback The handback that was specified when the
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   955
     * listener was added.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   956
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   957
     * @exception InstanceNotFoundException The MBean name provided
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   958
     * does not match any of the registered MBeans.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   959
     * @exception ListenerNotFoundException The listener is not
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   960
     * registered in the MBean, or it is not registered with the given
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   961
     * filter and handback.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   962
     * @exception IOException A communication problem occurred when
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   963
     * talking to the MBean server.
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   964
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   965
     * @see #addNotificationListener(ObjectName, NotificationListener,
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   966
     * NotificationFilter, Object)
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   967
     *
acaa49a2768a 6851617: Remove JSR 255 (JMX API 2.0) from JDK 7
emcmanus
parents: 1709
diff changeset
   968
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
    public void removeNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
                                           NotificationListener listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
                                           NotificationFilter filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
                                           Object handback)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
            throws InstanceNotFoundException, ListenerNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
                   IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
     * This method discovers the attributes and operations that an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
     * MBean exposes for management.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
     * @param name The name of the MBean to analyze
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
     * @return An instance of <CODE>MBeanInfo</CODE> allowing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
     * retrieval of all attributes and operations of this MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
     * @exception IntrospectionException An exception occurred during
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
     * introspection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
     * @exception InstanceNotFoundException The MBean specified was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
     * not found.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
     * @exception ReflectionException An exception occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
     * trying to invoke the getMBeanInfo of a Dynamic MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
    public MBeanInfo getMBeanInfo(ObjectName name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
            throws InstanceNotFoundException, IntrospectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
                   ReflectionException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
     * <p>Returns true if the MBean specified is an instance of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
     * specified class, false otherwise.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
     * <p>If <code>name</code> does not name an MBean, this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
     * throws {@link InstanceNotFoundException}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
     * <p>Otherwise, let<br>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
     * X be the MBean named by <code>name</code>,<br>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
     * L be the ClassLoader of X,<br>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
     * N be the class name in X's {@link MBeanInfo}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
     * <p>If N equals <code>className</code>, the result is true.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
     * <p>Otherwise, if L successfully loads <code>className</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
     * and X is an instance of this class, the result is true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
     * <p>Otherwise, if L successfully loads both N and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
     * <code>className</code>, and the second class is assignable from
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
     * the first, the result is true.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
     * <p>Otherwise, the result is false.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
     * @param name The <CODE>ObjectName</CODE> of the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
     * @param className The name of the class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
     * @return true if the MBean specified is an instance of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
     * specified class according to the rules above, false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
     * @exception InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
     * @exception IOException A communication problem occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
     * talking to the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
     * @see Class#isInstance
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
    public boolean isInstanceOf(ObjectName name, String className)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
            throws InstanceNotFoundException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
}