Package com.sun.corba.ee.impl.ior
Class IORImpl
- All Implemented Interfaces:
IOR
,MakeImmutable
,Writeable
,Iterable<TaggedProfile>
,Collection<TaggedProfile>
,List<TaggedProfile>
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
FieldsModifier and TypeFieldDescriptionprivate int
private ORB
private IORTemplateList
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
private String
(package private) static final IORSystemException
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an empty IOR.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.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.IORImpl
(ORB orb, InputStream is) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addTaggedProfiles
(IORTemplate iortemp, ObjectId id) boolean
Return true if this IOR is equivalent to ior.Return a representation of this IOR in the standard GIOP marshalled form.Return the IORTemplateList for this IOR.getORB()
Return the first IIOPProfile in this IOR.Return the type id string from the IOR.int
hashCode()
private void
boolean
isEquivalent
(IOR ior) Return true if this IOR is equivalent to ior.boolean
isNil()
Return true if this IOR has no profiles.void
Return a representation of this IOR in the standard GIOP stringified format that begins with "IOR:".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 java.util.Collection
parallelStream, removeIf, stream
Methods inherited from interface com.sun.corba.ee.spi.ior.IOR
iteratorById
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
Field Details
-
typeId
-
factory
-
wrapper
-
isCachedHashValue
private boolean isCachedHashValue -
cachedHashValue
private int cachedHashValue -
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
Construct an empty IOR. This is needed for null object references.- Parameters:
orb
- ORB to use as factory
-
IORImpl
-
IORImpl
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
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
-
-
Method Details
-
getTaggedProfiles
- Specified by:
getTaggedProfiles
in interfaceIOR
-
getORB
-
equals
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 interfaceCollection<TaggedProfile>
- Specified by:
equals
in interfaceIOR
- Specified by:
equals
in interfaceList<TaggedProfile>
- Overrides:
equals
in classFreezableList<TaggedProfile>
- Parameters:
obj
- object to compare to- Returns:
- true if they are equivalent
- See Also:
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<TaggedProfile>
- Specified by:
hashCode
in interfaceList<TaggedProfile>
- Overrides:
hashCode
in classFreezableList<TaggedProfile>
-
toString
- Overrides:
toString
in classAbstractCollection<TaggedProfile>
-
addTaggedProfiles
-
getTypeId
Description copied from interface:IOR
Return the type id string from the IOR. -
write
Description copied from interface:Writeable
Write this object directly to the output stream. -
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
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
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:
-
initializeIORTemplateList
private void initializeIORTemplateList() -
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
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
-