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

The following examples show how to use com.sun.corba.se.spi.ior.IORTemplateList. 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: IORTemplateListImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public boolean isEquivalent( IORFactory other )
{
    if (!(other instanceof IORTemplateList))
        return false ;

    IORTemplateList list = (IORTemplateList)other ;

    Iterator thisIterator = iterator() ;
    Iterator listIterator = list.iterator() ;
    while (thisIterator.hasNext() && listIterator.hasNext()) {
        IORTemplate thisTemplate = (IORTemplate)thisIterator.next() ;
        IORTemplate listTemplate = (IORTemplate)listIterator.next() ;
        if (!thisTemplate.isEquivalent( listTemplate ))
            return false ;
    }

    return thisIterator.hasNext() == listIterator.hasNext() ;
}
 
Example #2
Source File: IORTemplateListImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public boolean isEquivalent( IORFactory other )
{
    if (!(other instanceof IORTemplateList))
        return false ;

    IORTemplateList list = (IORTemplateList)other ;

    Iterator thisIterator = iterator() ;
    Iterator listIterator = list.iterator() ;
    while (thisIterator.hasNext() && listIterator.hasNext()) {
        IORTemplate thisTemplate = (IORTemplate)thisIterator.next() ;
        IORTemplate listTemplate = (IORTemplate)listIterator.next() ;
        if (!thisTemplate.isEquivalent( listTemplate ))
            return false ;
    }

    return thisIterator.hasNext() == listIterator.hasNext() ;
}
 
Example #3
Source File: POAImpl.java    From hottub 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 #4
Source File: IORTemplateListImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public boolean isEquivalent( IORFactory other )
{
    if (!(other instanceof IORTemplateList))
        return false ;

    IORTemplateList list = (IORTemplateList)other ;

    Iterator thisIterator = iterator() ;
    Iterator listIterator = list.iterator() ;
    while (thisIterator.hasNext() && listIterator.hasNext()) {
        IORTemplate thisTemplate = (IORTemplate)thisIterator.next() ;
        IORTemplate listTemplate = (IORTemplate)listIterator.next() ;
        if (!thisTemplate.isEquivalent( listTemplate ))
            return false ;
    }

    return thisIterator.hasNext() == listIterator.hasNext() ;
}
 
Example #5
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 #6
Source File: POAImpl.java    From jdk1.8-source-analysis with Apache License 2.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 #7
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 #8
Source File: IORTemplateListImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public boolean isEquivalent( IORFactory other )
{
    if (!(other instanceof IORTemplateList))
        return false ;

    IORTemplateList list = (IORTemplateList)other ;

    Iterator thisIterator = iterator() ;
    Iterator listIterator = list.iterator() ;
    while (thisIterator.hasNext() && listIterator.hasNext()) {
        IORTemplate thisTemplate = (IORTemplate)thisIterator.next() ;
        IORTemplate listTemplate = (IORTemplate)listIterator.next() ;
        if (!thisTemplate.isEquivalent( listTemplate ))
            return false ;
    }

    return thisIterator.hasNext() == listIterator.hasNext() ;
}
 
Example #9
Source File: IORTemplateListImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean isEquivalent( IORFactory other )
{
    if (!(other instanceof IORTemplateList))
        return false ;

    IORTemplateList list = (IORTemplateList)other ;

    Iterator thisIterator = iterator() ;
    Iterator listIterator = list.iterator() ;
    while (thisIterator.hasNext() && listIterator.hasNext()) {
        IORTemplate thisTemplate = (IORTemplate)thisIterator.next() ;
        IORTemplate listTemplate = (IORTemplate)listIterator.next() ;
        if (!thisTemplate.isEquivalent( listTemplate ))
            return false ;
    }

    return thisIterator.hasNext() == listIterator.hasNext() ;
}
 
Example #10
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 #11
Source File: POAImpl.java    From openjdk-8-source 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 #12
Source File: IORTemplateListImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public boolean isEquivalent( IORFactory other )
{
    if (!(other instanceof IORTemplateList))
        return false ;

    IORTemplateList list = (IORTemplateList)other ;

    Iterator thisIterator = iterator() ;
    Iterator listIterator = list.iterator() ;
    while (thisIterator.hasNext() && listIterator.hasNext()) {
        IORTemplate thisTemplate = (IORTemplate)thisIterator.next() ;
        IORTemplate listTemplate = (IORTemplate)listIterator.next() ;
        if (!thisTemplate.isEquivalent( listTemplate ))
            return false ;
    }

    return thisIterator.hasNext() == listIterator.hasNext() ;
}
 
Example #13
Source File: POAImpl.java    From openjdk-jdk8u-backup 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 #14
Source File: IORTemplateListImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public boolean isEquivalent( IORFactory other )
{
    if (!(other instanceof IORTemplateList))
        return false ;

    IORTemplateList list = (IORTemplateList)other ;

    Iterator thisIterator = iterator() ;
    Iterator listIterator = list.iterator() ;
    while (thisIterator.hasNext() && listIterator.hasNext()) {
        IORTemplate thisTemplate = (IORTemplate)thisIterator.next() ;
        IORTemplate listTemplate = (IORTemplate)listIterator.next() ;
        if (!thisTemplate.isEquivalent( listTemplate ))
            return false ;
    }

    return thisIterator.hasNext() == listIterator.hasNext() ;
}
 
Example #15
Source File: IORTemplateListImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public boolean isEquivalent( IORFactory other )
{
    if (!(other instanceof IORTemplateList))
        return false ;

    IORTemplateList list = (IORTemplateList)other ;

    Iterator thisIterator = iterator() ;
    Iterator listIterator = list.iterator() ;
    while (thisIterator.hasNext() && listIterator.hasNext()) {
        IORTemplate thisTemplate = (IORTemplate)thisIterator.next() ;
        IORTemplate listTemplate = (IORTemplate)listIterator.next() ;
        if (!thisTemplate.isEquivalent( listTemplate ))
            return false ;
    }

    return thisIterator.hasNext() == listIterator.hasNext() ;
}
 
