Java Code Examples for com.sun.corba.se.spi.ior.iiop.IIOPProfile

The following are top voted examples for showing how to use com.sun.corba.se.spi.ior.iiop.IIOPProfile. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: GIOPVersion.java   Source Code and License 5 votes vote down vote up
/**
 * This chooses the appropriate GIOP version.
 *
 * @return the GIOP version 13.00 if Java serialization is enabled, or
 *         smallest(profGIOPVersion, orbGIOPVersion)
 */
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {

    GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
    IIOPProfile prof = ior.getProfile() ;
    GIOPVersion profVersion = prof.getGIOPVersion();

    // Check if the profile is from a legacy Sun ORB.

    ORBVersion targetOrbVersion = prof.getORBVersion();
    if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
            targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
        // we are dealing with a SUN legacy orb which emits 1.1 IORs,
        // in spite of being able to handle only GIOP 1.0 messages.
        return V1_0;
    }

    // Now the target has to be (FOREIGN | NEWER*)

    byte prof_major = profVersion.getMajor();
    byte prof_minor = profVersion.getMinor();

    byte orb_major = orbVersion.getMajor();
    byte orb_minor = orbVersion.getMinor();

    if (orb_major < prof_major) {
        return orbVersion;
    } else if (orb_major > prof_major) {
        return profVersion;
    } else { // both major version are the same
        if (orb_minor <= prof_minor) {
            return orbVersion;
        } else {
            return profVersion;
        }
    }
}
 
Example 2
Project: OpenJSharp   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
/**
 * @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
}
 
Example 3
Project: OpenJSharp   File: IIOPProfileImpl.java   Source Code and License 5 votes vote down vote up
public boolean isEquivalent( TaggedProfile prof )
{
    if (!(prof instanceof IIOPProfile))
        return false ;

    IIOPProfile other = (IIOPProfile)prof ;

    return oid.equals( other.getObjectId() ) &&
           proftemp.isEquivalent( other.getTaggedProfileTemplate() ) &&
           oktemp.equals( other.getObjectKeyTemplate() ) ;
}
 
Example 4
Project: openjdk-jdk10   File: GIOPVersion.java   Source Code and License 5 votes vote down vote up
/**
 * This chooses the appropriate GIOP version.
 *
 * @return the GIOP version 13.00 if Java serialization is enabled, or
 *         smallest(profGIOPVersion, orbGIOPVersion)
 */
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {

    GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
    IIOPProfile prof = ior.getProfile() ;
    GIOPVersion profVersion = prof.getGIOPVersion();

    // Check if the profile is from a legacy Sun ORB.

    ORBVersion targetOrbVersion = prof.getORBVersion();
    if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
            targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
        // we are dealing with a SUN legacy orb which emits 1.1 IORs,
        // in spite of being able to handle only GIOP 1.0 messages.
        return V1_0;
    }

    // Now the target has to be (FOREIGN | NEWER*)

    byte prof_major = profVersion.getMajor();
    byte prof_minor = profVersion.getMinor();

    byte orb_major = orbVersion.getMajor();
    byte orb_minor = orbVersion.getMinor();

    if (orb_major < prof_major) {
        return orbVersion;
    } else if (orb_major > prof_major) {
        return profVersion;
    } else { // both major version are the same
        if (orb_minor <= prof_minor) {
            return orbVersion;
        } else {
            return profVersion;
        }
    }
}
 
