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


Java IIOPProfileTemplate.iteratorById方法代码示例

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


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

示例1: getStreamFormatVersionForThisRequest

import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate; //导入方法依赖的package包/类
private byte getStreamFormatVersionForThisRequest(IOR ior,
                                                  GIOPVersion giopVersion)
{

    byte localMaxVersion
        = ORBUtility.getMaxStreamFormatVersion();

    IOR effectiveTargetIOR =
        ((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR();
    IIOPProfileTemplate temp =
        (IIOPProfileTemplate)effectiveTargetIOR.getProfile().getTaggedProfileTemplate();
    Iterator iter = temp.iteratorById(TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.value);
    if (!iter.hasNext()) {
        // Didn't have the max stream format version tagged
        // component.
        if (giopVersion.lessThan(GIOPVersion.V1_3))
            return ORBConstants.STREAM_FORMAT_VERSION_1;
        else
            return ORBConstants.STREAM_FORMAT_VERSION_2;
    }

    byte remoteMaxVersion
        = ((MaxStreamFormatVersionComponent)iter.next()).getMaxStreamFormatVersion();

    return (byte)Math.min(localMaxVersion, remoteMaxVersion);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:CorbaMessageMediatorImpl.java

示例2: getSocketInfo

import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate; //导入方法依赖的package包/类
public List getSocketInfo(IOR ior)
{
    SocketInfo socketInfo;
    List result = new ArrayList();

    IIOPProfileTemplate iiopProfileTemplate = (IIOPProfileTemplate)
        ior.getProfile().getTaggedProfileTemplate() ;
    IIOPAddress primary = iiopProfileTemplate.getPrimaryAddress() ;
    String hostname = primary.getHost().toLowerCase();
    int    port     = primary.getPort();
    // NOTE: we could check for 0 (i.e., CSIv2) but, for a
    // non-CSIv2-configured client ORB talking to a CSIv2 configured
    // server ORB you might end up with an empty contact info list
    // which would then report a failure which would not be as
    // instructive as leaving a ContactInfo with a 0 port in the list.
    socketInfo = createSocketInfo(hostname, port);
    result.add(socketInfo);

    Iterator iterator = iiopProfileTemplate.iteratorById(
        TAG_ALTERNATE_IIOP_ADDRESS.value);

    while (iterator.hasNext()) {
        AlternateIIOPAddressComponent alternate =
            (AlternateIIOPAddressComponent) iterator.next();
        hostname = alternate.getAddress().getHost().toLowerCase();
        port     = alternate.getAddress().getPort();
        socketInfo= createSocketInfo(hostname, port);
        result.add(socketInfo);
    }
    return result;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:DefaultIORToSocketInfoImpl.java

示例3: getEncodingVersion

import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate; //导入方法依赖的package包/类
/**
 * @return the Java serialization encoding version.
 */
public static byte getEncodingVersion(ORB orb, IOR ior) {

    // Is Java serialization enabled?
    // Check the JavaSerializationComponent (tagged component)
    // in the IIOPProfile. If present, the peer ORB's GIOP is capable
    // of using Java serialization instead of CDR serialization.
    // In such a case, use Java serialization, iff the java serialization
    // versions match.

    if (orb.getORBData().isJavaSerializationEnabled()) {
        IIOPProfile prof = ior.getProfile();
        IIOPProfileTemplate profTemp =
            (IIOPProfileTemplate) prof.getTaggedProfileTemplate();
        java.util.Iterator iter = profTemp.iteratorById(
                              ORBConstants.TAG_JAVA_SERIALIZATION_ID);
        if (iter.hasNext()) {
            JavaSerializationComponent jc =
                (JavaSerializationComponent) iter.next();
            byte jcVersion = jc.javaSerializationVersion();
            if (jcVersion >= Message.JAVA_ENC_VERSION) {
                return Message.JAVA_ENC_VERSION;
            } else if (jcVersion > Message.CDR_ENC_VERSION) {
                return jc.javaSerializationVersion();
            } else {
                // throw error?
                // Since encodingVersion is <= 0 (CDR_ENC_VERSION).
            }
        }
    }
    return Message.CDR_ENC_VERSION; // default
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:ORBUtility.java

示例4: performCodeSetNegotiation

import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate; //导入方法依赖的package包/类
protected void performCodeSetNegotiation(CorbaMessageMediator messageMediator)
{
    CorbaConnection conn =
        (CorbaConnection) messageMediator.getConnection();
    IOR ior =
        ((CorbaContactInfo)messageMediator.getContactInfo())
        .getEffectiveTargetIOR();
    GIOPVersion giopVersion = messageMediator.getGIOPVersion();

    // XXX This seems to be a broken double checked locking idiom: FIX IT!

    // conn.getCodeSetContext() is null when no other requests have
    // been made on this connection to trigger code set negotation.
    if (conn != null &&
        conn.getCodeSetContext() == null &&
        !giopVersion.equals(GIOPVersion.V1_0)) {

        synchronized(conn) {
            // Double checking.  Don't let any other
            // threads use this connection until the
            // code sets are straight.
            if (conn.getCodeSetContext() != null)
                return;

            // This only looks at the first code set component.  If
            // there can be multiple locations with multiple code sets,
            // this requires more work.
            IIOPProfileTemplate temp =
                (IIOPProfileTemplate)ior.getProfile().
                getTaggedProfileTemplate();
            Iterator iter = temp.iteratorById(TAG_CODE_SETS.value);
            if (!iter.hasNext()) {
                // Didn't have a code set component.  The default will
                // be to use ISO8859-1 for char data and throw an
                // exception if wchar data is used.
                return;
            }

            // Get the native and conversion code sets the
            // server specified in its IOR
            CodeSetComponentInfo serverCodeSets
                = ((CodeSetsComponent)iter.next()).getCodeSetComponentInfo();

            // Perform the negotiation between this ORB's code sets and
            // the ones from the IOR
            CodeSetComponentInfo.CodeSetContext result
                = CodeSetConversion.impl().negotiate(
                      conn.getBroker().getORBData().getCodeSetComponentInfo(),
                      serverCodeSets);

            conn.setCodeSetContext(result);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:55,代码来源:CorbaClientRequestDispatcherImpl.java


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