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


Java RMIClassLoader.loadProxyClass方法代码示例

本文整理汇总了Java中java.rmi.server.RMIClassLoader.loadProxyClass方法的典型用法代码示例。如果您正苦于以下问题:Java RMIClassLoader.loadProxyClass方法的具体用法?Java RMIClassLoader.loadProxyClass怎么用?Java RMIClassLoader.loadProxyClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.rmi.server.RMIClassLoader的用法示例。


在下文中一共展示了RMIClassLoader.loadProxyClass方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resolveProxyClass

import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
 * resolveProxyClass is extended to acquire (if present) the location
 * to determine the class loader to define the proxy class in.
 */
protected Class<?> resolveProxyClass(String[] interfaces)
    throws IOException, ClassNotFoundException
{
    /*
     * Always read annotation written by MarshalOutputStream.
     */
    Object annotation = readLocation();

    ClassLoader defaultLoader =
        skipDefaultResolveClass ? null : latestUserDefinedLoader();

    String codebase = null;
    if (!useCodebaseOnly && annotation instanceof String) {
        codebase = (String) annotation;
    }

    return RMIClassLoader.loadProxyClass(codebase, interfaces,
                                         defaultLoader);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:MarshalInputStream.java

示例2: resolveProxyClass

import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
 * resolveProxyClass is extended to acquire (if present) the location
 * to determine the class loader to define the proxy class in.
 */
protected Class<?> resolveProxyClass(String[] interfaces)
    throws IOException, ClassNotFoundException
{
    StreamChecker checker = streamChecker;
    if (checker != null) {
        checker.checkProxyInterfaceNames(interfaces);
    }

    /*
     * Always read annotation written by MarshalOutputStream.
     */
    Object annotation = readLocation();

    ClassLoader defaultLoader =
        skipDefaultResolveClass ? null : latestUserDefinedLoader();

    String codebase = null;
    if (!useCodebaseOnly && annotation instanceof String) {
        codebase = (String) annotation;
    }

    return RMIClassLoader.loadProxyClass(codebase, interfaces,
                                         defaultLoader);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:29,代码来源:MarshalInputStream.java

示例3: resolveProxyClass

import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
 * resolveProxyClass is extended to acquire (if present) the location
 * to determine the class loader to define the proxy class in.
 */
protected Class resolveProxyClass(String[] interfaces)
    throws IOException, ClassNotFoundException
{
    /*
     * Always read annotation written by MarshalOutputStream.
     */
    Object annotation = readLocation();

    ClassLoader defaultLoader =
        skipDefaultResolveClass ? null : latestUserDefinedLoader();

    String codebase = null;
    if (!useCodebaseOnly && annotation instanceof String) {
        codebase = (String) annotation;
    }

    return RMIClassLoader.loadProxyClass(codebase, interfaces,
                                         defaultLoader);
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:24,代码来源:MarshalInputStream.java

示例4: resolveProxyClass

import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
protected Class resolveProxyClass(String intfs[]) throws IOException,
    ClassNotFoundException
{
  try
    {
      return RMIClassLoader.loadProxyClass(
          (String)getAnnotation(),
          intfs,
          VMStackWalker.firstNonNullClassLoader());
    }
  catch (MalformedURLException x)
    {
      throw new ClassNotFoundException(null, x);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:16,代码来源:RMIObjectInputStream.java

示例5: resolveProxyClass

import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
protected Class resolveProxyClass(String intfs[]) throws IOException,
    ClassNotFoundException
{
  try 
    {
      return RMIClassLoader.loadProxyClass(
          (String)getAnnotation(),
          intfs,
          VMStackWalker.firstNonNullClassLoader());
    }
  catch (MalformedURLException x) 
    {
      throw new ClassNotFoundException(null, x);
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:16,代码来源:RMIObjectInputStream.java

示例6: resolveProxyClass

import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
 * Resolves annotated proxy class.
 *
 * @param interf array of interfaces which proxy class should implement
 *
 * @throws IOException if an I/O exception occurred
 * @throws ClassNotFoundException if class of a serialized object
 *         could not be found
 */
protected Class resolveProxyClass(String[] interf)
        throws IOException, ClassNotFoundException {
    String annot = (locStream == null) ? null
            : (String) locStream.readObject();

    if (useCodebaseOnly) {
        annot = null;
    }
    Class cl = RMIClassLoader.loadProxyClass(annot, interf,
            VM.getNonBootstrapClassLoader());
    return cl;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:22,代码来源:RMIObjectInputStream.java

示例7: testLoadProxyClassInvalidCodebase

import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
  * Test for java.rmi.server.RMIClassLoader.loadProxyClass(String, String[], ClassLoader)
  * testing invalid url as a codebase.
  */
public void testLoadProxyClassInvalidCodebase() throws Exception {
    //Regression for HARMONY-1133
    SecurityManager previous = System.getSecurityManager();
    System.setSecurityManager(null);
    
    try {
        RMIClassLoader.loadProxyClass("zzz", new String[] {}, null);
        fail("MalformedURLException expected");
    } catch (MalformedURLException e) { 
        //expected 
    } finally {
        System.setSecurityManager(previous);            
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:19,代码来源:RMIClassLoaderTest.java

示例8: resolveProxyClass

import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
 * Constructs and returns a Proxy class that implements the required
 * interfaces.
 * 
 * @param interfaces
 *            the interfaces to be implemented
 * @return a proxy class that implements the specified interfaces
 * @throws IOException
 *             if de I/O operation fails
 */
@Override
protected Class<?> resolveProxyClass(String[] interfaces)
        throws IOException, ClassNotFoundException {
    Object obj = this.readObject();
    try {
        return super.resolveProxyClass(interfaces);
    } catch (Exception e) {
        return RMIClassLoader
                .loadProxyClass((String) obj, interfaces, null);
    }
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:22,代码来源:RMIObjectInputStream.java

示例9: testLoadProxyClass006

import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
public final void testLoadProxyClass006() {
    String interfaces[] = {
            "ar.org.fitc.test.rmi.server.testclasses.SuperProxy",
            "ar.org.fitc.test.rmi.server.testclasses.OverProxy",
            "ar.org.fitc.test.rmi.server.testclasses.LoaderInterface" };
    try {
        RMIClassLoader.loadProxyClass(null, interfaces, new URLClassLoader(
                new URL[] { new URL("file://" + pathOwnClass) }));
    } catch (Throwable e) {
        fail("Should not raise an exception but raised: " + e);
    }

}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:14,代码来源:TestRMIClassLoader.java

示例10: testLoadProxyClass009

import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
public final void testLoadProxyClass009() {

        String interfaces[] = {};
        Class c = null;

        try {
            c = RMIClassLoader.loadProxyClass(null, interfaces, null);
            assertNotNull(c);
        } catch (Throwable e) {
            fail("Should not raise an exception but raised: " + e);
        }
    }
 
开发者ID:freeVM,项目名称:freeVM,代码行数:13,代码来源:TestRMIClassLoader.java

示例11: testLoadProxyClassInvalidCodebase

import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
 * Test for java.rmi.server.RMIClassLoader.loadProxyClass(String, String[],
 * ClassLoader) testing invalid url as a codebase.
 */
public void testLoadProxyClassInvalidCodebase() throws Exception {
    // Regression for HARMONY-1133
    SecurityManager previous = System.getSecurityManager();
    System.setSecurityManager(null);

    try {
        RMIClassLoader.loadProxyClass("zzz", new String[] {}, null);
        fail("MalformedURLException expected");
    } catch (MalformedURLException e) {
        // expected
    } finally {
        System.setSecurityManager(previous);
    }
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:19,代码来源:RMIClassLoaderTest.java


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