Example 5
Project: openjdk-jdk10   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
/**
 * @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
}
 
Example 6
Project: openjdk-jdk10   File: IIOPProfileImpl.java   Source Code and License 5 votes vote down vote up
public boolean isEquivalent( TaggedProfile prof )
{
    if (!(prof instanceof IIOPProfile))
        return false ;

    IIOPProfile other = (IIOPProfile)prof ;

    return oid.equals( other.getObjectId() ) &&
           proftemp.isEquivalent( other.getTaggedProfileTemplate() ) &&
           oktemp.equals( other.getObjectKeyTemplate() ) ;
}
 
Example 7
Project: openjdk9   File: GIOPVersion.java   Source Code and License 5 votes vote down vote up
/**
 * This chooses the appropriate GIOP version.
 *
 * @return the GIOP version 13.00 if Java serialization is enabled, or
 *         smallest(profGIOPVersion, orbGIOPVersion)
 */
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {

    GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
    IIOPProfile prof = ior.getProfile() ;
    GIOPVersion profVersion = prof.getGIOPVersion();

    // Check if the profile is from a legacy Sun ORB.

    ORBVersion targetOrbVersion = prof.getORBVersion();
    if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
            targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
        // we are dealing with a SUN legacy orb which emits 1.1 IORs,
        // in spite of being able to handle only GIOP 1.0 messages.
        return V1_0;
    }

    // Now the target has to be (FOREIGN | NEWER*)

    byte prof_major = profVersion.getMajor();
    byte prof_minor = profVersion.getMinor();

    byte orb_major = orbVersion.getMajor();
    byte orb_minor = orbVersion.getMinor();

    if (orb_major < prof_major) {
        return orbVersion;
    } else if (orb_major > prof_major) {
        return profVersion;
    } else { // both major version are the same
        if (orb_minor <= prof_minor) {
            return orbVersion;
        } else {
            return profVersion;
        }
    }
}
 
Example 8
Project: openjdk9   File: CorbaContactInfoListImpl.java   Source Code and License 5 votes vote down vote up
protected void createContactInfoList()
{
    if (effectiveTargetIORContactInfoList != null) {
        return;
    }

    effectiveTargetIORContactInfoList = new ArrayList();

    IIOPProfile iiopProfile = effectiveTargetIOR.getProfile();
    String hostname =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getHost().toLowerCase();
    int    port     =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getPort();
    // For use by "sticky manager" if one is registered.
    primaryContactInfo =
        createContactInfo(SocketInfo.IIOP_CLEAR_TEXT, hostname, port);

    if (iiopProfile.isLocal()) {
        // NOTE: IMPORTANT:
        // Only do local.  The APP Server interceptors check
        // effectiveTarget.isLocal - which is determined via
        // the IOR - so if we added other addresses then
        // transactions and interceptors would not execute.
        ContactInfo contactInfo = new SharedCDRContactInfoImpl(
            orb, this, effectiveTargetIOR,
            orb.getORBData().getGIOPAddressDisposition());
        effectiveTargetIORContactInfoList.add(contactInfo);
    } else {
        addRemoteContactInfos(effectiveTargetIOR,
                              effectiveTargetIORContactInfoList);
    }
}
 
Example 9
Project: openjdk9   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
/**
 * @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
}
 
Example 10
Project: openjdk9   File: IIOPProfileImpl.java   Source Code and License 5 votes vote down vote up
public boolean isEquivalent( TaggedProfile prof )
{
    if (!(prof instanceof IIOPProfile))
        return false ;

    IIOPProfile other = (IIOPProfile)prof ;

    return oid.equals( other.getObjectId() ) &&
           proftemp.isEquivalent( other.getTaggedProfileTemplate() ) &&
           oktemp.equals( other.getObjectKeyTemplate() ) ;
}
 
Example 11
Project: lookaside_java-1.8.0-openjdk   File: GIOPVersion.java   Source Code and License 5 votes vote down vote up
/**
 * This chooses the appropriate GIOP version.
 *
 * @return the GIOP version 13.00 if Java serialization is enabled, or
 *         smallest(profGIOPVersion, orbGIOPVersion)
 */
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {

    GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
    IIOPProfile prof = ior.getProfile() ;
    GIOPVersion profVersion = prof.getGIOPVersion();

    // Check if the profile is from a legacy Sun ORB.

    ORBVersion targetOrbVersion = prof.getORBVersion();
    if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
            targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
        // we are dealing with a SUN legacy orb which emits 1.1 IORs,
        // in spite of being able to handle only GIOP 1.0 messages.
        return V1_0;
    }

    // Now the target has to be (FOREIGN | NEWER*)

    byte prof_major = profVersion.getMajor();
    byte prof_minor = profVersion.getMinor();

    byte orb_major = orbVersion.getMajor();
    byte orb_minor = orbVersion.getMinor();

    if (orb_major < prof_major) {
        return orbVersion;
    } else if (orb_major > prof_major) {
        return profVersion;
    } else { // both major version are the same
        if (orb_minor <= prof_minor) {
            return orbVersion;
        } else {
            return profVersion;
        }
    }
}
 
