jdk/src/share/classes/javax/management/MBeanServer.java
author emcmanus
Fri, 21 Mar 2008 09:49:40 +0100
changeset 267 d436a8afbbd3
parent 2 90ce3da70b43
child 833 bfa2bef7517c
child 715 f16baef3a20e
permissions -rw-r--r--
6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted Summary: Make spec more readable by adding cross-references. Suggested by Andrew Haley. Reviewed-by: dfuchs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
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
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
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.util.Set;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.ObjectInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
// RI import
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import javax.management.loading.ClassLoaderRepository;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * <p>This is the interface for MBean manipulation on the agent
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * side. It contains the methods necessary for the creation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * registration, and deletion of MBeans as well as the access methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * for registered MBeans.  This is the core component of the JMX
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * infrastructure.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * <p>User code does not usually implement this interface.  Instead,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * an object that implements this interface is obtained with one of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * the methods in the {@link MBeanServerFactory} class.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <p>Every MBean which is added to the MBean server becomes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * manageable: its attributes and operations become remotely
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * accessible through the connectors/adaptors connected to that MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * server.  A Java object cannot be registered in the MBean server
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * unless it is a JMX compliant MBean.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *
267
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
    53
 * <p id="notif">When an MBean is registered or unregistered in the MBean server
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * a {@link javax.management.MBeanServerNotification
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * MBeanServerNotification} Notification is emitted. To register an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * object as listener to MBeanServerNotifications you should call the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * MBean server method {@link #addNotificationListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * addNotificationListener} with <CODE>ObjectName</CODE> the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * <CODE>ObjectName</CODE> of the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * javax.management.MBeanServerDelegate MBeanServerDelegate}.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * <CODE>ObjectName</CODE> is: <BR>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * <CODE>JMImplementation:type=MBeanServerDelegate</CODE>.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * <p>An object obtained from the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * MBeanServerFactory#createMBeanServer(String) createMBeanServer} or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * {@link MBeanServerFactory#newMBeanServer(String) newMBeanServer}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * methods of the {@link MBeanServerFactory} class applies security
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * checks to its methods, as follows.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * <p>First, if there is no security manager ({@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * System#getSecurityManager()} is null), then an implementation of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * this interface is free not to make any checks.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * <p>Assuming that there is a security manager, or that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * implementation chooses to make checks anyway, the checks are made
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * as detailed below.  In what follows, <code>className</code> is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * string returned by {@link MBeanInfo#getClassName()} for the target
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * MBean.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * <p>If a security check fails, the method throws {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * SecurityException}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * <p>For methods that can throw {@link InstanceNotFoundException},
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * this exception is thrown for a non-existent MBean, regardless of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * permissions.  This is because a non-existent MBean has no
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 * <code>className</code>.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * <li><p>For the {@link #invoke invoke} method, the caller's
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 * permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * MBeanPermission(className, operationName, name, "invoke")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * <li><p>For the {@link #getAttribute getAttribute} method, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 * MBeanPermission(className, attribute, name, "getAttribute")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 * <li><p>For the {@link #getAttributes getAttributes} method, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 * caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 * MBeanPermission(className, null, name, "getAttribute")}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 * Additionally, for each attribute <em>a</em> in the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 * AttributeList}, if the caller's permissions do not imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
 * MBeanPermission(className, <em>a</em>, name, "getAttribute")}, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
 * MBean server will behave as if that attribute had not been in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
 * supplied list.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
 * <li><p>For the {@link #setAttribute setAttribute} method, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 * caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
 * MBeanPermission(className, attrName, name, "setAttribute")}, where
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 * <code>attrName</code> is {@link Attribute#getName()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
 * attribute.getName()}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 * <li><p>For the {@link #setAttributes setAttributes} method, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 * caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 * MBeanPermission(className, null, name, "setAttribute")}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 * Additionally, for each attribute <em>a</em> in the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
 * AttributeList}, if the caller's permissions do not imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
 * MBeanPermission(className, <em>a</em>, name, "setAttribute")}, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
 * MBean server will behave as if that attribute had not been in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
 * supplied list.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
 * <li><p>For the <code>addNotificationListener</code> methods,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
 * the caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
 * MBeanPermission(className, null, name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
 * "addNotificationListener")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
 * <li><p>For the <code>removeNotificationListener</code> methods,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
 * the caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
 * MBeanPermission(className, null, name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
 * "removeNotificationListener")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
 * <li><p>For the {@link #getMBeanInfo getMBeanInfo} method, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
 * caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
 * MBeanPermission(className, null, name, "getMBeanInfo")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
 * <li><p>For the {@link #getObjectInstance getObjectInstance} method,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
 * the caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
 * MBeanPermission(className, null, name, "getObjectInstance")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
 * <li><p>For the {@link #isInstanceOf isInstanceOf} method, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
 * caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
 * MBeanPermission(className, null, name, "isInstanceOf")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
 * <li><p>For the {@link #queryMBeans queryMBeans} method, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
 * caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
 * MBeanPermission(null, null, name, "queryMBeans")}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
 * Additionally, for each MBean that matches <code>name</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
 * if the caller's permissions do not imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
 * MBeanPermission(className, null, name, "queryMBeans")}, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
 * MBean server will behave as if that MBean did not exist.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
 * <p>Certain query elements perform operations on the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
 * If the caller does not have the required permissions for a given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
 * MBean, that MBean will not be included in the result of the query.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
 * The standard query elements that are affected are {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
 * Query#attr(String)}, {@link Query#attr(String,String)}, and {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
 * Query#classattr()}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
 * <li><p>For the {@link #queryNames queryNames} method, the checks
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
 * are the same as for <code>queryMBeans</code> except that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
 * <code>"queryNames"</code> is used instead of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
 * <code>"queryMBeans"</code> in the <code>MBeanPermission</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
 * objects.  Note that a <code>"queryMBeans"</code> permission implies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
 * the corresponding <code>"queryNames"</code> permission.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
 * <li><p>For the {@link #getDomains getDomains} method, the caller's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
 * permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
 * MBeanPermission(null, null, name, "getDomains")}.  Additionally,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
 * for each domain <var>d</var> in the returned array, if the caller's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
 * permissions do not imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
 * MBeanPermission(null, null, new ObjectName("<var>d</var>:x=x"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
 * "getDomains")}, the domain is eliminated from the array.  Here,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
 * <code>x=x</code> is any <var>key=value</var> pair, needed to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
 * satisfy ObjectName's constructor but not otherwise relevant.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
 * <li><p>For the {@link #getClassLoader getClassLoader} method, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
 * caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
 * MBeanPermission(className, null, loaderName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
 * "getClassLoader")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
 * <li><p>For the {@link #getClassLoaderFor getClassLoaderFor} method,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
 * the caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
 * MBeanPermission(className, null, mbeanName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
 * "getClassLoaderFor")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
 * <li><p>For the {@link #getClassLoaderRepository
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
 * getClassLoaderRepository} method, the caller's permissions must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
 * imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
 * MBeanPermission(null, null, null, "getClassLoaderRepository")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
 * <li><p>For the deprecated <code>deserialize</code> methods, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
 * required permissions are the same as for the methods that replace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
 * them.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
 * <li><p>For the <code>instantiate</code> methods, the caller's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
 * permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
 * MBeanPermission(className, null, null, "instantiate")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
 * <li><p>For the {@link #registerMBean registerMBean} method, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
 * caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
 * MBeanPermission(className, null, name, "registerMBean")}.  Here
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
 * <code>className</code> is the string returned by {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
 * MBeanInfo#getClassName()} for an object of this class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
 * <p>If the <code>MBeanPermission</code> check succeeds, the MBean's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
 * class is validated by checking that its {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
 * java.security.ProtectionDomain ProtectionDomain} implies {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
 * MBeanTrustPermission#MBeanTrustPermission(String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
 * MBeanTrustPermission("register")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
 * <p>Finally, if the <code>name</code> argument is null, another
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
 * <code>MBeanPermission</code> check is made using the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
 * <code>ObjectName</code> returned by {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
 * MBeanRegistration#preRegister MBeanRegistration.preRegister}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
 * <li><p>For the <code>createMBean</code> methods, the caller's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
 * permissions must imply the permissions needed by the equivalent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
 * <code>instantiate</code> followed by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
 * <code>registerMBean</code>.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
 * <li><p>For the {@link #unregisterMBean unregisterMBean} method,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
 * the caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
 * MBeanPermission(className, null, name, "unregisterMBean")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
 * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
/* DELETED:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
 * <li><p>For the {@link #isRegistered isRegistered} method, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
 * caller's permissions must imply {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
 * MBeanPermission#MBeanPermission(String,String,ObjectName,String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
 * MBeanPermission(null, null, name, "isRegistered")}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
public interface MBeanServer extends MBeanServerConnection {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
267
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   261
    /**
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   262
     * {@inheritDoc}
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   263
     * <p>If this method successfully creates an MBean, a notification
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   264
     * is sent as described <a href="#notif">above</a>.</p>
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   265
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
    public ObjectInstance createMBean(String className, ObjectName name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
            throws ReflectionException, InstanceAlreadyExistsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
                   MBeanRegistrationException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
                   NotCompliantMBeanException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
267
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   271
    /**
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   272
     * {@inheritDoc}
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   273
     * <p>If this method successfully creates an MBean, a notification
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   274
     * is sent as described <a href="#notif">above</a>.</p>
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   275
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    public ObjectInstance createMBean(String className, ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
                                      ObjectName loaderName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
            throws ReflectionException, InstanceAlreadyExistsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
                   MBeanRegistrationException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
                   NotCompliantMBeanException, InstanceNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
267
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   282
    /**
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   283
     * {@inheritDoc}
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   284
     * <p>If this method successfully creates an MBean, a notification
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   285
     * is sent as described <a href="#notif">above</a>.</p>
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   286
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    public ObjectInstance createMBean(String className, ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
                                      Object params[], String signature[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
            throws ReflectionException, InstanceAlreadyExistsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
                   MBeanRegistrationException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
                   NotCompliantMBeanException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
267
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   293
    /**
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   294
     * {@inheritDoc}
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   295
     * <p>If this method successfully creates an MBean, a notification
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   296
     * is sent as described <a href="#notif">above</a>.</p>
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   297
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    public ObjectInstance createMBean(String className, ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
                                      ObjectName loaderName, Object params[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
                                      String signature[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
            throws ReflectionException, InstanceAlreadyExistsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
                   MBeanRegistrationException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
                   NotCompliantMBeanException, InstanceNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    /**
267
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   306
     * <p>Registers a pre-existing object as an MBean with the MBean
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * server. If the object name given is null, the MBean must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * provide its own name by implementing the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * javax.management.MBeanRegistration MBeanRegistration} interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * and returning the name from the {@link
267
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   311
     * MBeanRegistration#preRegister preRegister} method.</p>
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   312
     *
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   313
     * <p>If this method successfully registers an MBean, a notification
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   314
     * is sent as described <a href="#notif">above</a>.</p>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * @param object The  MBean to be registered as an MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * @param name The object name of the MBean. May be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * @return An <CODE>ObjectInstance</CODE>, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * <CODE>ObjectName</CODE> and the Java class name of the newly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * registered MBean.  If the contained <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * is <code>n</code>, the contained Java class name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * <code>{@link #getMBeanInfo getMBeanInfo(n)}.getClassName()</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * @exception InstanceAlreadyExistsException The MBean is already
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * under the control of the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * @exception MBeanRegistrationException The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * <CODE>preRegister</CODE> (<CODE>MBeanRegistration</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * interface) method of the MBean has thrown an exception. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * MBean will not be registered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * @exception NotCompliantMBeanException This object is not a JMX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * compliant MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * <CODE>java.lang.IllegalArgumentException</CODE>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * passed in parameter is null or no object name is specified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
    public ObjectInstance registerMBean(Object object, ObjectName name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
            throws InstanceAlreadyExistsException, MBeanRegistrationException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
                   NotCompliantMBeanException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
267
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   341
    /**
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   342
     * {@inheritDoc}
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   343
     *
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   344
     * <p>If this method successfully unregisters an MBean, a notification
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   345
     * is sent as described <a href="#notif">above</a>.</p>
d436a8afbbd3 6649542: Document explicitly in registerMBean etc that MBeanServerNotification is emitted
emcmanus
parents: 2
diff changeset
   346
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
    public void unregisterMBean(ObjectName name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
            throws InstanceNotFoundException, MBeanRegistrationException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
    public ObjectInstance getObjectInstance(ObjectName name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
            throws InstanceNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
    public Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
    public Set<ObjectName> queryNames(ObjectName name, QueryExp query);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
    public boolean isRegistered(ObjectName name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * Returns the number of MBeans registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * @return the number of registered MBeans, wrapped in an Integer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * If the caller's permissions are restricted, this number may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * be greater than the number of MBeans the caller can access.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    public Integer getMBeanCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    public Object getAttribute(ObjectName name, String attribute)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
            throws MBeanException, AttributeNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
                   InstanceNotFoundException, ReflectionException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
    public AttributeList getAttributes(ObjectName name, String[] attributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
            throws InstanceNotFoundException, ReflectionException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
    public void setAttribute(ObjectName name, Attribute attribute)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
            throws InstanceNotFoundException, AttributeNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
                   InvalidAttributeValueException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
                   ReflectionException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    public AttributeList setAttributes(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
                                       AttributeList attributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
        throws InstanceNotFoundException, ReflectionException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
    public Object invoke(ObjectName name, String operationName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
                         Object params[], String signature[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
            throws InstanceNotFoundException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
                   ReflectionException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
    public String getDefaultDomain();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
    public String[] getDomains();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
    public void addNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
                                        NotificationListener listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
                                        NotificationFilter filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
                                        Object handback)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
            throws InstanceNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
    public void addNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
                                        ObjectName listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
                                        NotificationFilter filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
                                        Object handback)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
            throws InstanceNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    public void removeNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
                                           ObjectName listener)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
        throws InstanceNotFoundException, ListenerNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
    public void removeNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
                                           ObjectName listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
                                           NotificationFilter filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
                                           Object handback)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
            throws InstanceNotFoundException, ListenerNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
    public void removeNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
                                           NotificationListener listener)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
            throws InstanceNotFoundException, ListenerNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
    public void removeNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
                                           NotificationListener listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
                                           NotificationFilter filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
                                           Object handback)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
            throws InstanceNotFoundException, ListenerNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    public MBeanInfo getMBeanInfo(ObjectName name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
            throws InstanceNotFoundException, IntrospectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
                   ReflectionException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
    // doc comment inherited from MBeanServerConnection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
    public boolean isInstanceOf(ObjectName name, String className)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
            throws InstanceNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * <p>Instantiates an object using the list of all class loaders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * registered in the MBean server's {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * javax.management.loading.ClassLoaderRepository Class Loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * Repository}.  The object's class should have a public
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * constructor.  This method returns a reference to the newly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * created object.  The newly created object is not registered in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * the MBean server.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * <p>This method is equivalent to {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * #instantiate(String,Object[],String[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * instantiate(className, (Object[]) null, (String[]) null)}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * @param className The class name of the object to be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * @return The newly instantiated object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     * @exception ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     * <CODE>java.lang.ClassNotFoundException</CODE> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * <CODE>java.lang.Exception</CODE> that occurred when trying to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * invoke the object's constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * @exception MBeanException The constructor of the object has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * thrown an exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * <CODE>java.lang.IllegalArgumentException</CODE>: The className
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     * passed in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
    public Object instantiate(String className)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
            throws ReflectionException, MBeanException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     * <p>Instantiates an object using the class Loader specified by its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     * <CODE>ObjectName</CODE>.  If the loader name is null, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     * ClassLoader that loaded the MBean Server will be used.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     * object's class should have a public constructor.  This method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * returns a reference to the newly created object.  The newly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * created object is not registered in the MBean server.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * <p>This method is equivalent to {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * #instantiate(String,ObjectName,Object[],String[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * instantiate(className, loaderName, (Object[]) null, (String[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     * null)}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     * @param className The class name of the MBean to be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     * @param loaderName The object name of the class loader to be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * @return The newly instantiated object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * @exception ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * <CODE>java.lang.ClassNotFoundException</CODE> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * <CODE>java.lang.Exception</CODE> that occurred when trying to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * invoke the object's constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * @exception MBeanException The constructor of the object has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * thrown an exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * @exception InstanceNotFoundException The specified class loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     * is not registered in the MBeanServer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * <CODE>java.lang.IllegalArgumentException</CODE>: The className
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     * passed in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
    public Object instantiate(String className, ObjectName loaderName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
            throws ReflectionException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
                   InstanceNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * <p>Instantiates an object using the list of all class loaders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * registered in the MBean server {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * javax.management.loading.ClassLoaderRepository Class Loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * Repository}.  The object's class should have a public
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * constructor.  The call returns a reference to the newly created
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * object.  The newly created object is not registered in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     * MBean server.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     * @param className The class name of the object to be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     * @param params An array containing the parameters of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     * constructor to be invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * @param signature An array containing the signature of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * constructor to be invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * @return The newly instantiated object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * @exception ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     * <CODE>java.lang.ClassNotFoundException</CODE> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     * <CODE>java.lang.Exception</CODE> that occurred when trying to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * invoke the object's constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * @exception MBeanException The constructor of the object has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * thrown an exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * <CODE>java.lang.IllegalArgumentException</CODE>: The className
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * passed in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
    public Object instantiate(String className, Object params[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
                              String signature[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
            throws ReflectionException, MBeanException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * <p>Instantiates an object. The class loader to be used is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     * identified by its object name. If the object name of the loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     * is null, the ClassLoader that loaded the MBean server will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     * used.  The object's class should have a public constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     * The call returns a reference to the newly created object.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     * newly created object is not registered in the MBean server.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * @param className The class name of the object to be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * @param params An array containing the parameters of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     * constructor to be invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     * @param signature An array containing the signature of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * constructor to be invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * @param loaderName The object name of the class loader to be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     * @return The newly instantiated object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     * @exception ReflectionException Wraps a <CODE>java.lang.ClassNotFoundException</CODE> or the <CODE>java.lang.Exception</CODE> that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     * occurred when trying to invoke the object's constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     * @exception MBeanException The constructor of the object has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * thrown an exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * @exception InstanceNotFoundException The specified class loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     * is not registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     * @exception RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     * <CODE>java.lang.IllegalArgumentException</CODE>: The className
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     * passed in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
    public Object instantiate(String className, ObjectName loaderName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
                              Object params[], String signature[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
            throws ReflectionException, MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
                   InstanceNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     * <p>De-serializes a byte array in the context of the class loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     * of an MBean.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     * @param name The name of the MBean whose class loader should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * used for the de-serialization.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     * @param data The byte array to be de-sererialized.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     * @return The de-serialized object stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * @exception InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     * found.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
     * @exception OperationsException Any of the usual Input/Output
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * related exceptions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * @deprecated Use {@link #getClassLoaderFor getClassLoaderFor} to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     * obtain the appropriate class loader for deserialization.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
    public ObjectInputStream deserialize(ObjectName name, byte[] data)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
            throws InstanceNotFoundException, OperationsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     * <p>De-serializes a byte array in the context of a given MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     * class loader.  The class loader is found by loading the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
     * <code>className</code> through the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
     * javax.management.loading.ClassLoaderRepository Class Loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
     * Repository}.  The resultant class's class loader is the one to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
     * use.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     * @param className The name of the class whose class loader should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
     * used for the de-serialization.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
     * @param data The byte array to be de-sererialized.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
     * @return  The de-serialized object stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     * @exception OperationsException Any of the usual Input/Output
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     * related exceptions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
     * @exception ReflectionException The specified class could not be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
     * loaded by the class loader repository
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * @deprecated Use {@link #getClassLoaderRepository} to obtain the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * class loader repository and use it to deserialize.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
    public ObjectInputStream deserialize(String className, byte[] data)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
            throws OperationsException, ReflectionException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
     * <p>De-serializes a byte array in the context of a given MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
     * class loader.  The class loader is the one that loaded the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
     * class with name "className".  The name of the class loader to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
     * be used for loading the specified class is specified.  If null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
     * the MBean Server's class loader will be used.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
     * @param className The name of the class whose class loader should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
     * used for the de-serialization.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
     * @param data The byte array to be de-sererialized.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
     * @param loaderName The name of the class loader to be used for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     * loading the specified class.  If null, the MBean Server's class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
     * loader will be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
     * @return  The de-serialized object stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     * @exception InstanceNotFoundException The specified class loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     * MBean is not found.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     * @exception OperationsException Any of the usual Input/Output
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
     * related exceptions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     * @exception ReflectionException The specified class could not be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * loaded by the specified class loader.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
     * @deprecated Use {@link #getClassLoader getClassLoader} to obtain
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
     * the class loader for deserialization.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
    public ObjectInputStream deserialize(String className,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
                                         ObjectName loaderName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
                                         byte[] data)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
            throws InstanceNotFoundException, OperationsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
                   ReflectionException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     * <p>Return the {@link java.lang.ClassLoader} that was used for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     * loading the class of the named MBean.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     * @param mbeanName The ObjectName of the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     * @return The ClassLoader used for that MBean.  If <var>l</var>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
     * is the MBean's actual ClassLoader, and <var>r</var> is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
     * returned value, then either:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
     * <li><var>r</var> is identical to <var>l</var>; or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
     * <li>the result of <var>r</var>{@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
     * ClassLoader#loadClass(String) .loadClass(<var>s</var>)} is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
     * same as <var>l</var>{@link ClassLoader#loadClass(String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
     * .loadClass(<var>s</var>)} for any string <var>s</var>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
     * What this means is that the ClassLoader may be wrapped in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     * another ClassLoader for security or other reasons.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
     * @exception InstanceNotFoundException if the named MBean is not found.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
    public ClassLoader getClassLoaderFor(ObjectName mbeanName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
        throws InstanceNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
     * <p>Return the named {@link java.lang.ClassLoader}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
     * @param loaderName The ObjectName of the ClassLoader.  May be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
     * null, in which case the MBean server's own ClassLoader is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
     * @return The named ClassLoader.  If <var>l</var> is the actual
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
     * ClassLoader with that name, and <var>r</var> is the returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
     * value, then either:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
     * <li><var>r</var> is identical to <var>l</var>; or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
     * <li>the result of <var>r</var>{@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
     * ClassLoader#loadClass(String) .loadClass(<var>s</var>)} is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     * same as <var>l</var>{@link ClassLoader#loadClass(String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     * .loadClass(<var>s</var>)} for any string <var>s</var>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     * What this means is that the ClassLoader may be wrapped in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     * another ClassLoader for security or other reasons.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
     * @exception InstanceNotFoundException if the named ClassLoader is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     *    not found.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
    public ClassLoader getClassLoader(ObjectName loaderName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
        throws InstanceNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     * <p>Return the ClassLoaderRepository for this MBeanServer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     * @return The ClassLoaderRepository for this MBeanServer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
    public ClassLoaderRepository getClassLoaderRepository();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
}