src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnection.java
author serb
Sat, 09 Jun 2018 13:33:35 -0700
changeset 50647 a98ff7c2103d
parent 47216 71c04702a3d5
permissions -rw-r--r--
6608234: SwingWorker.get throws CancellationException Reviewed-by: psadhukhan, kaddepalli, prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
46050
f51c14dc540f 8181895: javax management docs contain links to technotes
uvangapally
parents: 43503
diff changeset
     2
 * Copyright (c) 2002, 2017, 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: 1639
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: 1639
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: 1639
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1639
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1639
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.remote.rmi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.io.Closeable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.rmi.MarshalledObject;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.rmi.Remote;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.util.Set;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import javax.management.AttributeList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import javax.management.AttributeNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.management.InstanceAlreadyExistsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import javax.management.InstanceNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import javax.management.IntrospectionException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import javax.management.InvalidAttributeValueException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import javax.management.ListenerNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import javax.management.MBeanException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
import javax.management.MBeanInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import javax.management.MBeanRegistrationException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import javax.management.MBeanServerConnection;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import javax.management.NotCompliantMBeanException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
import javax.management.ObjectInstance;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
import javax.management.ObjectName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
import javax.management.ReflectionException;
1510
e747d3193ef2 6763639: Remove "rawtypes" warnings from JMX code
emcmanus
parents: 2
diff changeset
    50
import javax.management.RuntimeMBeanException;
e747d3193ef2 6763639: Remove "rawtypes" warnings from JMX code
emcmanus
parents: 2
diff changeset
    51
import javax.management.RuntimeOperationsException;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
import javax.management.remote.NotificationResult;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
import javax.security.auth.Subject;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * <p>RMI object used to forward an MBeanServer request from a client
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * to its MBeanServer implementation on the server side.  There is one
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * Remote object implementing this interface for each remote client
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * connected to an RMI connector.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * <p>User code does not usually refer to this interface.  It is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * specified as part of the public API so that different
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * implementations of that API will interoperate.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * <p>To ensure that client parameters will be deserialized at the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * server side with the correct classloader, client parameters such as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * parameters used to invoke a method are wrapped in a {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * MarshalledObject}.  An implementation of this interface must first
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * get the appropriate class loader for the operation and its target,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * then deserialize the marshalled parameters with this classloader.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * Except as noted, a parameter that is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * <code>MarshalledObject</code> or <code>MarshalledObject[]</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * must not be null; the behavior is unspecified if it is.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * <p>Class loading aspects are detailed in the
46050
f51c14dc540f 8181895: javax management docs contain links to technotes
uvangapally
parents: 43503
diff changeset
    76
 * <a href="https://jcp.org/aboutJava/communityprocess/mrel/jsr160/index2.html">
f51c14dc540f 8181895: javax management docs contain links to technotes
uvangapally
parents: 43503
diff changeset
    77
 * JMX Specification, version 1.4</a></p>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * <p>Most methods in this interface parallel methods in the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * MBeanServerConnection} interface.  Where an aspect of the behavior
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * of a method is not specified here, it is the same as in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * corresponding <code>MBeanServerConnection</code> method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 * Notice that we omit the type parameter from MarshalledObject everywhere,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * even though it would add useful information to the documentation.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * reason is that it was only added in Mustang (Java SE 6), whereas versions
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * 1.4 and 2.0 of the JMX API must be implementable on Tiger per our
1510
e747d3193ef2 6763639: Remove "rawtypes" warnings from JMX code
emcmanus
parents: 2
diff changeset
    91
 * commitments for JSR 255.  This is also why we suppress rawtypes warnings.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 */
1510
e747d3193ef2 6763639: Remove "rawtypes" warnings from JMX code
emcmanus
parents: 2
diff changeset
    93