Example 12
Project: lookaside_java-1.8.0-openjdk   File: CorbaContactInfoListImpl.java   Source Code and License 5 votes vote down vote up
protected void createContactInfoList()
{
    if (effectiveTargetIORContactInfoList != null) {
        return;
    }

    effectiveTargetIORContactInfoList = new ArrayList();

    IIOPProfile iiopProfile = effectiveTargetIOR.getProfile();
    String hostname =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getHost().toLowerCase();
    int    port     =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getPort();
    // For use by "sticky manager" if one is registered.
    primaryContactInfo =
        createContactInfo(SocketInfo.IIOP_CLEAR_TEXT, hostname, port);

    if (iiopProfile.isLocal()) {
        // NOTE: IMPORTANT:
        // Only do local.  The APP Server interceptors check
        // effectiveTarget.isLocal - which is determined via
        // the IOR - so if we added other addresses then
        // transactions and interceptors would not execute.
        ContactInfo contactInfo = new SharedCDRContactInfoImpl(
            orb, this, effectiveTargetIOR,
            orb.getORBData().getGIOPAddressDisposition());
        effectiveTargetIORContactInfoList.add(contactInfo);
    } else {
        addRemoteContactInfos(effectiveTargetIOR,
                              effectiveTargetIORContactInfoList);
    }
}
 
Example 13
Project: lookaside_java-1.8.0-openjdk   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
/**
 * @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
}
 
Example 14
Project: lookaside_java-1.8.0-openjdk   File: IIOPProfileImpl.java   Source Code and License 5 votes vote down vote up
public boolean isEquivalent( TaggedProfile prof )
{
    if (!(prof instanceof IIOPProfile))
        return false ;

    IIOPProfile other = (IIOPProfile)prof ;

    return oid.equals( other.getObjectId() ) &&
           proftemp.isEquivalent( other.getTaggedProfileTemplate() ) &&
           oktemp.equals( other.getObjectKeyTemplate() ) ;
}
 
Example 15
Project: jdk8u_corba   File: GIOPVersion.java   Source Code and License 5 votes vote down vote up
/**
 * This chooses the appropriate GIOP version.
 *
 * @return the GIOP version 13.00 if Java serialization is enabled, or
 *         smallest(profGIOPVersion, orbGIOPVersion)
 */
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {

    GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
    IIOPProfile prof = ior.getProfile() ;
    GIOPVersion profVersion = prof.getGIOPVersion();

    // Check if the profile is from a legacy Sun ORB.

    ORBVersion targetOrbVersion = prof.getORBVersion();
    if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
            targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
        // we are dealing with a SUN legacy orb which emits 1.1 IORs,
        // in spite of being able to handle only GIOP 1.0 messages.
        return V1_0;
    }

    // Now the target has to be (FOREIGN | NEWER*)

    byte prof_major = profVersion.getMajor();
    byte prof_minor = profVersion.getMinor();

    byte orb_major = orbVersion.getMajor();
    byte orb_minor = orbVersion.getMinor();

    if (orb_major < prof_major) {
        return orbVersion;
    } else if (orb_major > prof_major) {
        return profVersion;
    } else { // both major version are the same
        if (orb_minor <= prof_minor) {
            return orbVersion;
        } else {
            return profVersion;
        }
    }
}
 
Example 16
Project: jdk8u_corba   File: CorbaContactInfoListImpl.java   Source Code and License 5 votes vote down vote up
protected void createContactInfoList()
{
    if (effectiveTargetIORContactInfoList != null) {
        return;
    }

    effectiveTargetIORContactInfoList = new ArrayList();

    IIOPProfile iiopProfile = effectiveTargetIOR.getProfile();
    String hostname =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getHost().toLowerCase();
    int    port     =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getPort();
    // For use by "sticky manager" if one is registered.
    primaryContactInfo =
        createContactInfo(SocketInfo.IIOP_CLEAR_TEXT, hostname, port);

    if (iiopProfile.isLocal()) {
        // NOTE: IMPORTANT:
        // Only do local.  The APP Server interceptors check
        // effectiveTarget.isLocal - which is determined via
        // the IOR - so if we added other addresses then
        // transactions and interceptors would not execute.
        ContactInfo contactInfo = new SharedCDRContactInfoImpl(
            orb, this, effectiveTargetIOR,
            orb.getORBData().getGIOPAddressDisposition());
        effectiveTargetIORContactInfoList.add(contactInfo);
    } else {
        addRemoteContactInfos(effectiveTargetIOR,
                              effectiveTargetIORContactInfoList);
    }
}
 
