Package com.sun.corba.ee.impl.ior
Class IORImpl
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- com.sun.corba.ee.impl.ior.FreezableList<E>
-
- com.sun.corba.ee.spi.ior.IdentifiableContainerBase<TaggedProfile>
-
- com.sun.corba.ee.impl.ior.IORImpl
-
- All Implemented Interfaces:
IOR
,MakeImmutable
,Writeable
,java.lang.Iterable<TaggedProfile>
,java.util.Collection<TaggedProfile>
,java.util.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 Summary
Fields Modifier and Type Field Description private int
cachedHashValue
private ORB
factory
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.private boolean
isCachedHashValue
private java.lang.String
typeId
(package private) static IORSystemException
wrapper
-
Constructor Summary
Constructors Constructor Description IORImpl(ORB orb)
Construct an empty IOR.IORImpl(ORB orb, java.lang.String typeid)
IORImpl(ORB orb, java.lang.String typeId, IORTemplateList iortemps, ObjectId id)
Construct an IOR from an IORTemplate by applying the same object id to each TaggedProfileTemplate in the IORTemplate.IORImpl(ORB orb, java.lang.String typeId, IORTemplate iortemp, ObjectId id)
Construct an IOR from an IORTemplate by applying the same object id to each TaggedProfileTemplate in the IORTemplate.IORImpl(ORB orb, InputStream is)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addTaggedProfiles(IORTemplate iortemp, ObjectId id)
boolean
equals(java.lang.Object obj)
Return true if this IOR is equivalent to ior.IOR
getIOPIOR()
Return a representation of this IOR in the standard GIOP marshalled form.IORTemplateList
getIORTemplates()
Return the IORTemplateList for this IOR.ORB
getORB()
IIOPProfile
getProfile()
Return the first IIOPProfile in this IOR.java.util.Iterator<TaggedProfile>
getTaggedProfiles()
java.lang.String
getTypeId()
Return the type id string from the IOR.int
hashCode()
private void
initializeIORTemplateList()
boolean
isEquivalent(IOR ior)
Return true if this IOR is equivalent to ior.boolean
isNil()
Return true if this IOR has no profiles.void
makeImmutable()
java.lang.String
stringify()
Return a representation of this IOR in the standard GIOP stringified format that begins with "IOR:".java.lang.String
toString()
void
write(OutputStream os)
Write this object directly to the output stream.-
Methods inherited from class com.sun.corba.ee.spi.ior.IdentifiableContainerBase
iteratorById
-
Methods inherited from class com.sun.corba.ee.impl.ior.FreezableList
add, get, isImmutable, makeElementsImmutable, remove, set, size, subList
-
Methods inherited from class java.util.AbstractList
add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.sun.corba.ee.spi.ior.IOR
iteratorById
-
-
-
-
Field Detail
-
typeId
private java.lang.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 Detail
-
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, java.lang.String typeid)
-
IORImpl
public IORImpl(ORB orb, java.lang.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 usetypeId
- ID of type to useiortemp
- Template to useid
- ID of created object
-
IORImpl
public IORImpl(ORB orb, java.lang.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 usetypeId
- ID of type to useiortemps
- list of templatesid
- ID of created object
-
IORImpl
public IORImpl(ORB orb, InputStream is)
-
-
Method Detail
-
getTaggedProfiles
public java.util.Iterator<TaggedProfile> getTaggedProfiles()
- Specified by:
getTaggedProfiles
in interfaceIOR
-
equals
public boolean equals(java.lang.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 interfacejava.util.Collection<TaggedProfile>
- Specified by:
equals
in interfaceIOR
- Specified by:
equals
in interfacejava.util.List<TaggedProfile>
- Overrides:
equals
in classFreezableList<TaggedProfile>
- Parameters:
obj
- object to compare to- Returns:
- true if they are equivalent
- See Also:
IOR.isEquivalent(IOR)
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<TaggedProfile>
- Specified by:
hashCode
in interfacejava.util.List<TaggedProfile>
- Overrides:
hashCode
in classFreezableList<TaggedProfile>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.util.AbstractCollection<TaggedProfile>
-
addTaggedProfiles
private void addTaggedProfiles(IORTemplate iortemp, ObjectId id)
-
getTypeId
public java.lang.String getTypeId()
Description copied from interface:IOR
Return the type id string from the IOR.
-
write
public void write(OutputStream os)
Description copied from interface:Writeable
Write this object directly to the output stream.
-
stringify
public java.lang.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 asObject.toString()
-
makeImmutable
public void makeImmutable()
- Specified by:
makeImmutable
in interfaceMakeImmutable
- Overrides:
makeImmutable
in classFreezableList<TaggedProfile>
-
getIOPIOR
public IOR getIOPIOR()
Description copied from interface:IOR
Return a representation of this IOR in the standard GIOP marshalled form.
-
isNil
public boolean isNil()
Description copied from interface:IOR
Return true if this IOR has no profiles.
-
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 interfaceIOR
- Parameters:
ior
- IOR to compare to- Returns:
- true if they are equivalent
- See Also:
IOR.equals(java.lang.Object)
-
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 interfaceIOR
- 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 interfaceIOR
- Returns:
- the first IIOPProfile
-
-