Class IORImpl

All Implemented Interfaces:
IOR, MakeImmutable, Writeable, Iterable<TaggedProfile>, Collection<TaggedProfile>, List<TaggedProfile>

public class IORImpl extends IdentifiableContainerBase<TaggedProfile> implements IOR
An IOR is represented as a list of profiles. Only objects that extend TaggedProfile should be added to an IOR. However, enforcing this restriction requires overriding all of the addYYY methods inherited from List, so no check is included here.
  • Field Details

    • typeId

      private String typeId
    • factory

      private ORB factory
    • wrapper

      static final IORSystemException wrapper
    • isCachedHashValue

      private boolean isCachedHashValue
    • cachedHashValue

      private int cachedHashValue
    • iortemps

      private IORTemplateList iortemps
      This variable is set directly from the constructors that take an IORTemplate or IORTemplateList as arguments; otherwise it is derived from the list of TaggedProfile instances on the first call to getIORTemplates. Note that we assume that an IOR with mutiple TaggedProfile instances has the same ObjectId in each TaggedProfile, as otherwise the IOR could never be created through an ObjectReferenceFactory.
  • Constructor Details

    • IORImpl

      public IORImpl(ORB orb)
      Construct an empty IOR. This is needed for null object references.
      Parameters:
      orb - ORB to use as factory
    • IORImpl

      public IORImpl(ORB orb, String typeid)
    • IORImpl

      public IORImpl(ORB orb, String typeId, IORTemplate iortemp, ObjectId id)
      Construct an IOR from an IORTemplate by applying the same object id to each TaggedProfileTemplate in the IORTemplate.
      Parameters:
      orb - ORB to use
      typeId - ID of type to use
      iortemp - Template to use
      id - ID of created object
    • IORImpl

      public IORImpl(ORB orb, String typeId, IORTemplateList iortemps, ObjectId id)
      Construct an IOR from an IORTemplate by applying the same object id to each TaggedProfileTemplate in the IORTemplate.
      Parameters:
      orb - ORB to use
      typeId - ID of type to use
      iortemps - list of templates
      id - ID of created object
    • IORImpl

      public IORImpl(ORB orb, InputStream is)
  • Method Details

    • getTaggedProfiles

      public Iterator<TaggedProfile> getTaggedProfiles()
      Specified by:
      getTaggedProfiles in interface IOR
    • getORB

      public ORB getORB()
      Specified by:
      getORB in interface IOR
    • equals

      public boolean equals(Object obj)
      Description copied from interface: IOR
      Return true if this IOR is equivalent to ior. Here equivalent means that the typeids and delegates are the same. It does not check if the profiles are the same or of the same number.
      Specified by:
      equals in interface Collection<TaggedProfile>
      Specified by:
      equals in interface IOR
      Specified by:
      equals in interface List<TaggedProfile>
      Overrides:
      equals in class FreezableList<TaggedProfile>
      Parameters:
      obj - object to compare to
      Returns:
      true if they are equivalent
      See Also:
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Collection<TaggedProfile>
      Specified by:
      hashCode in interface List<TaggedProfile>
      Overrides:
      hashCode in class FreezableList<TaggedProfile>
    • toString

      public String toString()
      Overrides:
      toString in class AbstractCollection<TaggedProfile>
    • addTaggedProfiles

      private void addTaggedProfiles(IORTemplate iortemp, ObjectId id)
    • getTypeId

      public String getTypeId()
      Description copied from interface: IOR
      Return the type id string from the IOR.
      Specified by:
      getTypeId in interface IOR
      Returns:
      type id string
    • write

      public void write(OutputStream os)
      Description copied from interface: Writeable
      Write this object directly to the output stream.
      Specified by:
      write in interface Writeable
      Parameters:
      os - stream to write to
    • stringify

      public String stringify()
      Description copied from interface: IOR
      Return a representation of this IOR in the standard GIOP stringified format that begins with "IOR:". This does not return the same as Object.toString()
      Specified by:
      stringify in interface IOR
      Returns:
      String representation
      See Also:
    • makeImmutable

      public void makeImmutable()
      Specified by:
      makeImmutable in interface MakeImmutable
      Overrides:
      makeImmutable in class FreezableList<TaggedProfile>
    • getIOPIOR

      public IOR getIOPIOR()
      Description copied from interface: IOR
      Return a representation of this IOR in the standard GIOP marshalled form.
      Specified by:
      getIOPIOR in interface IOR
      Returns:
      a representation of this IOR
    • isNil

      public boolean isNil()
      Description copied from interface: IOR
      Return true if this IOR has no profiles.
      Specified by:
      isNil in interface IOR
      Returns:
      true if there aren't any profiles, false otherwise
    • isEquivalent

      public boolean isEquivalent(IOR ior)
      Description copied from interface: IOR
      Return true if this IOR is equivalent to ior. Here equivalent means that the typeids are the same, they have the same number of profiles, and each profile is equivalent to the corresponding profile.
      Specified by:
      isEquivalent in interface IOR
      Parameters:
      ior - IOR to compare to
      Returns:
      true if they are equivalent
      See Also:
    • initializeIORTemplateList

      private void initializeIORTemplateList()
    • getIORTemplates

      public IORTemplateList getIORTemplates()
      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.
      Specified by:
      getIORTemplates in interface IOR
      Returns:
      the IORTemplate for this IOR
    • getProfile

      public IIOPProfile getProfile()
      Return the first IIOPProfile in this IOR. Originally we planned to remove this, because we planned to use multiple IIOP profiles. However, we really have no need for multiple profiles in the ORB, so we will probably never remove this API.
      Specified by:
      getProfile in interface IOR
      Returns:
      the first IIOPProfile