javax.management.OperationsException Java Examples

The following examples show how to use javax.management.OperationsException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JMXProxyServlet.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
/**
 * Invokes an operation on an MBean.
 *
 * @param onameStr The name of the MBean.
 * @param operation The name of the operation to invoke.
 * @param parameters An array of Strings containing the parameters to the
 *            operation. They will be converted to the appropriate types to
 *            call the requested operation.
 * @return The value returned by the requested operation.
 */
private Object invokeOperationInternal(String onameStr, String operation, String[] parameters)
        throws OperationsException, MBeanException, ReflectionException {
    ObjectName oname = new ObjectName(onameStr);
    MBeanOperationInfo methodInfo = registry.getMethodInfo(oname, operation);
    MBeanParameterInfo[] signature = methodInfo.getSignature();
    String[] signatureTypes = new String[signature.length];
    Object[] values = new Object[signature.length];
    for (int i = 0; i < signature.length; i++) {
        MBeanParameterInfo pi = signature[i];
        signatureTypes[i] = pi.getType();
        values[i] = registry.convertValue(pi.getType(), parameters[i]);
    }

    return mBeanServer.invoke(oname, operation, values, signatureTypes);
}
 
Example #2
Source File: MBeanServerAccessController.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(ObjectName name, byte[] data)
    throws InstanceNotFoundException, OperationsException {
    checkRead();
    return getMBeanServer().deserialize(name, data);
}
 
Example #3
Source File: RebindSafeMBeanServer.java    From presto with Apache License 2.0 5 votes vote down vote up
@Override
@Deprecated
public ObjectInputStream deserialize(ObjectName name, byte[] data)
        throws OperationsException
{
    return mbeanServer.deserialize(name, data);
}
 
Example #4
Source File: JmxMBeanServer.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * De-serializes a byte array in the context of a given MBean class loader.
 * The class loader is the one that loaded the class with name "className".
 *
 * @param className The name of the class whose class loader should be
 *      used for the de-serialization.
 * @param data The byte array to be de-sererialized.
 *
 * @return  The de-serialized object stream.
 *
 * @exception OperationsException Any of the usual Input/Output
 *      related exceptions.
 * @exception ReflectionException The specified class could not be
 *      loaded by the default loader repository
 *
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {

    if (className == null) {
        throw new  RuntimeOperationsException(
                                    new IllegalArgumentException(),
                                    "Null className passed in parameter");
    }

    /* Permission check */
    // This call requires MBeanPermission 'getClassLoaderRepository'
    final ClassLoaderRepository clr = getClassLoaderRepository();

    Class<?> theClass;
    try {
        if (clr == null) throw new ClassNotFoundException(className);
        theClass = clr.loadClass(className);
    } catch (ClassNotFoundException e) {
        throw new ReflectionException(e,
                                      "The given class could not be " +
                                      "loaded by the default loader " +
                                      "repository");
    }

    return instantiator.deserialize(theClass.getClassLoader(), data);
}
 
Example #5
Source File: RebindSafeMBeanServer.java    From presto with Apache License 2.0 5 votes vote down vote up
@Override
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
        throws OperationsException, ReflectionException
{
    return mbeanServer.deserialize(className, data);
}
 
Example #6
Source File: MBeanServerAccessController.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, data);
}
 
Example #7
Source File: RebindSafeMBeanServer.java    From presto with Apache License 2.0 5 votes vote down vote up
@Override
@Deprecated
public ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data)
        throws OperationsException, ReflectionException
{
    return mbeanServer.deserialize(className, loaderName, data);
}
 
Example #8
Source File: MBeanServerAccessController.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(ObjectName name, byte[] data)
    throws InstanceNotFoundException, OperationsException {
    checkRead();
    return getMBeanServer().deserialize(name, data);
}
 
Example #9
Source File: MBeanServerAccessController.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className,
                                     ObjectName loaderName,
                                     byte[] data)
    throws
    InstanceNotFoundException,
    OperationsException,
    ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, loaderName, data);
}
 
