类javax.management.OperationsException源码实例Demo

下面列出了怎么用javax.management.OperationsException的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Tomcat8-Source-Read   文件: JMXProxyServlet.java
/**
 * 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);
}
 
源代码2 项目: Tomcat8-Source-Read   文件: JMXProxyServlet.java
/**
 * 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));
}
 
源代码3 项目: presto   文件: RebindSafeMBeanServer.java
@Override
@Deprecated
public ObjectInputStream deserialize(ObjectName name, byte[] data)
        throws OperationsException
{
    return mbeanServer.deserialize(name, data);
}
 
源代码4 项目: presto   文件: RebindSafeMBeanServer.java
@Override
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
        throws OperationsException, ReflectionException
{
    return mbeanServer.deserialize(className, data);
}
 
源代码5 项目: presto   文件: RebindSafeMBeanServer.java
@Override
@Deprecated
public ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data)
        throws OperationsException, ReflectionException
{
    return mbeanServer.deserialize(className, loaderName, data);
}
 
源代码6 项目: jdk1.8-source-analysis   文件: JmxMBeanServer.java
/**
 * 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);
}
 
/**
 * 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);
}
 
/**
 * 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);
}
 
/**
 * 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);
}
 
源代码10 项目: dragonwell8_jdk   文件: JmxMBeanServer.java
/**
 * 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);
}
 
/**
 * 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);
}
 
/**
 * 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);
}
 
/**
 * 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);
}
 
源代码14 项目: TencentKona-8   文件: JmxMBeanServer.java
/**
 * 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);
}
 
/**
 * 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);
}
 
/**
 * 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);
}
 
/**
 * 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);
}
 
源代码18 项目: jdk8u60   文件: JmxMBeanServer.java
/**
 * 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);
}
 
源代码19 项目: jdk8u60   文件: MBeanServerAccessController.java
/**
 * 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);
}
 
源代码20 项目: jdk8u60   文件: MBeanServerAccessController.java
/**
 * 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);
}
 
源代码21 项目: JDKSourceCode1.8   文件: JmxMBeanServer.java
/**
 * 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);
}
 
/**
 * 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);
}
 
/**
 * 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);
}
 
/**
 * 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);
}
 
源代码25 项目: openjdk-jdk8u   文件: JmxMBeanServer.java
/**
 * 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);
}
 
/**
 * 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);
}
 
/**
 * 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);
}
 
/**
 * 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);
}
 
/**
 * This method should never be called.
 * Usually hrows UnsupportedOperationException.
 */
@Deprecated
public ObjectInputStream deserialize(String className,
        ObjectName loaderName, byte[] data)
        throws InstanceNotFoundException, OperationsException,
        ReflectionException;
 
public ObjectInputStream deserialize(ObjectName name, byte[] data) throws InstanceNotFoundException,
                                                                          OperationsException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
 类所在包
 同包方法