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

The following examples show how to use com.sun.corba.se.spi.ior.ObjectId. 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: 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 #2
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 #3
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 #4
Source File: IIOPProfileTemplateImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void write( ObjectKeyTemplate okeyTemplate, ObjectId id, OutputStream os)
{
    giopVersion.write( os ) ;
    primary.write( os ) ;

    // Note that this is NOT an encapsulation: do not marshal
    // the endianness flag.  However, the length is required.
    // Note that this cannot be accomplished with a codec!

    // Use the byte order of the given stream
    OutputStream encapsulatedOS =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(
            (ORB)os.orb(), ((CDROutputStream)os).isLittleEndian() ) ;

    okeyTemplate.write( id, encapsulatedOS ) ;
    EncapsulationUtility.writeOutputStream( encapsulatedOS, os ) ;

    if (giopVersion.getMinor() > 0)
        EncapsulationUtility.writeIdentifiableSequence( this, os ) ;
}
 
Example #5
Source File: IIOPProfileImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public IIOPProfileImpl( ORB orb, ObjectKeyTemplate oktemp, ObjectId oid,
    IIOPProfileTemplate proftemp )
{
    this( orb ) ;
    this.oktemp = oktemp ;
    this.oid = oid ;
    this.proftemp = proftemp ;
}
 
Example #6
Source File: ObjectReferenceProducerBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.CORBA.Object make_object (String repositoryId,
    byte[] objectId)
{
    ObjectId oid = IORFactories.makeObjectId( objectId ) ;
    IOR ior = getIORFactory().makeIOR( orb, repositoryId, oid ) ;

    return ORBUtility.makeObjectReference( ior ) ;
}
 
Example #7
Source File: IORImpl.java    From openjdk-8-source 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 #8
Source File: IORImpl.java    From jdk1.8-source-analysis with Apache License 2.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 #9
Source File: IORImpl.java    From openjdk-8 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 #10
Source File: OldJIDLObjectKeyTemplate.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void write(ObjectId objectId, OutputStream os)
{
    super.write(objectId, os);

    if (patchVersion != OldJIDLObjectKeyTemplate.NULL_PATCH_VERSION)
       os.write_octet( patchVersion ) ;
}
 
Example #11
Source File: ObjectReferenceProducerBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.CORBA.Object make_object (String repositoryId,
    byte[] objectId)
{
    ObjectId oid = IORFactories.makeObjectId( objectId ) ;
    IOR ior = getIORFactory().makeIOR( orb, repositoryId, oid ) ;

    return ORBUtility.makeObjectReference( ior ) ;
}
 
Example #12
Source File: IIOPProfileImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public IIOPProfileImpl( ORB orb, ObjectKeyTemplate oktemp, ObjectId oid,
    IIOPProfileTemplate proftemp )
{
    this( orb ) ;
    this.oktemp = oktemp ;
    this.oid = oid ;
    this.proftemp = proftemp ;
}
 
Example #13
Source File: IORImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Construct an IOR from an IORTemplate by applying the same
* object id to each TaggedProfileTemplate in the IORTemplate.
*/
public IORImpl( ORB orb, String typeId, IORTemplate iortemp, ObjectId id)
{
    this( orb, typeId ) ;

    this.iortemps = IORFactories.makeIORTemplateList() ;
    this.iortemps.add( iortemp ) ;

    addTaggedProfiles( iortemp, id ) ;

    makeImmutable() ;
}
 
Example #14
Source File: IORImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** Construct an IOR from an IORTemplate by applying the same
* object id to each TaggedProfileTemplate in the IORTemplate.
*/
public IORImpl( ORB orb, String typeId, IORTemplate iortemp, ObjectId id)
{
    this( orb, typeId ) ;

    this.iortemps = IORFactories.makeIORTemplateList() ;
    this.iortemps.add( iortemp ) ;

    addTaggedProfiles( iortemp, id ) ;

    makeImmutable() ;
}
 
Example #15
Source File: IIOPProfileImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public IIOPProfileImpl( ORB orb, ObjectKeyTemplate oktemp, ObjectId oid,
    IIOPProfileTemplate proftemp )
{
    this( orb ) ;
    this.oktemp = oktemp ;
    this.oid = oid ;
    this.proftemp = proftemp ;
}
 
Example #16
Source File: ObjectReferenceProducerBase.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.CORBA.Object make_object (String repositoryId,
    byte[] objectId)
{
    ObjectId oid = IORFactories.makeObjectId( objectId ) ;
    IOR ior = getIORFactory().makeIOR( orb, repositoryId, oid ) ;

    return ORBUtility.makeObjectReference( ior ) ;
}
 
