• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java StubAdapter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: insert_Object

import com.sun.corba.se.spi.presentation.rmi.StubAdapter; //导入依赖的package包/类
/**
 * See the description of the <a href="#anyOps">general Any operations.</a>
 */
public void insert_Object(org.omg.CORBA.Object o)
{
    //debug.log ("insert_Object");
    if ( o == null ) {
        typeCode = orb.get_primitive_tc(TCKind._tk_objref);
    } else {
        if (StubAdapter.isStub(o)) {
            String[] ids = StubAdapter.getTypeIds( o ) ;
            typeCode = new TypeCodeImpl(orb, TCKind._tk_objref, ids[0], "");
        } else {
            throw wrapper.badInsertobjParam(
                CompletionStatus.COMPLETED_MAYBE, o.getClass().getName() ) ;
        }
    }

    object = o;
    isInitialized = true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:AnyImpl.java


示例2: equals

import com.sun.corba.se.spi.presentation.rmi.StubAdapter; //导入依赖的package包/类
/**
 * This method overrides the org.omg.CORBA.portable.Delegate.equals method,
 * and does the equality check based on IOR equality.
 */
public boolean equals(org.omg.CORBA.Object self, java.lang.Object other)
{
    if (other == null)
        return false ;

    if (!StubAdapter.isStub(other)) {
        return false;
    }

    Delegate delegate = StubAdapter.getDelegate( other ) ;
    if (delegate == null)
        return false ;

    if (delegate instanceof CorbaClientDelegateImpl) {
        CorbaClientDelegateImpl otherDel = (CorbaClientDelegateImpl)
            delegate ;
        IOR otherIor = otherDel.contactInfoList.getTargetIOR();
        return this.contactInfoList.getTargetIOR().equals(otherIor);
    }

    // Come here if other is not implemented by our ORB.
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:CorbaClientDelegateImpl.java


示例3: disconnect

import com.sun.corba.se.spi.presentation.rmi.StubAdapter; //导入依赖的package包/类
public void disconnect( org.omg.CORBA.Object objref )
{
    // Get the delegate, then ior, then transientKey, then delete servant
    org.omg.CORBA.portable.Delegate del = StubAdapter.getDelegate(
        objref ) ;
    CorbaContactInfoList ccil = (CorbaContactInfoList)
        ((ClientDelegate)del).getContactInfoList() ;
    LocalClientRequestDispatcher lcs =
        ccil.getLocalClientRequestDispatcher() ;

    if (lcs instanceof JIDLLocalCRDImpl) {
        JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
        byte[] oid = jlcs.getObjectId() ;
        servants.deleteServant(oid);
        jlcs.unexport() ;
    } else {
        throw new RuntimeException(
            "TOAImpl.disconnect can not be called on " + lcs ) ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:TOAImpl.java


示例4: unexportObject

import com.sun.corba.se.spi.presentation.rmi.StubAdapter; //导入依赖的package包/类
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:PortableRemoteObject.java


示例5: isLocal

import com.sun.corba.se.spi.presentation.rmi.StubAdapter; //导入依赖的package包/类
private boolean isLocal()
{
    boolean result = false ;
    Delegate delegate = StubAdapter.getDelegate( stub ) ;

    if (delegate instanceof CorbaClientDelegate) {
        CorbaClientDelegate cdel = (CorbaClientDelegate)delegate ;
        ContactInfoList cil = cdel.getContactInfoList() ;
        if (cil instanceof CorbaContactInfoList) {
            CorbaContactInfoList ccil = (CorbaContactInfoList)cil ;
            LocalClientRequestDispatcher lcrd =
                ccil.getLocalClientRequestDispatcher() ;
            result = lcrd.useLocalInvocation( null ) ;
        }
    }

    return result ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:StubInvocationHandlerImpl.java


示例6: connectAndGetIOR

import com.sun.corba.se.spi.presentation.rmi.StubAdapter; //导入依赖的package包/类
/** Obtains an IOR for the object reference obj, first connecting it to
* the ORB if necessary.
* @return IOR the IOR that represents this objref.  This will
* never be null.
* @exception BAD_OPERATION if the object could not be connected,
* if a connection attempt was needed.
* @exception BAD_PARAM if obj is a local object, or else was
* created by a foreign ORB.
*/
public static IOR connectAndGetIOR( ORB orb, org.omg.CORBA.Object obj )
{
    IOR result ;
    try {
        result = getIOR( obj ) ;
    } catch (BAD_OPERATION bop) {
        if (StubAdapter.isStub(obj)) {
            try {
                StubAdapter.connect( obj, orb ) ;
            } catch (java.rmi.RemoteException exc) {
                throw wrapper.connectingServant( exc ) ;
            }
        } else {
            orb.connect( obj ) ;
        }

        result = getIOR( obj ) ;
    }

    return result ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:ORBUtility.java


示例7: StubIORImpl

import com.sun.corba.se.spi.presentation.rmi.StubAdapter; //导入依赖的package包/类
public StubIORImpl( org.omg.CORBA.Object obj )
{
    // write the IOR to an OutputStream and get an InputStream
    OutputStream ostr = StubAdapter.getORB( obj ).create_output_stream();
    ostr.write_Object(obj);
    InputStream istr = ostr.create_input_stream();

    // read the IOR components back from the stream
    int typeLength = istr.read_long();
    typeData = new byte[typeLength];
    istr.read_octet_array(typeData, 0, typeLength);
    int numProfiles = istr.read_long();
    profileTags = new int[numProfiles];
    profileData = new byte[numProfiles][];
    for (int i = 0; i < numProfiles; i++) {
        profileTags[i] = istr.read_long();
        profileData[i] = new byte[istr.read_long()];
        istr.read_octet_array(profileData[i], 0, profileData[i].length);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:StubIORImpl.java


示例8: getDelegate

import com.sun.corba.se.spi.presentation.rmi.StubAdapter; //导入依赖的package包/类
public Delegate getDelegate( ORB orb )
{
    // write the IOR components to an org.omg.CORBA.portable.OutputStream
    OutputStream ostr = orb.create_output_stream();
    ostr.write_long(typeData.length);
    ostr.write_octet_array(typeData, 0, typeData.length);
    ostr.write_long(profileTags.length);
    for (int i = 0; i < profileTags.length; i++) {
        ostr.write_long(profileTags[i]);
        ostr.write_long(profileData[i].length);
        ostr.write_octet_array(profileData[i], 0, profileData[i].length);
    }

    InputStream istr = ostr.create_input_stream() ;

    // read the IOR back from the stream
    org.omg.CORBA.Object obj = (org.omg.CORBA.Object)istr.read_Object();
    return StubAdapter.getDelegate( obj ) ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:StubIORImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SoundCategory类代码示例发布时间:2022-05-22
下一篇:
Java Trees类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap