当前位置: 首页>>代码示例>>Java>>正文


Java OrderClassLoaders类代码示例

本文整理汇总了Java中com.sun.jmx.remote.util.OrderClassLoaders的典型用法代码示例。如果您正苦于以下问题:Java OrderClassLoaders类的具体用法?Java OrderClassLoaders怎么用?Java OrderClassLoaders使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OrderClassLoaders类属于com.sun.jmx.remote.util包,在下文中一共展示了OrderClassLoaders类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: unwrap

import com.sun.jmx.remote.util.OrderClassLoaders; //导入依赖的package包/类
private static <T> T unwrap(final MarshalledObject<?> mo,
                            final ClassLoader cl1,
                            final ClassLoader cl2,
                            final Class<T> wrappedClass)
    throws IOException {
    if (mo == null) {
        return null;
    }
    try {
        ClassLoader orderCL = AccessController.doPrivileged(
            new PrivilegedExceptionAction<ClassLoader>() {
                public ClassLoader run() throws Exception {
                    return new CombinedClassLoader(Thread.currentThread().getContextClassLoader(),
                            new OrderClassLoaders(cl1, cl2));
                }
            }
        );
        return unwrap(mo, orderCL, wrappedClass);
    } catch (PrivilegedActionException pe) {
        Exception e = extractException(pe);
        if (e instanceof IOException) {
            throw (IOException) e;
        }
        if (e instanceof ClassNotFoundException) {
            throw new UnmarshalException(e.toString(), e);
        }
        logger.warning("unwrap", "Failed to unmarshall object: " + e);
        logger.debug("unwrap", e);
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:RMIConnectionImpl.java

示例2: unwrap

import com.sun.jmx.remote.util.OrderClassLoaders; //导入依赖的package包/类
private <T> T unwrap(final MarshalledObject<?> mo,
                            final ClassLoader cl1,
                            final ClassLoader cl2,
                            final Class<T> wrappedClass,
                            Subject delegationSubject)
    throws IOException {
    if (mo == null) {
        return null;
    }
    try {
        ClassLoader orderCL = AccessController.doPrivileged(
            new PrivilegedExceptionAction<ClassLoader>() {
                public ClassLoader run() throws Exception {
                    return new CombinedClassLoader(Thread.currentThread().getContextClassLoader(),
                            new OrderClassLoaders(cl1, cl2));
                }
            }
        );
        return unwrap(mo, orderCL, wrappedClass,delegationSubject);
    } catch (PrivilegedActionException pe) {
        Exception e = extractException(pe);
        if (e instanceof IOException) {
            throw (IOException) e;
        }
        if (e instanceof ClassNotFoundException) {
            throw new UnmarshalException(e.toString(), e);
        }
        logger.warning("unwrap", "Failed to unmarshall object: " + e);
        logger.debug("unwrap", e);
    }
    return null;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:33,代码来源:RMIConnectionImpl.java

示例3: unwrap

import com.sun.jmx.remote.util.OrderClassLoaders; //导入依赖的package包/类
private static <T> T unwrap(final MarshalledObject<?> mo,
                            final ClassLoader cl1,
                            final ClassLoader cl2,
                            final Class<T> wrappedClass)
    throws IOException {
    if (mo == null) {
        return null;
    }
    try {
        ClassLoader orderCL = AccessController.doPrivileged(
            new PrivilegedExceptionAction<ClassLoader>() {
                public ClassLoader run() throws Exception {
                    return new OrderClassLoaders(cl1, cl2);
                }
            }
        );
        return unwrap(mo, orderCL, wrappedClass);
    } catch (PrivilegedActionException pe) {
        Exception e = extractException(pe);
        if (e instanceof IOException) {
            throw (IOException) e;
        }
        if (e instanceof ClassNotFoundException) {
            throw new UnmarshalException(e.toString(), e);
        }
        logger.warning("unwrap", "Failed to unmarshall object: " + e);
        logger.debug("unwrap", e);
    }
    return null;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:31,代码来源:RMIConnectionImpl.java


注:本文中的com.sun.jmx.remote.util.OrderClassLoaders类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。