Example 17
Project: jdk8u_corba   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
/**
 * @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
}
 
Example 18
Project: jdk8u_corba   File: IIOPProfileImpl.java   Source Code and License 5 votes vote down vote up
public boolean isEquivalent( TaggedProfile prof )
{
    if (!(prof instanceof IIOPProfile))
        return false ;

    IIOPProfile other = (IIOPProfile)prof ;

    return oid.equals( other.getObjectId() ) &&
           proftemp.isEquivalent( other.getTaggedProfileTemplate() ) &&
           oktemp.equals( other.getObjectKeyTemplate() ) ;
}
 
Example 19
Project: infobip-open-jdk-8   File: GIOPVersion.java   Source Code and License 5 votes vote down vote up
/**
 * This chooses the appropriate GIOP version.
 *
 * @return the GIOP version 13.00 if Java serialization is enabled, or
 *         smallest(profGIOPVersion, orbGIOPVersion)
 */
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {

    GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
    IIOPProfile prof = ior.getProfile() ;
    GIOPVersion profVersion = prof.getGIOPVersion();

    // Check if the profile is from a legacy Sun ORB.

    ORBVersion targetOrbVersion = prof.getORBVersion();
    if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
            targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
        // we are dealing with a SUN legacy orb which emits 1.1 IORs,
        // in spite of being able to handle only GIOP 1.0 messages.
        return V1_0;
    }

    // Now the target has to be (FOREIGN | NEWER*)

    byte prof_major = profVersion.getMajor();
    byte prof_minor = profVersion.getMinor();

    byte orb_major = orbVersion.getMajor();
    byte orb_minor = orbVersion.getMinor();

    if (orb_major < prof_major) {
        return orbVersion;
    } else if (orb_major > prof_major) {
        return profVersion;
    } else { // both major version are the same
        if (orb_minor <= prof_minor) {
            return orbVersion;
        } else {
            return profVersion;
        }
    }
}
 
Example 20
Project: infobip-open-jdk-8   File: CorbaContactInfoListImpl.java   Source Code and License 5 votes vote down vote up
protected void createContactInfoList()
{
    if (effectiveTargetIORContactInfoList != null) {
        return;
    }

    effectiveTargetIORContactInfoList = new ArrayList();

    IIOPProfile iiopProfile = effectiveTargetIOR.getProfile();
    String hostname =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getHost().toLowerCase();
    int    port     =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getPort();
    // For use by "sticky manager" if one is registered.
    primaryContactInfo =
        createContactInfo(SocketInfo.IIOP_CLEAR_TEXT, hostname, port);

    if (iiopProfile.isLocal()) {
        // NOTE: IMPORTANT:
        // Only do local.  The APP Server interceptors check
        // effectiveTarget.isLocal - which is determined via
        // the IOR - so if we added other addresses then
        // transactions and interceptors would not execute.
        ContactInfo contactInfo = new SharedCDRContactInfoImpl(
            orb, this, effectiveTargetIOR,
            orb.getORBData().getGIOPAddressDisposition());
        effectiveTargetIORContactInfoList.add(contactInfo);
    } else {
        addRemoteContactInfos(effectiveTargetIOR,
                              effectiveTargetIORContactInfoList);
    }
}
 
Example 21
Project: infobip-open-jdk-8   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
/**
 * @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
}
 
Example 22
Project: infobip-open-jdk-8   File: IIOPProfileImpl.java   Source Code and License 5 votes vote down vote up
public boolean isEquivalent( TaggedProfile prof )
{
    if (!(prof instanceof IIOPProfile))
        return false ;

    IIOPProfile other = (IIOPProfile)prof ;

    return oid.equals( other.getObjectId() ) &&
           proftemp.isEquivalent( other.getTaggedProfileTemplate() ) &&
           oktemp.equals( other.getObjectKeyTemplate() ) ;
}
 
Example 23
Project: openjdk-source-code-learn   File: GIOPVersion.java   Source Code and License 5 votes vote down vote up
/**
 * This chooses the appropriate GIOP version.
 *
 * @return the GIOP version 13.00 if Java serialization is enabled, or
 *         smallest(profGIOPVersion, orbGIOPVersion)
 */
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {

    GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
    IIOPProfile prof = ior.getProfile() ;
    GIOPVersion profVersion = prof.getGIOPVersion();

    // Check if the profile is from a legacy Sun ORB.

    ORBVersion targetOrbVersion = prof.getORBVersion();
    if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
            targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
        // we are dealing with a SUN legacy orb which emits 1.1 IORs,
        // in spite of being able to handle only GIOP 1.0 messages.
        return V1_0;
    }

    // Now the target has to be (FOREIGN | NEWER*)

    byte prof_major = profVersion.getMajor();
    byte prof_minor = profVersion.getMinor();

    byte orb_major = orbVersion.getMajor();
    byte orb_minor = orbVersion.getMinor();

    if (orb_major < prof_major) {
        return orbVersion;
    } else if (orb_major > prof_major) {
        return profVersion;
    } else { // both major version are the same
        if (orb_minor <= prof_minor) {
            return orbVersion;
        } else {
            return profVersion;
        }
    }
}
 
