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 intcachedHashValueprivate ORBfactoryprivate IORTemplateListiortempsThis 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 booleanisCachedHashValueprivate java.lang.StringtypeId(package private) static IORSystemExceptionwrapper
-
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 voidaddTaggedProfiles(IORTemplate iortemp, ObjectId id)booleanequals(java.lang.Object obj)Return true if this IOR is equivalent to ior.IORgetIOPIOR()Return a representation of this IOR in the standard GIOP marshalled form.IORTemplateListgetIORTemplates()Return the IORTemplateList for this IOR.ORBgetORB()IIOPProfilegetProfile()Return the first IIOPProfile in this IOR.java.util.Iterator<TaggedProfile>getTaggedProfiles()java.lang.StringgetTypeId()Return the type id string from the IOR.inthashCode()private voidinitializeIORTemplateList()booleanisEquivalent(IOR ior)Return true if this IOR is equivalent to ior.booleanisNil()Return true if this IOR has no profiles.voidmakeImmutable()java.lang.Stringstringify()Return a representation of this IOR in the standard GIOP stringified format that begins with "IOR:".java.lang.StringtoString()voidwrite(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:
getTaggedProfilesin interfaceIOR
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:IORReturn 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:
equalsin interfacejava.util.Collection<TaggedProfile>- Specified by:
equalsin interfaceIOR- Specified by:
equalsin interfacejava.util.List<TaggedProfile>- Overrides:
equalsin 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:
hashCodein interfacejava.util.Collection<TaggedProfile>- Specified by:
hashCodein interfacejava.util.List<TaggedProfile>- Overrides:
hashCodein classFreezableList<TaggedProfile>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.util.AbstractCollection<TaggedProfile>
-
addTaggedProfiles
private void addTaggedProfiles(IORTemplate iortemp, ObjectId id)
-
getTypeId
public java.lang.String getTypeId()
Description copied from interface:IORReturn the type id string from the IOR.
-
write
public void write(OutputStream os)
Description copied from interface:WriteableWrite this object directly to the output stream.
-
stringify
public java.lang.String stringify()
Description copied from interface:IORReturn 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:
makeImmutablein interfaceMakeImmutable- Overrides:
makeImmutablein classFreezableList<TaggedProfile>
-
getIOPIOR
public IOR getIOPIOR()
Description copied from interface:IORReturn a representation of this IOR in the standard GIOP marshalled form.
-
isNil
public boolean isNil()
Description copied from interface:IORReturn true if this IOR has no profiles.
-
isEquivalent
public boolean isEquivalent(IOR ior)
Description copied from interface:IORReturn 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:
isEquivalentin 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:
getIORTemplatesin 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:
getProfilein interfaceIOR- Returns:
- the first IIOPProfile
-
-