com.sun.corba.se.spi.ior.TaggedProfile Java Examples

The following examples show how to use com.sun.corba.se.spi.ior.TaggedProfile. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LocalClientRequestDispatcherBase.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
protected LocalClientRequestDispatcherBase(ORB orb, int scid, IOR ior)
{
    this.orb = orb ;

    TaggedProfile prof = ior.getProfile() ;
    servantIsLocal = orb.getORBData().isLocalOptimizationAllowed() &&
        prof.isLocal();

    ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;
    this.scid = oktemp.getSubcontractId() ;
    RequestDispatcherRegistry sreg = orb.getRequestDispatcherRegistry() ;
    oaf = sreg.getObjectAdapterFactory( scid ) ;
    oaid = oktemp.getObjectAdapterId() ;
    ObjectId oid = prof.getObjectId() ;
    objectId = oid.getId() ;
}
 
Example #2
Source File: LocalClientRequestDispatcherBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
protected LocalClientRequestDispatcherBase(ORB orb, int scid, IOR ior)
{
    this.orb = orb ;

    TaggedProfile prof = ior.getProfile() ;
    servantIsLocal = orb.getORBData().isLocalOptimizationAllowed() &&
        prof.isLocal();

    ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;
    this.scid = oktemp.getSubcontractId() ;
    RequestDispatcherRegistry sreg = orb.getRequestDispatcherRegistry() ;
    oaf = sreg.getObjectAdapterFactory( scid ) ;
    oaid = oktemp.getObjectAdapterId() ;
    ObjectId oid = prof.getObjectId() ;
    objectId = oid.getId() ;
}
 
Example #3
Source File: LocalClientRequestDispatcherBase.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
protected LocalClientRequestDispatcherBase(ORB orb, int scid, IOR ior)
{
    this.orb = orb ;

    TaggedProfile prof = ior.getProfile() ;
    servantIsLocal = orb.getORBData().isLocalOptimizationAllowed() &&
        prof.isLocal();

    ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;
    this.scid = oktemp.getSubcontractId() ;
    RequestDispatcherRegistry sreg = orb.getRequestDispatcherRegistry() ;
    oaf = sreg.getObjectAdapterFactory( scid ) ;
    oaid = oktemp.getObjectAdapterId() ;
    ObjectId oid = prof.getObjectId() ;
    objectId = oid.getId() ;
}
 
Example #4
Source File: POAImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private byte[] internalReferenceToId(
    org.omg.CORBA.Object reference ) throws WrongAdapter
{
    IOR ior = ORBUtility.getIOR( reference ) ;
    IORTemplateList thisTemplate = ior.getIORTemplates() ;

    ObjectReferenceFactory orf = getCurrentFactory() ;
    IORTemplateList poaTemplate =
        IORFactories.getIORTemplateList( orf ) ;

    if (!poaTemplate.isEquivalent( thisTemplate ))
        throw new WrongAdapter();

    // Extract the ObjectId from the first TaggedProfile in the IOR.
    // If ior was created in this POA, the same ID was used for
    // every profile through the profile templates in the currentFactory,
    // so we will get the same result from any profile.
    Iterator iter = ior.iterator() ;
    if (!iter.hasNext())
        throw iorWrapper().noProfilesInIor() ;
    TaggedProfile prof = (TaggedProfile)(iter.next()) ;
    ObjectId oid = prof.getObjectId() ;

    return oid.getId();
}
 
Example #5
Source File: POAImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private byte[] internalReferenceToId(
    org.omg.CORBA.Object reference ) throws WrongAdapter
{
    IOR ior = ORBUtility.getIOR( reference ) ;
    IORTemplateList thisTemplate = ior.getIORTemplates() ;

    ObjectReferenceFactory orf = getCurrentFactory() ;
    IORTemplateList poaTemplate =
        IORFactories.getIORTemplateList( orf ) ;

    if (!poaTemplate.isEquivalent( thisTemplate ))
        throw new WrongAdapter();

    // Extract the ObjectId from the first TaggedProfile in the IOR.
    // If ior was created in this POA, the same ID was used for
    // every profile through the profile templates in the currentFactory,
    // so we will get the same result from any profile.
    Iterator iter = ior.iterator() ;
    if (!iter.hasNext())
        throw iorWrapper().noProfilesInIor() ;
    TaggedProfile prof = (TaggedProfile)(iter.next()) ;
    ObjectId oid = prof.getObjectId() ;

    return oid.getId();
}
 