Example 24
Project: openjdk-source-code-learn   File: CorbaContactInfoListImpl.java   Source Code and License 5 votes vote down vote up
protected void createContactInfoList()
{
    if (effectiveTargetIORContactInfoList != null) {
        return;
    }

    effectiveTargetIORContactInfoList = new ArrayList();

    IIOPProfile iiopProfile = effectiveTargetIOR.getProfile();
    String hostname =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getHost().toLowerCase();
    int    port     =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getPort();
    // For use by "sticky manager" if one is registered.
    primaryContactInfo =
        createContactInfo(SocketInfo.IIOP_CLEAR_TEXT, hostname, port);

    if (iiopProfile.isLocal()) {
        // NOTE: IMPORTANT:
        // Only do local.  The APP Server interceptors check
        // effectiveTarget.isLocal - which is determined via
        // the IOR - so if we added other addresses then
        // transactions and interceptors would not execute.
        ContactInfo contactInfo = new SharedCDRContactInfoImpl(
            orb, this, effectiveTargetIOR,
            orb.getORBData().getGIOPAddressDisposition());
        effectiveTargetIORContactInfoList.add(contactInfo);
    } else {
        addRemoteContactInfos(effectiveTargetIOR,
                              effectiveTargetIORContactInfoList);
    }
}
 
Example 25
Project: openjdk-source-code-learn   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
/**
 * @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
}
 
Example 26
Project: openjdk-source-code-learn   File: IIOPProfileImpl.java   Source Code and License 5 votes vote down vote up
public boolean isEquivalent( TaggedProfile prof )
{
    if (!(prof instanceof IIOPProfile))
        return false ;

    IIOPProfile other = (IIOPProfile)prof ;

    return oid.equals( other.getObjectId() ) &&
           proftemp.isEquivalent( other.getTaggedProfileTemplate() ) &&
           oktemp.equals( other.getObjectKeyTemplate() ) ;
}
 
Example 27
Project: OLD-OpenJDK8   File: GIOPVersion.java   Source Code and License 5 votes vote down vote up
/**
 * This chooses the appropriate GIOP version.
 *
 * @return the GIOP version 13.00 if Java serialization is enabled, or
 *         smallest(profGIOPVersion, orbGIOPVersion)
 */
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {

    GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
    IIOPProfile prof = ior.getProfile() ;
    GIOPVersion profVersion = prof.getGIOPVersion();

    // Check if the profile is from a legacy Sun ORB.

    ORBVersion targetOrbVersion = prof.getORBVersion();
    if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
            targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
        // we are dealing with a SUN legacy orb which emits 1.1 IORs,
        // in spite of being able to handle only GIOP 1.0 messages.
        return V1_0;
    }

    // Now the target has to be (FOREIGN | NEWER*)

    byte prof_major = profVersion.getMajor();
    byte prof_minor = profVersion.getMinor();

    byte orb_major = orbVersion.getMajor();
    byte orb_minor = orbVersion.getMinor();

    if (orb_major < prof_major) {
        return orbVersion;
    } else if (orb_major > prof_major) {
        return profVersion;
    } else { // both major version are the same
        if (orb_minor <= prof_minor) {
            return orbVersion;
        } else {
            return profVersion;
        }
    }
}
 