Example #10
Source File: JmxMBeanServer.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * De-serializes a byte array in the context of a given MBean class loader.
 * The class loader is the one that loaded the class with name "className".
 *
 * @param className The name of the class whose class loader should be
 *      used for the de-serialization.
 * @param data The byte array to be de-sererialized.
 *
 * @return  The de-serialized object stream.
 *
 * @exception OperationsException Any of the usual Input/Output
 *      related exceptions.
 * @exception ReflectionException The specified class could not be
 *      loaded by the default loader repository
 *
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {

    if (className == null) {
        throw new  RuntimeOperationsException(
                                    new IllegalArgumentException(),
                                    "Null className passed in parameter");
    }

    /* Permission check */
    // This call requires MBeanPermission 'getClassLoaderRepository'
    final ClassLoaderRepository clr = getClassLoaderRepository();

    Class<?> theClass;
    try {
        if (clr == null) throw new ClassNotFoundException(className);
        theClass = clr.loadClass(className);
    } catch (ClassNotFoundException e) {
        throw new ReflectionException(e,
                                      "The given class could not be " +
                                      "loaded by the default loader " +
                                      "repository");
    }

    return instantiator.deserialize(theClass.getClassLoader(), data);
}
 
Example #11
Source File: MBeanServerAccessController.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(ObjectName name, byte[] data)
    throws InstanceNotFoundException, OperationsException {
    checkRead();
    return getMBeanServer().deserialize(name, data);
}
 
Example #12
Source File: MBeanServerAccessController.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, data);
}
 
Example #13
Source File: MBeanServerAccessController.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className,
                                     ObjectName loaderName,
                                     byte[] data)
    throws
    InstanceNotFoundException,
    OperationsException,
    ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, loaderName, data);
}
 
Example #14
Source File: JmxMBeanServer.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * De-serializes a byte array in the context of a given MBean class loader.
 * The class loader is the one that loaded the class with name "className".
 *
 * @param className The name of the class whose class loader should be
 *      used for the de-serialization.
 * @param data The byte array to be de-sererialized.
 *
 * @return  The de-serialized object stream.
 *
 * @exception OperationsException Any of the usual Input/Output
 *      related exceptions.
 * @exception ReflectionException The specified class could not be
 *      loaded by the default loader repository
 *
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {

    if (className == null) {
        throw new  RuntimeOperationsException(
                                    new IllegalArgumentException(),
                                    "Null className passed in parameter");
    }

    /* Permission check */
    // This call requires MBeanPermission 'getClassLoaderRepository'
    final ClassLoaderRepository clr = getClassLoaderRepository();

    Class<?> theClass;
    try {
        if (clr == null) throw new ClassNotFoundException(className);
        theClass = clr.loadClass(className);
    } catch (ClassNotFoundException e) {
        throw new ReflectionException(e,
                                      "The given class could not be " +
                                      "loaded by the default loader " +
                                      "repository");
    }

    return instantiator.deserialize(theClass.getClassLoader(), data);
}
 
Example #15
Source File: MBeanServerAccessController.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className,
                                     ObjectName loaderName,
                                     byte[] data)
    throws
    InstanceNotFoundException,
    OperationsException,
    ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, loaderName, data);
}
 
Example #16
Source File: MBeanServerAccessController.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, data);
}
 
Example #17
Source File: MBeanServerAccessController.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className,
                                     ObjectName loaderName,
                                     byte[] data)
    throws
    InstanceNotFoundException,
    OperationsException,
    ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, loaderName, data);
}
 
Example #18
Source File: JmxMBeanServer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * De-serializes a byte array in the context of a given MBean class loader.
 * The class loader is the one that loaded the class with name "className".
 *
 * @param className The name of the class whose class loader should be
 *      used for the de-serialization.
 * @param data The byte array to be de-sererialized.
 *
 * @return  The de-serialized object stream.
 *
 * @exception OperationsException Any of the usual Input/Output
 *      related exceptions.
 * @exception ReflectionException The specified class could not be
 *      loaded by the default loader repository
 *
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {

    if (className == null) {
        throw new  RuntimeOperationsException(
                                    new IllegalArgumentException(),
                                    "Null className passed in parameter");
    }

    /* Permission check */
    // This call requires MBeanPermission 'getClassLoaderRepository'
    final ClassLoaderRepository clr = getClassLoaderRepository();

    Class<?> theClass;
    try {
        if (clr == null) throw new ClassNotFoundException(className);
        theClass = clr.loadClass(className);
    } catch (ClassNotFoundException e) {
        throw new ReflectionException(e,
                                      "The given class could not be " +
                                      "loaded by the default loader " +
                                      "repository");
    }

    return instantiator.deserialize(theClass.getClassLoader(), data);
}
 
Example #19
Source File: MBeanServerAccessController.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, data);
}
 