Example #6
Source File: LocalClientRequestDispatcherBase.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
protected LocalClientRequestDispatcherBase(ORB orb, int scid, IOR ior)
{
    this.orb = orb ;

    TaggedProfile prof = ior.getProfile() ;
    servantIsLocal = orb.getORBData().isLocalOptimizationAllowed() &&
        prof.isLocal();

    ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;
    this.scid = oktemp.getSubcontractId() ;
    RequestDispatcherRegistry sreg = orb.getRequestDispatcherRegistry() ;
    oaf = sreg.getObjectAdapterFactory( scid ) ;
    oaid = oktemp.getObjectAdapterId() ;
    ObjectId oid = prof.getObjectId() ;
    objectId = oid.getId() ;
}
 
Example #7
Source File: POAImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private byte[] internalReferenceToId(
    org.omg.CORBA.Object reference ) throws WrongAdapter
{
    IOR ior = ORBUtility.getIOR( reference ) ;
    IORTemplateList thisTemplate = ior.getIORTemplates() ;

    ObjectReferenceFactory orf = getCurrentFactory() ;
    IORTemplateList poaTemplate =
        IORFactories.getIORTemplateList( orf ) ;

    if (!poaTemplate.isEquivalent( thisTemplate ))
        throw new WrongAdapter();

    // Extract the ObjectId from the first TaggedProfile in the IOR.
    // If ior was created in this POA, the same ID was used for
    // every profile through the profile templates in the currentFactory,
    // so we will get the same result from any profile.
    Iterator iter = ior.iterator() ;
    if (!iter.hasNext())
        throw iorWrapper().noProfilesInIor() ;
    TaggedProfile prof = (TaggedProfile)(iter.next()) ;
    ObjectId oid = prof.getObjectId() ;

    return oid.getId();
}
 
Example #8
Source File: LocalClientRequestDispatcherBase.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
protected LocalClientRequestDispatcherBase(ORB orb, int scid, IOR ior)
{
    this.orb = orb ;

    TaggedProfile prof = ior.getProfile() ;
    servantIsLocal = orb.getORBData().isLocalOptimizationAllowed() &&
        prof.isLocal();

    ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;
    this.scid = oktemp.getSubcontractId() ;
    RequestDispatcherRegistry sreg = orb.getRequestDispatcherRegistry() ;
    oaf = sreg.getObjectAdapterFactory( scid ) ;
    oaid = oktemp.getObjectAdapterId() ;
    ObjectId oid = prof.getObjectId() ;
    objectId = oid.getId() ;
}
 
Example #9
Source File: LocalClientRequestDispatcherBase.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
protected LocalClientRequestDispatcherBase(ORB orb, int scid, IOR ior)
{
    this.orb = orb ;

    TaggedProfile prof = ior.getProfile() ;
    servantIsLocal = orb.getORBData().isLocalOptimizationAllowed() &&
        prof.isLocal();

    ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;
    this.scid = oktemp.getSubcontractId() ;
    RequestDispatcherRegistry sreg = orb.getRequestDispatcherRegistry() ;
    oaf = sreg.getObjectAdapterFactory( scid ) ;
    oaid = oktemp.getObjectAdapterId() ;
    ObjectId oid = prof.getObjectId() ;
    objectId = oid.getId() ;
}
 
Example #10
Source File: POAImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private byte[] internalReferenceToId(
    org.omg.CORBA.Object reference ) throws WrongAdapter
{
    IOR ior = ORBUtility.getIOR( reference ) ;
    IORTemplateList thisTemplate = ior.getIORTemplates() ;

    ObjectReferenceFactory orf = getCurrentFactory() ;
    IORTemplateList poaTemplate =
        IORFactories.getIORTemplateList( orf ) ;

    if (!poaTemplate.isEquivalent( thisTemplate ))
        throw new WrongAdapter();

    // Extract the ObjectId from the first TaggedProfile in the IOR.
    // If ior was created in this POA, the same ID was used for
    // every profile through the profile templates in the currentFactory,
    // so we will get the same result from any profile.
    Iterator iter = ior.iterator() ;
    if (!iter.hasNext())
        throw iorWrapper().noProfilesInIor() ;
    TaggedProfile prof = (TaggedProfile)(iter.next()) ;
    ObjectId oid = prof.getObjectId() ;

    return oid.getId();
}
 