Example 28
Project: OLD-OpenJDK8   File: CorbaContactInfoListImpl.java   Source Code and License 5 votes vote down vote up
protected void createContactInfoList()
{
    if (effectiveTargetIORContactInfoList != null) {
        return;
    }

    effectiveTargetIORContactInfoList = new ArrayList();

    IIOPProfile iiopProfile = effectiveTargetIOR.getProfile();
    String hostname =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getHost().toLowerCase();
    int    port     =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getPort();
    // For use by "sticky manager" if one is registered.
    primaryContactInfo =
        createContactInfo(SocketInfo.IIOP_CLEAR_TEXT, hostname, port);

    if (iiopProfile.isLocal()) {
        // NOTE: IMPORTANT:
        // Only do local.  The APP Server interceptors check
        // effectiveTarget.isLocal - which is determined via
        // the IOR - so if we added other addresses then
        // transactions and interceptors would not execute.
        ContactInfo contactInfo = new SharedCDRContactInfoImpl(
            orb, this, effectiveTargetIOR,
            orb.getORBData().getGIOPAddressDisposition());
        effectiveTargetIORContactInfoList.add(contactInfo);
    } else {
        addRemoteContactInfos(effectiveTargetIOR,
                              effectiveTargetIORContactInfoList);
    }
}
 
Example 29
Project: OLD-OpenJDK8   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
/**
 * @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
}
 
Example 30
Project: OLD-OpenJDK8   File: IIOPProfileImpl.java   Source Code and License 5 votes vote down vote up
public boolean isEquivalent( TaggedProfile prof )
{
    if (!(prof instanceof IIOPProfile))
        return false ;

    IIOPProfile other = (IIOPProfile)prof ;

    return oid.equals( other.getObjectId() ) &&
           proftemp.isEquivalent( other.getTaggedProfileTemplate() ) &&
           oktemp.equals( other.getObjectKeyTemplate() ) ;
}
 
Example 31
Project: openjdk-orb   File: GIOPVersion.java   Source Code and License 5 votes vote down vote up
/**
 * This chooses the appropriate GIOP version.
 *
 * @return the GIOP version 13.00 if Java serialization is enabled, or
 *         smallest(profGIOPVersion, orbGIOPVersion)
 */
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {

    GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
    IIOPProfile prof = ior.getProfile() ;
    GIOPVersion profVersion = prof.getGIOPVersion();

    // Check if the profile is from a legacy Sun ORB.

    ORBVersion targetOrbVersion = prof.getORBVersion();
    if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
            targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
        // we are dealing with a SUN legacy orb which emits 1.1 IORs,
        // in spite of being able to handle only GIOP 1.0 messages.
        return V1_0;
    }

    // Now the target has to be (FOREIGN | NEWER*)

    byte prof_major = profVersion.getMajor();
    byte prof_minor = profVersion.getMinor();

    byte orb_major = orbVersion.getMajor();
    byte orb_minor = orbVersion.getMinor();

    if (orb_major < prof_major) {
        return orbVersion;
    } else if (orb_major > prof_major) {
        return profVersion;
    } else { // both major version are the same
        if (orb_minor <= prof_minor) {
            return orbVersion;
        } else {
            return profVersion;
        }
    }
}
 
Example 32
Project: openjdk-orb   File: CorbaContactInfoListImpl.java   Source Code and License 5 votes vote down vote up
protected void createContactInfoList()
{
    if (effectiveTargetIORContactInfoList != null) {
        return;
    }

    effectiveTargetIORContactInfoList = new ArrayList();

    IIOPProfile iiopProfile = effectiveTargetIOR.getProfile();
    String hostname =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getHost().toLowerCase();
    int    port     =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getPort();
    // For use by "sticky manager" if one is registered.
    primaryContactInfo =
        createContactInfo(SocketInfo.IIOP_CLEAR_TEXT, hostname, port);

    if (iiopProfile.isLocal()) {
        // NOTE: IMPORTANT:
        // Only do local.  The APP Server interceptors check
        // effectiveTarget.isLocal - which is determined via
        // the IOR - so if we added other addresses then
        // transactions and interceptors would not execute.
        ContactInfo contactInfo = new SharedCDRContactInfoImpl(
            orb, this, effectiveTargetIOR,
            orb.getORBData().getGIOPAddressDisposition());
        effectiveTargetIORContactInfoList.add(contactInfo);
    } else {
        addRemoteContactInfos(effectiveTargetIOR,
                              effectiveTargetIORContactInfoList);
    }
}
 