Example #20
Source File: MBeanServerAccessController.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className,
                                     ObjectName loaderName,
                                     byte[] data)
    throws
    InstanceNotFoundException,
    OperationsException,
    ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, loaderName, data);
}
 
Example #21
Source File: JmxMBeanServer.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * De-serializes a byte array in the context of a given MBean class loader.
 * The class loader is the one that loaded the class with name "className".
 *
 * @param className The name of the class whose class loader should be
 *      used for the de-serialization.
 * @param data The byte array to be de-sererialized.
 *
 * @return  The de-serialized object stream.
 *
 * @exception OperationsException Any of the usual Input/Output
 *      related exceptions.
 * @exception ReflectionException The specified class could not be
 *      loaded by the default loader repository
 *
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {

    if (className == null) {
        throw new  RuntimeOperationsException(
                                    new IllegalArgumentException(),
                                    "Null className passed in parameter");
    }

    /* Permission check */
    // This call requires MBeanPermission 'getClassLoaderRepository'
    final ClassLoaderRepository clr = getClassLoaderRepository();

    Class<?> theClass;
    try {
        if (clr == null) throw new ClassNotFoundException(className);
        theClass = clr.loadClass(className);
    } catch (ClassNotFoundException e) {
        throw new ReflectionException(e,
                                      "The given class could not be " +
                                      "loaded by the default loader " +
                                      "repository");
    }

    return instantiator.deserialize(theClass.getClassLoader(), data);
}
 
Example #22
Source File: MBeanServerAccessController.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(ObjectName name, byte[] data)
    throws InstanceNotFoundException, OperationsException {
    checkRead();
    return getMBeanServer().deserialize(name, data);
}
 
Example #23
Source File: MBeanServerAccessController.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, data);
}
 
Example #24
Source File: MBeanServerAccessController.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className,
                                     ObjectName loaderName,
                                     byte[] data)
    throws
    InstanceNotFoundException,
    OperationsException,
    ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, loaderName, data);
}
 
Example #25
Source File: JmxMBeanServer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * De-serializes a byte array in the context of a given MBean class loader.
 * The class loader is the one that loaded the class with name "className".
 *
 * @param className The name of the class whose class loader should be
 *      used for the de-serialization.
 * @param data The byte array to be de-sererialized.
 *
 * @return  The de-serialized object stream.
 *
 * @exception OperationsException Any of the usual Input/Output
 *      related exceptions.
 * @exception ReflectionException The specified class could not be
 *      loaded by the default loader repository
 *
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {

    if (className == null) {
        throw new  RuntimeOperationsException(
                                    new IllegalArgumentException(),
                                    "Null className passed in parameter");
    }

    /* Permission check */
    // This call requires MBeanPermission 'getClassLoaderRepository'
    final ClassLoaderRepository clr = getClassLoaderRepository();

    Class<?> theClass;
    try {
        if (clr == null) throw new ClassNotFoundException(className);
        theClass = clr.loadClass(className);
    } catch (ClassNotFoundException e) {
        throw new ReflectionException(e,
                                      "The given class could not be " +
                                      "loaded by the default loader " +
                                      "repository");
    }

    return instantiator.deserialize(theClass.getClassLoader(), data);
}
 
Example #26
Source File: MBeanServerAccessController.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(ObjectName name, byte[] data)
    throws InstanceNotFoundException, OperationsException {
    checkRead();
    return getMBeanServer().deserialize(name, data);
}
 
Example #27
Source File: MBeanServerAccessController.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, data);
}
 
Example #28
Source File: JMXProxyServlet.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
/**
 * Sets an MBean attribute's value.
 */
private void setAttributeInternal(String onameStr, String attributeName, String value)
        throws OperationsException, MBeanException, ReflectionException {
    ObjectName oname = new ObjectName(onameStr);
    String type = registry.getType(oname, attributeName);
    Object valueObj = registry.convertValue(type, value);
    mBeanServer.setAttribute(oname, new Attribute(attributeName, valueObj));
}
 
Example #29
Source File: MBeanServerInterceptor.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * This method should never be called.
 * Usually hrows UnsupportedOperationException.
 */
@Deprecated
public ObjectInputStream deserialize(String className,
        ObjectName loaderName, byte[] data)
        throws InstanceNotFoundException, OperationsException,
        ReflectionException;
 
Example #30
Source File: OldMBeanServerTest.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
throws OperationsException, ReflectionException {
    throw new UnsupportedOperationException();
}