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


Java DelegateInvocationHandlerImpl.create方法代码示例

本文整理汇总了Java中com.sun.corba.se.spi.orbutil.proxy.DelegateInvocationHandlerImpl.create方法的典型用法代码示例。如果您正苦于以下问题:Java DelegateInvocationHandlerImpl.create方法的具体用法?Java DelegateInvocationHandlerImpl.create怎么用?Java DelegateInvocationHandlerImpl.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.corba.se.spi.orbutil.proxy.DelegateInvocationHandlerImpl的用法示例。


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

示例1: getInvocationHandler

import com.sun.corba.se.spi.orbutil.proxy.DelegateInvocationHandlerImpl; //导入方法依赖的package包/类
InvocationHandler getInvocationHandler( DynamicStub stub )
{
    // Create an invocation handler for the methods defined on DynamicStub,
    // which extends org.omg.CORBA.Object.  This handler delegates all
    // calls directly to a DynamicStubImpl, which extends
    // org.omg.CORBA.portable.ObjectImpl.
    final InvocationHandler dynamicStubHandler =
        DelegateInvocationHandlerImpl.create( stub ) ;

    // Create an invocation handler that handles any remote interface
    // methods.
    final InvocationHandler stubMethodHandler = new StubInvocationHandlerImpl(
        pm, classData, stub ) ;

    // Create a composite handler that handles the DynamicStub interface
    // as well as the remote interfaces.
    final CompositeInvocationHandler handler =
        new CustomCompositeInvocationHandlerImpl( stub ) ;

    AccessController.doPrivileged(new PrivilegedAction<Void>() {
        @Override
        public Void run() {
    handler.addInvocationHandler( DynamicStub.class,
        dynamicStubHandler ) ;
    handler.addInvocationHandler( org.omg.CORBA.Object.class,
        dynamicStubHandler ) ;
    handler.addInvocationHandler( Object.class,
        dynamicStubHandler ) ;
            return null;
        }
    });


    // If the method passed to invoke is not from DynamicStub or its superclasses,
    // it must be from an implemented interface, so we just handle
    // all of these with the stubMethodHandler.  This used to be
    // done be adding explicit entries for stubMethodHandler for
    // each remote interface, but that does not work correctly
    // for abstract interfaces, since the graph analysis ignores
    // abstract interfaces in order to compute the type ids
    // correctly (see PresentationManagerImpl.NodeImpl.getChildren).
    // Rather than produce more graph traversal code to handle this
    // problem, we simply use a default.
    // This also points to a possible optimization: just use explict
    // checks for the three special classes, rather than a general
    // table lookup that usually fails.
    handler.setDefaultHandler( stubMethodHandler ) ;

    return handler ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:51,代码来源:InvocationHandlerFactoryImpl.java

示例2: getInvocationHandler

import com.sun.corba.se.spi.orbutil.proxy.DelegateInvocationHandlerImpl; //导入方法依赖的package包/类
InvocationHandler getInvocationHandler( DynamicStub stub )
{
    // Create an invocation handler for the methods defined on DynamicStub,
    // which extends org.omg.CORBA.Object.  This handler delegates all
    // calls directly to a DynamicStubImpl, which extends
    // org.omg.CORBA.portable.ObjectImpl.
    InvocationHandler dynamicStubHandler =
        DelegateInvocationHandlerImpl.create( stub ) ;

    // Create an invocation handler that handles any remote interface
    // methods.
    InvocationHandler stubMethodHandler = new StubInvocationHandlerImpl(
        pm, classData, stub ) ;

    // Create a composite handler that handles the DynamicStub interface
    // as well as the remote interfaces.
    final CompositeInvocationHandler handler =
        new CustomCompositeInvocationHandlerImpl( stub ) ;
    handler.addInvocationHandler( DynamicStub.class,
        dynamicStubHandler ) ;
    handler.addInvocationHandler( org.omg.CORBA.Object.class,
        dynamicStubHandler ) ;
    handler.addInvocationHandler( Object.class,
        dynamicStubHandler ) ;

    // If the method passed to invoke is not from DynamicStub or its superclasses,
    // it must be from an implemented interface, so we just handle
    // all of these with the stubMethodHandler.  This used to be
    // done be adding explicit entries for stubMethodHandler for
    // each remote interface, but that does not work correctly
    // for abstract interfaces, since the graph analysis ignores
    // abstract interfaces in order to compute the type ids
    // correctly (see PresentationManagerImpl.NodeImpl.getChildren).
    // Rather than produce more graph traversal code to handle this
    // problem, we simply use a default.
    // This also points to a possible optimization: just use explict
    // checks for the three special classes, rather than a general
    // table lookup that usually fails.
    handler.setDefaultHandler( stubMethodHandler ) ;

    return handler ;
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:43,代码来源:InvocationHandlerFactoryImpl.java


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