Example #11
Source File: POAImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
private byte[] internalReferenceToId(
    org.omg.CORBA.Object reference ) throws WrongAdapter
{
    IOR ior = ORBUtility.getIOR( reference ) ;
    IORTemplateList thisTemplate = ior.getIORTemplates() ;

    ObjectReferenceFactory orf = getCurrentFactory() ;
    IORTemplateList poaTemplate =
        IORFactories.getIORTemplateList( orf ) ;

    if (!poaTemplate.isEquivalent( thisTemplate ))
        throw new WrongAdapter();

    // Extract the ObjectId from the first TaggedProfile in the IOR.
    // If ior was created in this POA, the same ID was used for
    // every profile through the profile templates in the currentFactory,
    // so we will get the same result from any profile.
    Iterator iter = ior.iterator() ;
    if (!iter.hasNext())
        throw iorWrapper().noProfilesInIor() ;
    TaggedProfile prof = (TaggedProfile)(iter.next()) ;
    ObjectId oid = prof.getObjectId() ;

    return oid.getId();
}
 
Example #12
Source File: LocalClientRequestDispatcherBase.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
protected LocalClientRequestDispatcherBase(ORB orb, int scid, IOR ior)
{
    this.orb = orb ;

    TaggedProfile prof = ior.getProfile() ;
    servantIsLocal = orb.getORBData().isLocalOptimizationAllowed() &&
        prof.isLocal();

    ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;
    this.scid = oktemp.getSubcontractId() ;
    RequestDispatcherRegistry sreg = orb.getRequestDispatcherRegistry() ;
    oaf = sreg.getObjectAdapterFactory( scid ) ;
    oaid = oktemp.getObjectAdapterId() ;
    ObjectId oid = prof.getObjectId() ;
    objectId = oid.getId() ;
}
 
Example #13
Source File: LocalClientRequestDispatcherBase.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
protected LocalClientRequestDispatcherBase(ORB orb, int scid, IOR ior)
{
    this.orb = orb ;

    TaggedProfile prof = ior.getProfile() ;
    servantIsLocal = orb.getORBData().isLocalOptimizationAllowed() &&
        prof.isLocal();

    ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;
    this.scid = oktemp.getSubcontractId() ;
    RequestDispatcherRegistry sreg = orb.getRequestDispatcherRegistry() ;
    oaf = sreg.getObjectAdapterFactory( scid ) ;
    oaid = oktemp.getObjectAdapterId() ;
    ObjectId oid = prof.getObjectId() ;
    objectId = oid.getId() ;
}
 
Example #14
Source File: IIOPProfileImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 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
Source File: IIOPProfileImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    os.write_long( getId() ) ;
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example #16
Source File: IORImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public boolean isEquivalent(IOR ior)
{
    Iterator myIterator = iterator() ;
    Iterator otherIterator = ior.iterator() ;
    while (myIterator.hasNext() && otherIterator.hasNext()) {
        TaggedProfile myProfile = (TaggedProfile)(myIterator.next()) ;
        TaggedProfile otherProfile = (TaggedProfile)(otherIterator.next()) ;
        if (!myProfile.isEquivalent( otherProfile ))
            return false ;
    }

    return myIterator.hasNext() == otherIterator.hasNext() ;
}
 
Example #17
Source File: GenericTaggedProfile.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example #18
Source File: IIOPProfileImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public IIOPProfileImpl( ORB orb, org.omg.IOP.TaggedProfile profile)
{
    this( orb ) ;

    if (profile == null || profile.tag != TAG_INTERNET_IOP.value ||
        profile.profile_data == null) {
        throw wrapper.invalidTaggedProfile() ;
    }

    EncapsInputStream istr = EncapsInputStreamFactory.newEncapsInputStream((ORB)orb, profile.profile_data,
            profile.profile_data.length);
    istr.consumeEndian();
    init( istr ) ;
}
 
Example #19
Source File: IORImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void addTaggedProfiles( IORTemplate iortemp, ObjectId id )
{
    ObjectKeyTemplate oktemp = iortemp.getObjectKeyTemplate() ;
    Iterator templateIterator = iortemp.iterator() ;

    while (templateIterator.hasNext()) {
        TaggedProfileTemplate ptemp =
            (TaggedProfileTemplate)(templateIterator.next()) ;

        TaggedProfile profile = ptemp.create( oktemp, id ) ;

        add( profile ) ;
    }
}
 