Example #16
Source File: POAImpl.java    From openjdk-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 #17
Source File: IORTemplateListImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean isEquivalent( IORFactory other )
{
    if (!(other instanceof IORTemplateList))
        return false ;

    IORTemplateList list = (IORTemplateList)other ;

    Iterator thisIterator = iterator() ;
    Iterator listIterator = list.iterator() ;
    while (thisIterator.hasNext() && listIterator.hasNext()) {
        IORTemplate thisTemplate = (IORTemplate)thisIterator.next() ;
        IORTemplate listTemplate = (IORTemplate)listIterator.next() ;
        if (!thisTemplate.isEquivalent( listTemplate ))
            return false ;
    }

    return thisIterator.hasNext() == listIterator.hasNext() ;
}
 
Example #18
Source File: IORImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Return the IORTemplateList for this IOR.  Will throw
 * exception if it is not possible to generate an IOR
 * from the IORTemplateList that is equal to this IOR,
 * which can only happen if not every TaggedProfile in the
 * IOR has the same ObjectId.
 */
public synchronized IORTemplateList getIORTemplates()
{
    if (iortemps == null)
        initializeIORTemplateList() ;

    return iortemps ;
}
 
Example #19
Source File: ObjectReferenceTemplateImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public IORTemplateList getIORTemplateList()
{
    IORTemplateList tl = IORFactories.makeIORTemplateList() ;
    tl.add( iorTemplate ) ;
    tl.makeImmutable() ;
    return tl ;
}
 
Example #20
Source File: IORTemplateListImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Object set( int index, Object element )
{
    if (element instanceof IORTemplate) {
        return super.set( index, element ) ;
    } else if (element instanceof IORTemplateList) {
        Object result = remove( index ) ;
        add( index, element ) ;
        return result ;
    } else
        throw new IllegalArgumentException() ;
}
 
Example #21
Source File: IORImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Return the IORTemplateList for this IOR.  Will throw
 * exception if it is not possible to generate an IOR
 * from the IORTemplateList that is equal to this IOR,
 * which can only happen if not every TaggedProfile in the
 * IOR has the same ObjectId.
 */
public synchronized IORTemplateList getIORTemplates()
{
    if (iortemps == null)
        initializeIORTemplateList() ;

    return iortemps ;
}
 
Example #22
Source File: IORImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Return the IORTemplateList for this IOR.  Will throw
 * exception if it is not possible to generate an IOR
 * from the IORTemplateList that is equal to this IOR,
 * which can only happen if not every TaggedProfile in the
 * IOR has the same ObjectId.
 */
public synchronized IORTemplateList getIORTemplates()
{
    if (iortemps == null)
        initializeIORTemplateList() ;

    return iortemps ;
}
 
Example #23
Source File: IORTemplateListImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void add( int index, Object element )
{
    if (element instanceof IORTemplate) {
        super.add( index, element ) ;
    } else if (element instanceof IORTemplateList) {
        IORTemplateList tl = (IORTemplateList)element ;
        addAll( index, tl ) ;
    } else
        throw new IllegalArgumentException() ;
}
 
Example #24
Source File: IORTemplateListImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void add( int index, Object element )
{
    if (element instanceof IORTemplate) {
        super.add( index, element ) ;
    } else if (element instanceof IORTemplateList) {
        IORTemplateList tl = (IORTemplateList)element ;
        addAll( index, tl ) ;
    } else
        throw new IllegalArgumentException() ;
}
 
Example #25
Source File: IORTemplateListImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Object set( int index, Object element )
{
    if (element instanceof IORTemplate) {
        return super.set( index, element ) ;
    } else if (element instanceof IORTemplateList) {
        Object result = remove( index ) ;
        add( index, element ) ;
        return result ;
    } else
        throw new IllegalArgumentException() ;
}
 
Example #26
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, 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 #27
Source File: IORImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/** Return the IORTemplateList for this IOR.  Will throw
 * exception if it is not possible to generate an IOR
 * from the IORTemplateList that is equal to this IOR,
 * which can only happen if not every TaggedProfile in the
 * IOR has the same ObjectId.
 */
public synchronized IORTemplateList getIORTemplates()
{
    if (iortemps == null)
        initializeIORTemplateList() ;

    return iortemps ;
}
 
Example #28
Source File: IORImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/** Return the IORTemplateList for this IOR.  Will throw
 * exception if it is not possible to generate an IOR
 * from the IORTemplateList that is equal to this IOR,
 * which can only happen if not every TaggedProfile in the
 * IOR has the same ObjectId.
 */
public synchronized IORTemplateList getIORTemplates()
{
    if (iortemps == null)
        initializeIORTemplateList() ;

    return iortemps ;
}
 
Example #29
Source File: IORImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** Return the IORTemplateList for this IOR.  Will throw
 * exception if it is not possible to generate an IOR
 * from the IORTemplateList that is equal to this IOR,
 * which can only happen if not every TaggedProfile in the
 * IOR has the same ObjectId.
 */
public synchronized IORTemplateList getIORTemplates()
{
    if (iortemps == null)
        initializeIORTemplateList() ;

    return iortemps ;
}
 
Example #30
Source File: IORTemplateListImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void add( int index, Object element )
{
    if (element instanceof IORTemplate) {
        super.add( index, element ) ;
    } else if (element instanceof IORTemplateList) {
        IORTemplateList tl = (IORTemplateList)element ;
        addAll( index, tl ) ;
    } else
        throw new IllegalArgumentException() ;
}