@SuppressWarnings("rawtypes")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
public interface RMIConnection extends Closeable, Remote {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * <p>Returns the connection ID.  This string is different for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * every open connection to a given RMI connector server.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @return the connection ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * @see RMIConnector#connect RMIConnector.connect
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    public String getConnectionId() throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * <p>Closes this connection.  On return from this method, the RMI
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * object implementing this interface is unexported, so further
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * remote calls to it will fail.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * @throws IOException if the connection could not be closed,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * or the Remote object could not be unexported, or there was a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * communication failure when transmitting the remote close
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * request.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    public void close() throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * javax.management.MBeanServerConnection#createMBean(String,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * ObjectName)}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * @param className The class name of the MBean to be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * @param name The object name of the MBean. May be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * @return An <code>ObjectInstance</code>, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * <code>ObjectName</code> and the Java class name of the newly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * instantiated MBean.  If the contained <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * is <code>n</code>, the contained Java class name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * <code>{@link #getMBeanInfo getMBeanInfo(n)}.getClassName()</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * @throws ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * <code>java.lang.ClassNotFoundException</code> or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * <code>java.lang.Exception</code> that occurred
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * when trying to invoke the MBean's constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * @throws InstanceAlreadyExistsException The MBean is already
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * under the control of the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * @throws MBeanRegistrationException The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * <code>preRegister</code> (<code>MBeanRegistration</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * interface) method of the MBean has thrown an exception. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * MBean will not be registered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * @throws MBeanException The constructor of the MBean has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * thrown an exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * @throws NotCompliantMBeanException This class is not a JMX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * compliant MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * @throws RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * <code>java.lang.IllegalArgumentException</code>: The className
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * passed in parameter is null, the <code>ObjectName</code> passed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * in parameter contains a pattern or no <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * is specified for the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    public ObjectInstance createMBean(String className,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
                                      ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
                                      Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        ReflectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        InstanceAlreadyExistsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        MBeanRegistrationException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        NotCompliantMBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * javax.management.MBeanServerConnection#createMBean(String,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * ObjectName, ObjectName)}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * @param className The class name of the MBean to be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * @param name The object name of the MBean. May be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * @param loaderName The object name of the class loader to be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * @return An <code>ObjectInstance</code>, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * <code>ObjectName</code> and the Java class name of the newly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * instantiated MBean.  If the contained <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * is <code>n</code>, the contained Java class name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * <code>{@link #getMBeanInfo getMBeanInfo(n)}.getClassName()</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * @throws ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * <code>java.lang.ClassNotFoundException</code> or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * <code>java.lang.Exception</code> that occurred when trying to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * invoke the MBean's constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * @throws InstanceAlreadyExistsException The MBean is already
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * under the control of the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * @throws MBeanRegistrationException The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * <code>preRegister</code> (<code>MBeanRegistration</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * interface) method of the MBean has thrown an exception. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * MBean will not be registered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * @throws MBeanException The constructor of the MBean has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * thrown an exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * @throws NotCompliantMBeanException This class is not a JMX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * compliant MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * @throws InstanceNotFoundException The specified class loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * is not registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * @throws RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * <code>java.lang.IllegalArgumentException</code>: The className
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * passed in parameter is null, the <code>ObjectName</code> passed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * in parameter contains a pattern or no <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * is specified for the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    public ObjectInstance createMBean(String className,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                                      ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                                      ObjectName loaderName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                                      Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        ReflectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        InstanceAlreadyExistsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        MBeanRegistrationException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        NotCompliantMBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * javax.management.MBeanServerConnection#createMBean(String,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * ObjectName, Object[], String[])}.  The <code>Object[]</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * parameter is wrapped in a <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * @param className The class name of the MBean to be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * @param name The object name of the MBean. May be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * @param params An array containing the parameters of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * constructor to be invoked, encapsulated into a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * <code>MarshalledObject</code>.  The encapsulated array can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * null, equivalent to an empty array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * @param signature An array containing the signature of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * constructor to be invoked.  Can be null, equivalent to an empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * @return An <code>ObjectInstance</code>, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * <code>ObjectName</code> and the Java class name of the newly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * instantiated MBean.  If the contained <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * is <code>n</code>, the contained Java class name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * <code>{@link #getMBeanInfo getMBeanInfo(n)}.getClassName()</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * @throws ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * <code>java.lang.ClassNotFoundException</code> or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * <code>java.lang.Exception</code> that occurred when trying to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * invoke the MBean's constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * @throws InstanceAlreadyExistsException The MBean is already
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * under the control of the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * @throws MBeanRegistrationException The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * <code>preRegister</code> (<code>MBeanRegistration</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * interface) method of the MBean has thrown an exception. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * MBean will not be registered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * @throws MBeanException The constructor of the MBean has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * thrown an exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * @throws NotCompliantMBeanException This class is not a JMX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * compliant MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * @throws RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * <code>java.lang.IllegalArgumentException</code>: The className
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * passed in parameter is null, the <code>ObjectName</code> passed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * in parameter contains a pattern, or no <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * is specified for the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
    public ObjectInstance createMBean(String className,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
                                ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
                                MarshalledObject params,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
                                String signature[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
                                Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
        ReflectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
        InstanceAlreadyExistsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
        MBeanRegistrationException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
        NotCompliantMBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * javax.management.MBeanServerConnection#createMBean(String,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * ObjectName, ObjectName, Object[], String[])}.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * <code>Object[]</code> parameter is wrapped in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * @param className The class name of the MBean to be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * @param name The object name of the MBean. May be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * @param loaderName The object name of the class loader to be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * @param params An array containing the parameters of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * constructor to be invoked, encapsulated into a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * <code>MarshalledObject</code>.  The encapsulated array can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * null, equivalent to an empty array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * @param signature An array containing the signature of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * constructor to be invoked.  Can be null, equivalent to an empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * @return An <code>ObjectInstance</code>, containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * <code>ObjectName</code> and the Java class name of the newly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * instantiated MBean.  If the contained <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * is <code>n</code>, the contained Java class name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * <code>{@link #getMBeanInfo getMBeanInfo(n)}.getClassName()</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * @throws ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * <code>java.lang.ClassNotFoundException</code> or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * <code>java.lang.Exception</code> that occurred when trying to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * invoke the MBean's constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * @throws InstanceAlreadyExistsException The MBean is already
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * under the control of the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * @throws MBeanRegistrationException The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * <code>preRegister</code> (<code>MBeanRegistration</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * interface) method of the MBean has thrown an exception. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * MBean will not be registered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * @throws MBeanException The constructor of the MBean has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * thrown an exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * @throws NotCompliantMBeanException This class is not a JMX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * compliant MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * @throws InstanceNotFoundException The specified class loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * is not registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * @throws RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * <code>java.lang.IllegalArgumentException</code>: The className
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * passed in parameter is null, the <code>ObjectName</code> passed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * in parameter contains a pattern, or no <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * is specified for the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
    public ObjectInstance createMBean(String className,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
                                ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
                                ObjectName loaderName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
                                MarshalledObject params,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
                                String signature[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
                                Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
        ReflectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
        InstanceAlreadyExistsException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        MBeanRegistrationException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
        MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
        NotCompliantMBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
        InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * Handles the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * {@link javax.management.MBeanServerConnection#unregisterMBean(ObjectName)}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * @param name The object name of the MBean to be unregistered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * @throws InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * @throws MBeanRegistrationException The preDeregister
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * ((<code>MBeanRegistration</code> interface) method of the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * has thrown an exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * @throws RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * <code>java.lang.IllegalArgumentException</code>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * name in parameter is null or the MBean you are when trying to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * unregister is the {@link javax.management.MBeanServerDelegate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * MBeanServerDelegate} MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
    public void unregisterMBean(ObjectName name, Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
        InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
        MBeanRegistrationException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * Handles the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * {@link javax.management.MBeanServerConnection#getObjectInstance(ObjectName)}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * @param name The object name of the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * @return The <code>ObjectInstance</code> associated with the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * specified by <var>name</var>.  The contained <code>ObjectName</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * is <code>name</code> and the contained class name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     * <code>{@link #getMBeanInfo getMBeanInfo(name)}.getClassName()</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * @throws InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * @throws RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * <code>java.lang.IllegalArgumentException</code>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * name in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     * @throws IOException if a general communication exception occurred.
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
                                            Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
        throws InstanceNotFoundException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * javax.management.MBeanServerConnection#queryMBeans(ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * QueryExp)}.  The <code>QueryExp</code> is wrapped in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * @param name The object name pattern identifying the MBeans to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * be retrieved. If null or no domain and key properties are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * specified, all the MBeans registered will be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * @param query The query expression to be applied for selecting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * MBeans, encapsulated into a <code>MarshalledObject</code>. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * the <code>MarshalledObject</code> encapsulates a null value no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * query expression will be applied for selecting MBeans.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * @return A set containing the <code>ObjectInstance</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * objects for the selected MBeans.  If no MBean satisfies the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * query an empty list is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
    public Set<ObjectInstance>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
        queryMBeans(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
                    MarshalledObject query,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
                    Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
        throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * javax.management.MBeanServerConnection#queryNames(ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * QueryExp)}.  The <code>QueryExp</code> is wrapped in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * @param name The object name pattern identifying the MBean names
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * to be retrieved. If null or no domain and key properties are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * specified, the name of all registered MBeans will be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * @param query The query expression to be applied for selecting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     * MBeans, encapsulated into a <code>MarshalledObject</code>. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * the <code>MarshalledObject</code> encapsulates a null value no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * query expression will be applied for selecting MBeans.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * @return A set containing the ObjectNames for the MBeans
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * selected.  If no MBean satisfies the query, an empty list is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
    public Set<ObjectName>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
        queryNames(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
                   MarshalledObject query,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
                   Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
        throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * Handles the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * {@link javax.management.MBeanServerConnection#isRegistered(ObjectName)}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * @param name The object name of the MBean to be checked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     * @return True if the MBean is already registered in the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     * server, false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     * @throws RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     * <code>java.lang.IllegalArgumentException</code>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     * name in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
    public boolean isRegistered(ObjectName name, Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
        throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     * Handles the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     * {@link javax.management.MBeanServerConnection#getMBeanCount()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * @return the number of MBeans registered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
    public Integer getMBeanCount(Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
        throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     * javax.management.MBeanServerConnection#getAttribute(ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     * String)}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * @param name The object name of the MBean from which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     * attribute is to be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * @param attribute A String specifying the name of the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * to be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     * @return  The value of the retrieved attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     * @throws AttributeNotFoundException The attribute specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     * is not accessible in the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     * @throws MBeanException Wraps an exception thrown by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * MBean's getter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * @throws InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * @throws ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     * <code>java.lang.Exception</code> thrown when trying to invoke
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * the getter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     * @throws RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     * <code>java.lang.IllegalArgumentException</code>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * name in parameter is null or the attribute in parameter is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * @throws RuntimeMBeanException Wraps a runtime exception thrown
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * by the MBean's getter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * @see #setAttribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
    public Object getAttribute(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
                               String attribute,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
                               Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
        MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
        AttributeNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
        InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
        ReflectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     * javax.management.MBeanServerConnection#getAttributes(ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * String[])}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     * @param name The object name of the MBean from which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     * attributes are retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     * @param attributes A list of the attributes to be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * @return The list of the retrieved attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     * @throws InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     * @throws ReflectionException An exception occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     * trying to invoke the getAttributes method of a Dynamic MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     * @throws RuntimeOperationsException Wrap a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     * <code>java.lang.IllegalArgumentException</code>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     * name in parameter is null or attributes in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     * @see #setAttributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
    public AttributeList getAttributes(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
                                       String[] attributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
                                       Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
        InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
        ReflectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     * javax.management.MBeanServerConnection#setAttribute(ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * Attribute)}.  The <code>Attribute</code> parameter is wrapped
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     * in a <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * @param name The name of the MBean within which the attribute is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     * to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     * @param attribute The identification of the attribute to be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     * and the value it is to be set to, encapsulated into a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     * <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
     * @throws InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
     * @throws AttributeNotFoundException The attribute specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
     * is not accessible in the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     * @throws InvalidAttributeValueException The value specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
     * for the attribute is not valid.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
     * @throws MBeanException Wraps an exception thrown by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     * MBean's setter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
     * @throws ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     * <code>java.lang.Exception</code> thrown when trying to invoke
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     * the setter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     * @throws RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
     * <code>java.lang.IllegalArgumentException</code>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
     * name in parameter is null or the attribute in parameter is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     * null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
     * @see #getAttribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
    public void setAttribute(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
                             MarshalledObject attribute,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
                             Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
        InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
        AttributeNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
        InvalidAttributeValueException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
        MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
        ReflectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     * javax.management.MBeanServerConnection#setAttributes(ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
     * AttributeList)}.  The <code>AttributeList</code> parameter is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
     * wrapped in a <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
     * @param name The object name of the MBean within which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     * attributes are to be set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     * @param attributes A list of attributes: The identification of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     * the attributes to be set and the values they are to be set to,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
     * encapsulated into a <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
     * @return The list of attributes that were set, with their new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
     * values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
     * @throws InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
     * @throws ReflectionException An exception occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
     * trying to invoke the getAttributes method of a Dynamic MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
     * @throws RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     * <code>java.lang.IllegalArgumentException</code>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     * name in parameter is null or attributes in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     * @see #getAttributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
    public AttributeList setAttributes(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
                          MarshalledObject attributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
                          Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
        InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
        ReflectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     * javax.management.MBeanServerConnection#invoke(ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
     * String, Object[], String[])}.  The <code>Object[]</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     * parameter is wrapped in a <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
     * @param name The object name of the MBean on which the method is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
     * to be invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     * @param operationName The name of the operation to be invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     * @param params An array containing the parameters to be set when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     * the operation is invoked, encapsulated into a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     * <code>MarshalledObject</code>.  The encapsulated array can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
     * null, equivalent to an empty array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
     * @param signature An array containing the signature of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
     * operation. The class objects will be loaded using the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
     * class loader as the one used for loading the MBean on which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
     * operation was invoked.  Can be null, equivalent to an empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
     * array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
     * @return The object returned by the operation, which represents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     * the result of invoking the operation on the MBean specified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
     * @throws InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     * @throws MBeanException Wraps an exception thrown by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     * MBean's invoked method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
     * @throws ReflectionException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     * <code>java.lang.Exception</code> thrown while trying to invoke
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     * the method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     * @throws RuntimeOperationsException Wraps an {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     * IllegalArgumentException} when <code>name</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
     * <code>operationName</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
    public Object invoke(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
                         String operationName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
                         MarshalledObject params,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
                         String signature[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
                         Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
        InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
        MBeanException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
        ReflectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
     * Handles the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     * {@link javax.management.MBeanServerConnection#getDefaultDomain()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
     * @return the default domain.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
    public String getDefaultDomain(Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
        throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
     * Handles the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
     * {@link javax.management.MBeanServerConnection#getDomains()}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
     * @return the list of domains.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
    public String[] getDomains(Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
        throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     * Handles the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
     * {@link javax.management.MBeanServerConnection#getMBeanInfo(ObjectName)}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
     * @param name The name of the MBean to analyze
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
     * @return An instance of <code>MBeanInfo</code> allowing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
     * retrieval of all attributes and operations of this MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
     * @throws IntrospectionException An exception occurred during
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
     * introspection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
     * @throws InstanceNotFoundException The MBean specified was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
     * not found.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
     * @throws ReflectionException An exception occurred when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
     * trying to invoke the getMBeanInfo of a Dynamic MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
     * @throws RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
     * <code>java.lang.IllegalArgumentException</code>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
     * name in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
    public MBeanInfo getMBeanInfo(ObjectName name, Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
        InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
        IntrospectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
        ReflectionException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
     * javax.management.MBeanServerConnection#isInstanceOf(ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
     * String)}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
     * @param name The <code>ObjectName</code> of the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
     * @param className The name of the class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
     * @return true if the MBean specified is an instance of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
     * specified class according to the rules above, false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
     * @throws InstanceNotFoundException The MBean specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
     * registered in the MBean server.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
     * @throws RuntimeOperationsException Wraps a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
     * <code>java.lang.IllegalArgumentException</code>: The object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
     * name in parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
    public boolean isInstanceOf(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
                                String className,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
                                Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
        throws InstanceNotFoundException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     * javax.management.MBeanServerConnection#addNotificationListener(ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     * ObjectName, NotificationFilter, Object)}.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     * <code>NotificationFilter</code> parameter is wrapped in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
     * <code>MarshalledObject</code>.  The <code>Object</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
     * (handback) parameter is also wrapped in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
     * <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     * @param name The name of the MBean on which the listener should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
     * be added.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
     * @param listener The object name of the listener which will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
     * handle the notifications emitted by the registered MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
     * @param filter The filter object, encapsulated into a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
     * <code>MarshalledObject</code>. If filter encapsulated in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
     * <code>MarshalledObject</code> has a null value, no filtering
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
     * will be performed before handling notifications.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     * @param handback The context to be sent to the listener when a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
     * notification is emitted, encapsulated into a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
     * <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
     * @throws InstanceNotFoundException The MBean name of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
     * notification listener or of the notification broadcaster does
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
     * not match any of the registered MBeans.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
     * @throws RuntimeOperationsException Wraps an {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
     * IllegalArgumentException}.  The MBean named by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     * <code>listener</code> exists but does not implement the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
     * {@link javax.management.NotificationListener} interface,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
     * or <code>name</code> or <code>listener</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
     * @see #removeNotificationListener(ObjectName, ObjectName, Subject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
     * @see #removeNotificationListener(ObjectName, ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
     * MarshalledObject, MarshalledObject, Subject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
    public void addNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
                        ObjectName listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
                        MarshalledObject filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
                        MarshalledObject handback,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
                        Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
        throws InstanceNotFoundException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
     * javax.management.MBeanServerConnection#removeNotificationListener(ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
     * ObjectName)}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
     * @param name The name of the MBean on which the listener should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
     * be removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
     * @param listener The object name of the listener to be removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
     * @throws InstanceNotFoundException The MBean name provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
     * does not match any of the registered MBeans.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
     * @throws ListenerNotFoundException The listener is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
     * registered in the MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
     * @throws RuntimeOperationsException Wraps an {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
     * IllegalArgumentException} when <code>name</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
     * <code>listener</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
     * @see #addNotificationListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
    public void removeNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
                                           ObjectName listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
                                           Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
        InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
        ListenerNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
     * Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
     * javax.management.MBeanServerConnection#removeNotificationListener(ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
     * ObjectName, NotificationFilter, Object)}.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
     * <code>NotificationFilter</code> parameter is wrapped in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
     * <code>MarshalledObject</code>.  The <code>Object</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
     * parameter is also wrapped in a <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
     * @param name The name of the MBean on which the listener should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
     * be removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
     * @param listener A listener that was previously added to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
     * MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
     * @param filter The filter that was specified when the listener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
     * was added, encapsulated into a <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
     * @param handback The handback that was specified when the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
     * listener was added, encapsulated into a <code>MarshalledObject</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
     * @throws InstanceNotFoundException The MBean name provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
     * does not match any of the registered MBeans.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
     * @throws ListenerNotFoundException The listener is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
     * registered in the MBean, or it is not registered with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
     * filter and handback.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
     * if any, does not have permission to perform this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
     * @throws RuntimeOperationsException Wraps an {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
     * IllegalArgumentException} when <code>name</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
     * <code>listener</code> is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
     * @see #addNotificationListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
    public void removeNotificationListener(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
                      ObjectName listener,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
                      MarshalledObject filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
                      MarshalledObject handback,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
                      Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
        InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
        ListenerNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
    // Special Handling of Notifications -------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
     * <p>Handles the method {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
     * javax.management.MBeanServerConnection#addNotificationListener(ObjectName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
     * NotificationListener, NotificationFilter, Object)}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
     * <p>Register for notifications from the given MBeans that match
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
     * the given filters.  The remote client can subsequently retrieve
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
     * the notifications using the {@link #fetchNotifications
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
     * fetchNotifications} method.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
     * <p>For each listener, the original
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
     * <code>NotificationListener</code> and <code>handback</code> are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
     * kept on the client side; in order for the client to be able to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
     * identify them, the server generates and returns a unique
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
     * <code>listenerID</code>.  This <code>listenerID</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
     * forwarded with the <code>Notifications</code> to the remote
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
     * client.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
     * <p>If any one of the given (name, filter) pairs cannot be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
     * registered, then the operation fails with an exception, and no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
     * names or filters are registered.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
     * @param names the <code>ObjectNames</code> identifying the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
     * MBeans emitting the Notifications.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
     * @param filters an array of marshalled representations of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
     * <code>NotificationFilters</code>.  Elements of this array can
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
     * be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
     * @param delegationSubjects the <code>Subjects</code> on behalf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
     * of which the listeners are being added.  Elements of this array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
     * can be null.  Also, the <code>delegationSubjects</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
     * parameter itself can be null, which is equivalent to an array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
     * of null values with the same size as the <code>names</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
     * <code>filters</code> arrays.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
     * @return an array of <code>listenerIDs</code> identifying the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
     * local listeners.  This array has the same number of elements as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
     * the parameters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
     * @throws IllegalArgumentException if <code>names</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
     * <code>filters</code> is null, or if <code>names</code> contains
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
     * a null element, or if the three arrays do not all have the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
     * size.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
     * @throws ClassCastException if one of the elements of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
     * <code>filters</code> unmarshalls as a non-null object that is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
     * not a <code>NotificationFilter</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
     * @throws InstanceNotFoundException if one of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
     * <code>names</code> does not correspond to any registered MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
     * @throws SecurityException if, for one of the MBeans, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
     * client, or the delegated Subject if any, does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
     * permission to add a listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
    public Integer[] addNotificationListeners(ObjectName[] names,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
                    MarshalledObject[] filters,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
                    Subject[] delegationSubjects)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
        throws InstanceNotFoundException, IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
     * <p>Handles the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
     * {@link javax.management.MBeanServerConnection#removeNotificationListener(ObjectName,NotificationListener)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
     * removeNotificationListener(ObjectName, NotificationListener)} and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
     * {@link javax.management.MBeanServerConnection#removeNotificationListener(ObjectName,NotificationListener,NotificationFilter,Object)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
     * removeNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)} methods.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
     * <p>This method removes one or more
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
     * <code>NotificationListener</code>s from a given MBean in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
     * MBean server.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
     * <p>The <code>NotificationListeners</code> are identified by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
     * IDs which were returned by the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
     * #addNotificationListeners(ObjectName[], MarshalledObject[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
     * Subject[])} method.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
     * @param name the <code>ObjectName</code> identifying the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
     * emitting the Notifications.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
     * @param listenerIDs the list of the IDs corresponding to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
     * listeners to remove.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
     * @param delegationSubject The <code>Subject</code> containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
     * delegation principals or <code>null</code> if the authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
     * principal is used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
     * @throws InstanceNotFoundException if the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
     * <code>name</code> does not correspond to any registered MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
     * @throws ListenerNotFoundException if one of the listeners was
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
     * not found on the server side.  This exception can happen if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
     * MBean discarded a listener for some reason other than a call to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
     * <code>MBeanServer.removeNotificationListener</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
     * @throws SecurityException if the client, or the delegated Subject
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
     * if any, does not have permission to remove the listeners.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
     * @throws IllegalArgumentException if <code>ObjectName</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
     * <code>listenerIds</code> is null or if <code>listenerIds</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
     * contains a null element.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
    public void removeNotificationListeners(ObjectName name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
                                            Integer[] listenerIDs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
                                            Subject delegationSubject)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
        throws
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
        InstanceNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
        ListenerNotFoundException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
        IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
     * <p>Retrieves notifications from the connector server.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
     * method can block until there is at least one notification or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
     * until the specified timeout is reached.  The method can also
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
     * return at any time with zero notifications.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
     * <p>A notification can be included in the result if its sequence
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
     * number is no less than <code>clientSequenceNumber</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
     * this client has registered at least one listener for the MBean
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
     * generating the notification, with a filter that accepts the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
     * notification.  Each listener that is interested in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
     * notification is identified by an Integer ID that was returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
     * by {@link #addNotificationListeners(ObjectName[],
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
     * MarshalledObject[], Subject[])}.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
     * @param clientSequenceNumber the first sequence number that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
     * client is interested in.  If negative, it is interpreted as
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
     * meaning the sequence number that the next notification will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
     * have.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
     * @param maxNotifications the maximum number of different
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
     * notifications to return.  The <code>TargetedNotification</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
     * array in the returned <code>NotificationResult</code> can have
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
     * more elements than this if the same notification appears more
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
     * than once.  The behavior is unspecified if this parameter is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
     * negative.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
     * @param timeout the maximum time in milliseconds to wait for a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
     * notification to arrive.  This can be 0 to indicate that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
     * method should not wait if there are no notifications, but
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
     * should return at once.  It can be <code>Long.MAX_VALUE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
     * to indicate that there is no timeout.  The behavior is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
     * unspecified if this parameter is negative.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
     * @return A <code>NotificationResult</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
     * @throws IOException if a general communication exception occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
    public NotificationResult fetchNotifications(long clientSequenceNumber,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
                                                 int maxNotifications,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
                                                 long timeout)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
            throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
}