Example 33
Project: openjdk-orb   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
/**
 * @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
}
 
Example 34
Project: openjdk-orb   File: IIOPProfileImpl.java   Source Code and License 5 votes vote down vote up
public boolean isEquivalent( TaggedProfile prof )
{
    if (!(prof instanceof IIOPProfile))
        return false ;

    IIOPProfile other = (IIOPProfile)prof ;

    return oid.equals( other.getObjectId() ) &&
           proftemp.isEquivalent( other.getTaggedProfileTemplate() ) &&
           oktemp.equals( other.getObjectKeyTemplate() ) ;
}
 
Example 35
Project: openjdk-icedtea7   File: GIOPVersion.java   Source Code and License 5 votes vote down vote up
/**
 * This chooses the appropriate GIOP version.
 *
 * @return the GIOP version 13.00 if Java serialization is enabled, or
 *         smallest(profGIOPVersion, orbGIOPVersion)
 */
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {

    GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
    IIOPProfile prof = ior.getProfile() ;
    GIOPVersion profVersion = prof.getGIOPVersion();

    // Check if the profile is from a legacy Sun ORB.

    ORBVersion targetOrbVersion = prof.getORBVersion();
    if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
            targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
        // we are dealing with a SUN legacy orb which emits 1.1 IORs,
        // in spite of being able to handle only GIOP 1.0 messages.
        return V1_0;
    }

    // Now the target has to be (FOREIGN | NEWER*)

    byte prof_major = profVersion.getMajor();
    byte prof_minor = profVersion.getMinor();

    byte orb_major = orbVersion.getMajor();
    byte orb_minor = orbVersion.getMinor();

    if (orb_major < prof_major) {
        return orbVersion;
    } else if (orb_major > prof_major) {
        return profVersion;
    } else { // both major version are the same
        if (orb_minor <= prof_minor) {
            return orbVersion;
        } else {
            return profVersion;
        }
    }
}
 
Example 36
Project: openjdk-icedtea7   File: CorbaContactInfoListImpl.java   Source Code and License 5 votes vote down vote up
protected void createContactInfoList()
{
    if (effectiveTargetIORContactInfoList != null) {
        return;
    }

    effectiveTargetIORContactInfoList = new ArrayList();

    IIOPProfile iiopProfile = effectiveTargetIOR.getProfile();
    String hostname =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getHost().toLowerCase();
    int    port     =
        ((IIOPProfileTemplate)iiopProfile.getTaggedProfileTemplate())
            .getPrimaryAddress().getPort();
    // For use by "sticky manager" if one is registered.
    primaryContactInfo =
        createContactInfo(SocketInfo.IIOP_CLEAR_TEXT, hostname, port);

    if (iiopProfile.isLocal()) {
        // NOTE: IMPORTANT:
        // Only do local.  The APP Server interceptors check
        // effectiveTarget.isLocal - which is determined via
        // the IOR - so if we added other addresses then
        // transactions and interceptors would not execute.
        ContactInfo contactInfo = new SharedCDRContactInfoImpl(
            orb, this, effectiveTargetIOR,
            orb.getORBData().getGIOPAddressDisposition());
        effectiveTargetIORContactInfoList.add(contactInfo);
    } else {
        addRemoteContactInfos(effectiveTargetIOR,
                              effectiveTargetIORContactInfoList);
    }
}
 
Example 37
Project: openjdk-icedtea7   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
/**
 * @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
}
 
Example 38
Project: openjdk-icedtea7   File: IIOPProfileImpl.java   Source Code and License 5 votes vote down vote up
public boolean isEquivalent( TaggedProfile prof )
{
    if (!(prof instanceof IIOPProfile))
        return false ;

    IIOPProfile other = (IIOPProfile)prof ;

    return oid.equals( other.getObjectId() ) &&
           proftemp.isEquivalent( other.getTaggedProfileTemplate() ) &&
           oktemp.equals( other.getObjectKeyTemplate() ) ;
}
 
Example 39
Project: OpenJSharp   File: CorbaContactInfoBase.java   Source Code and License 4 votes vote down vote up
public IIOPProfile getEffectiveProfile()
{
    return effectiveTargetIOR.getProfile();
}
 
Example 40
Project: openjdk-jdk10   File: CorbaContactInfoBase.java   Source Code and License 4 votes vote down vote up
public IIOPProfile getEffectiveProfile()
{
    return effectiveTargetIOR.getProfile();
}