Example #17
Source File: IORImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/** Construct an IOR from an IORTemplate by applying the same
* object id to each TaggedProfileTemplate in the IORTemplate.
*/
public IORImpl( ORB orb, String typeId, IORTemplate iortemp, ObjectId id)
{
    this( orb, typeId ) ;

    this.iortemps = IORFactories.makeIORTemplateList() ;
    this.iortemps.add( iortemp ) ;

    addTaggedProfiles( iortemp, id ) ;

    makeImmutable() ;
}
 
Example #18
Source File: IORImpl.java    From openjdk-8-source 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 #19
Source File: ObjectReferenceProducerBase.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.CORBA.Object make_object (String repositoryId,
    byte[] objectId)
{
    ObjectId oid = IORFactories.makeObjectId( objectId ) ;
    IOR ior = getIORFactory().makeIOR( orb, repositoryId, oid ) ;

    return ORBUtility.makeObjectReference( ior ) ;
}
 
Example #20
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 #21
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 #22
Source File: IORImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/** Construct an IOR from an IORTemplate by applying the same
* object id to each TaggedProfileTemplate in the IORTemplate.
*/
public IORImpl( ORB orb, String typeId, IORTemplate iortemp, ObjectId id)
{
    this( orb, typeId ) ;

    this.iortemps = IORFactories.makeIORTemplateList() ;
    this.iortemps.add( iortemp ) ;

    addTaggedProfiles( iortemp, id ) ;

    makeImmutable() ;
}
 
Example #23
Source File: IORImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/** Construct an IOR from an IORTemplate by applying the same
* object id to each TaggedProfileTemplate in the IORTemplate.
*/
public IORImpl( ORB orb, String typeId, IORTemplateList iortemps, ObjectId id)
{
    this( orb, typeId ) ;

    this.iortemps = iortemps ;

    Iterator iter = iortemps.iterator() ;
    while (iter.hasNext()) {
        IORTemplate iortemp = (IORTemplate)(iter.next()) ;
        addTaggedProfiles( iortemp, id ) ;
    }

    makeImmutable() ;
}
 
Example #24
Source File: OldJIDLObjectKeyTemplate.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void write(ObjectId objectId, OutputStream os)
{
    super.write(objectId, os);

    if (patchVersion != OldJIDLObjectKeyTemplate.NULL_PATCH_VERSION)
       os.write_octet( patchVersion ) ;
}
 
Example #25
Source File: OldJIDLObjectKeyTemplate.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void write(ObjectId objectId, OutputStream os)
{
    super.write(objectId, os);

    if (patchVersion != OldJIDLObjectKeyTemplate.NULL_PATCH_VERSION)
       os.write_octet( patchVersion ) ;
}
 
Example #26
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 #27
Source File: IORImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Construct an IOR from an IORTemplate by applying the same
* object id to each TaggedProfileTemplate in the IORTemplate.
*/
public IORImpl( ORB orb, String typeId, IORTemplate iortemp, ObjectId id)
{
    this( orb, typeId ) ;

    this.iortemps = IORFactories.makeIORTemplateList() ;
    this.iortemps.add( iortemp ) ;

    addTaggedProfiles( iortemp, id ) ;

    makeImmutable() ;
}
 
Example #28
Source File: IORImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Construct an IOR from an IORTemplate by applying the same
* object id to each TaggedProfileTemplate in the IORTemplate.
*/
public IORImpl( ORB orb, String typeId, IORTemplate iortemp, ObjectId id)
{
    this( orb, typeId ) ;

    this.iortemps = IORFactories.makeIORTemplateList() ;
    this.iortemps.add( iortemp ) ;

    addTaggedProfiles( iortemp, id ) ;

    makeImmutable() ;
}
 
Example #29
Source File: IORImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Construct an IOR from an IORTemplate by applying the same
* object id to each TaggedProfileTemplate in the IORTemplate.
*/
public IORImpl( ORB orb, String typeId, IORTemplateList iortemps, ObjectId id)
{
    this( orb, typeId ) ;

    this.iortemps = iortemps ;

    Iterator iter = iortemps.iterator() ;
    while (iter.hasNext()) {
        IORTemplate iortemp = (IORTemplate)(iter.next()) ;
        addTaggedProfiles( iortemp, id ) ;
    }

    makeImmutable() ;
}
 
Example #30
Source File: IORImpl.java    From JDKSourceCode1.8 with MIT License 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 ) ;
    }
}