Example #20
Source File: GenericTaggedProfile.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example #21
Source File: IORImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void initializeIORTemplateList()
{
    // Maps ObjectKeyTemplate to IORTemplate
    Map oktempToIORTemplate = new HashMap() ;

    iortemps = IORFactories.makeIORTemplateList() ;
    Iterator iter = iterator() ;
    ObjectId oid = null ; // used to check that all profiles have the same oid.
    while (iter.hasNext()) {
        TaggedProfile prof = (TaggedProfile)(iter.next()) ;
        TaggedProfileTemplate ptemp = prof.getTaggedProfileTemplate() ;
        ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;

        // Check that all oids for all profiles are the same: if they are not,
        // throw exception.
        if (oid == null)
            oid = prof.getObjectId() ;
        else if (!oid.equals( prof.getObjectId() ))
            throw wrapper.badOidInIorTemplateList() ;

        // Find or create the IORTemplate for oktemp.
        IORTemplate iortemp = (IORTemplate)(oktempToIORTemplate.get( oktemp )) ;
        if (iortemp == null) {
            iortemp = IORFactories.makeIORTemplate( oktemp ) ;
            oktempToIORTemplate.put( oktemp, iortemp ) ;
            iortemps.add( iortemp ) ;
        }

        iortemp.add( ptemp ) ;
    }

    iortemps.makeImmutable() ;
}
 
Example #22
Source File: IORImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public boolean isEquivalent(IOR ior)
{
    Iterator myIterator = iterator() ;
    Iterator otherIterator = ior.iterator() ;
    while (myIterator.hasNext() && otherIterator.hasNext()) {
        TaggedProfile myProfile = (TaggedProfile)(myIterator.next()) ;
        TaggedProfile otherProfile = (TaggedProfile)(otherIterator.next()) ;
        if (!myProfile.isEquivalent( otherProfile ))
            return false ;
    }

    return myIterator.hasNext() == otherIterator.hasNext() ;
}
 
Example #23
Source File: IORImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void addTaggedProfiles( IORTemplate iortemp, ObjectId id )
{
    ObjectKeyTemplate oktemp = iortemp.getObjectKeyTemplate() ;
    Iterator templateIterator = iortemp.iterator() ;

    while (templateIterator.hasNext()) {
        TaggedProfileTemplate ptemp =
            (TaggedProfileTemplate)(templateIterator.next()) ;

        TaggedProfile profile = ptemp.create( oktemp, id ) ;

        add( profile ) ;
    }
}
 
Example #24
Source File: GenericTaggedProfile.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example #25
Source File: IORImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void initializeIORTemplateList()
{
    // Maps ObjectKeyTemplate to IORTemplate
    Map oktempToIORTemplate = new HashMap() ;

    iortemps = IORFactories.makeIORTemplateList() ;
    Iterator iter = iterator() ;
    ObjectId oid = null ; // used to check that all profiles have the same oid.
    while (iter.hasNext()) {
        TaggedProfile prof = (TaggedProfile)(iter.next()) ;
        TaggedProfileTemplate ptemp = prof.getTaggedProfileTemplate() ;
        ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;

        // Check that all oids for all profiles are the same: if they are not,
        // throw exception.
        if (oid == null)
            oid = prof.getObjectId() ;
        else if (!oid.equals( prof.getObjectId() ))
            throw wrapper.badOidInIorTemplateList() ;

        // Find or create the IORTemplate for oktemp.
        IORTemplate iortemp = (IORTemplate)(oktempToIORTemplate.get( oktemp )) ;
        if (iortemp == null) {
            iortemp = IORFactories.makeIORTemplate( oktemp ) ;
            oktempToIORTemplate.put( oktemp, iortemp ) ;
            iortemps.add( iortemp ) ;
        }

        iortemp.add( ptemp ) ;
    }

    iortemps.makeImmutable() ;
}
 
Example #26
Source File: IIOPProfileImpl.java    From openjdk-8 with GNU General Public License v2.0 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
Source File: IIOPProfileImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    os.write_long( getId() ) ;
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example #28
Source File: IIOPProfileImpl.java    From JDKSourceCode1.8 with MIT 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 #29
Source File: IORImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean isEquivalent(IOR ior)
{
    Iterator myIterator = iterator() ;
    Iterator otherIterator = ior.iterator() ;
    while (myIterator.hasNext() && otherIterator.hasNext()) {
        TaggedProfile myProfile = (TaggedProfile)(myIterator.next()) ;
        TaggedProfile otherProfile = (TaggedProfile)(otherIterator.next()) ;
        if (!myProfile.isEquivalent( otherProfile ))
            return false ;
    }

    return myIterator.hasNext() == otherIterator.hasNext() ;
}
 
Example #30
Source File: IIOPProfileImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    os.write_long( getId() ) ;
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}