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


Java ObjectKey类代码示例

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


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

示例1: extractObjectKey

import com.sun.corba.se.spi.ior.ObjectKey; //导入依赖的package包/类
/**
 * Construct an ObjectKey from a byte[].
 *
 * @return ObjectKey the object key.
 */
static ObjectKey extractObjectKey(byte[] objKey, ORB orb) {

    try {
        if (objKey != null) {
            ObjectKey objectKey =
                orb.getObjectKeyFactory().create(objKey);
            if (objectKey != null) {
                return objectKey;
            }
        }
    } catch (Exception e) {
        // XXX log this exception
    }

    // This exception is thrown if any exceptions are raised while
    // extracting the object key or if the object key is empty.
    throw wrapper.invalidObjectKey();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:MessageBase.java

示例2: locate

import com.sun.corba.se.spi.ior.ObjectKey; //导入依赖的package包/类
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:47,代码来源:CorbaServerRequestDispatcherImpl.java

示例3: checkServerId

import com.sun.corba.se.spi.ior.ObjectKey; //导入依赖的package包/类
protected void checkServerId(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".checkServerId->");
        }

        ObjectKeyTemplate oktemp = okey.getTemplate() ;
        int sId = oktemp.getServerId() ;
        int scid = oktemp.getSubcontractId() ;

        if (!orb.isLocalServerId(scid, sId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".checkServerId: bad server id");
            }

            orb.handleBadServerId(okey);
        }
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".checkServerId<-");
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:CorbaServerRequestDispatcherImpl.java

示例4: BootstrapResolverImpl

import com.sun.corba.se.spi.ior.ObjectKey; //导入依赖的package包/类
public BootstrapResolverImpl(ORB orb, String host, int port) {
    wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.ORB_RESOLVER ) ;

    // Create a new IOR with the magic of INIT
    byte[] initialKey = "INIT".getBytes() ;
    ObjectKey okey = orb.getObjectKeyFactory().create(initialKey) ;

    IIOPAddress addr = IIOPFactories.makeIIOPAddress( orb, host, port ) ;
    IIOPProfileTemplate ptemp = IIOPFactories.makeIIOPProfileTemplate(
        orb, GIOPVersion.V1_0, addr);

    IORTemplate iortemp = IORFactories.makeIORTemplate( okey.getTemplate() ) ;
    iortemp.add( ptemp ) ;

    IOR initialIOR = iortemp.makeIOR( (com.sun.corba.se.spi.orb.ORB)orb,
        "", okey.getId() ) ;

    bootstrapDelegate = ORBUtility.makeClientDelegate( initialIOR ) ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:BootstrapResolverImpl.java


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