Constructors Summary |
---|
public IORImpl(com.sun.corba.se.spi.orb.ORB orb)Construct an empty IOR. This is needed for null object references.
this( orb, "" ) ;
|
public IORImpl(com.sun.corba.se.spi.orb.ORB orb, String typeid)
factory = orb ;
wrapper = IORSystemException.get( orb,
CORBALogDomains.OA_IOR ) ;
this.typeId = typeid ;
|
public IORImpl(com.sun.corba.se.spi.orb.ORB orb, String typeId, com.sun.corba.se.spi.ior.IORTemplate iortemp, com.sun.corba.se.spi.ior.ObjectId id)Construct an IOR from an IORTemplate by applying the same
object id to each TaggedProfileTemplate in the IORTemplate.
this( orb, typeId ) ;
this.iortemps = IORFactories.makeIORTemplateList() ;
this.iortemps.add( iortemp ) ;
addTaggedProfiles( iortemp, id ) ;
makeImmutable() ;
|
public IORImpl(com.sun.corba.se.spi.orb.ORB orb, String typeId, com.sun.corba.se.spi.ior.IORTemplateList iortemps, com.sun.corba.se.spi.ior.ObjectId id)Construct an IOR from an IORTemplate by applying the same
object id to each TaggedProfileTemplate in the IORTemplate.
this( orb, typeId ) ;
this.iortemps = iortemps ;
Iterator iter = iortemps.iterator() ;
while (iter.hasNext()) {
IORTemplate iortemp = (IORTemplate)(iter.next()) ;
addTaggedProfiles( iortemp, id ) ;
}
makeImmutable() ;
|
public IORImpl(org.omg.CORBA_2_3.portable.InputStream is)
this( (ORB)(is.orb()), is.read_string() ) ;
IdentifiableFactoryFinder finder =
factory.getTaggedProfileFactoryFinder() ;
EncapsulationUtility.readIdentifiableSequence( this, finder, is ) ;
makeImmutable() ;
|
Methods Summary |
---|
private void | addTaggedProfiles(com.sun.corba.se.spi.ior.IORTemplate iortemp, com.sun.corba.se.spi.ior.ObjectId id)
ObjectKeyTemplate oktemp = iortemp.getObjectKeyTemplate() ;
Iterator templateIterator = iortemp.iterator() ;
while (templateIterator.hasNext()) {
TaggedProfileTemplate ptemp =
(TaggedProfileTemplate)(templateIterator.next()) ;
TaggedProfile profile = ptemp.create( oktemp, id ) ;
add( profile ) ;
}
|
public boolean | equals(java.lang.Object obj)
if (obj == null)
return false ;
if (!(obj instanceof IOR))
return false ;
IOR other = (IOR)obj ;
return super.equals( obj ) && typeId.equals( other.getTypeId() ) ;
|
public org.omg.IOP.IOR | getIOPIOR()
EncapsOutputStream os = new EncapsOutputStream(factory);
write(os);
InputStream is = (InputStream) (os.create_input_stream());
return org.omg.IOP.IORHelper.read(is);
|
public synchronized com.sun.corba.se.spi.ior.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.
if (iortemps == null)
initializeIORTemplateList() ;
return iortemps ;
|
public com.sun.corba.se.spi.orb.ORB | getORB()
return factory ;
|
public com.sun.corba.se.spi.ior.iiop.IIOPProfile | getProfile()Return the first IIOPProfile in this IOR.
XXX THIS IS TEMPORARY FOR BACKWARDS COMPATIBILITY AND WILL BE REMOVED
SOON!
IIOPProfile iop = null ;
Iterator iter = iteratorById( TAG_INTERNET_IOP.value ) ;
if (iter.hasNext())
iop = (IIOPProfile)(iter.next()) ;
if (iop != null)
return iop ;
// if we come to this point then no IIOP Profile
// is present. Therefore, throw an exception.
throw wrapper.iorMustHaveIiopProfile() ;
|
public java.lang.String | getTypeId()
return typeId ;
|
public synchronized int | hashCode()
if (! isCachedHashValue) {
cachedHashValue = (super.hashCode() ^ typeId.hashCode());
isCachedHashValue = true;
}
return cachedHashValue;
|
private void | initializeIORTemplateList()
// Maps ObjectKeyTemplate to IORTemplate
Map oktempToIORTemplate = new HashMap() ;
iortemps = IORFactories.makeIORTemplateList() ;
Iterator iter = iterator() ;
ObjectId oid = null ; // used to check that all profiles have the same oid.
while (iter.hasNext()) {
TaggedProfile prof = (TaggedProfile)(iter.next()) ;
TaggedProfileTemplate ptemp = prof.getTaggedProfileTemplate() ;
ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;
// Check that all oids for all profiles are the same: if they are not,
// throw exception.
if (oid == null)
oid = prof.getObjectId() ;
else if (!oid.equals( prof.getObjectId() ))
throw wrapper.badOidInIorTemplateList() ;
// Find or create the IORTemplate for oktemp.
IORTemplate iortemp = (IORTemplate)(oktempToIORTemplate.get( oktemp )) ;
if (iortemp == null) {
iortemp = IORFactories.makeIORTemplate( oktemp ) ;
oktempToIORTemplate.put( oktemp, iortemp ) ;
iortemps.add( iortemp ) ;
}
iortemp.add( ptemp ) ;
}
iortemps.makeImmutable() ;
|
public boolean | isEquivalent(com.sun.corba.se.spi.ior.IOR ior)
Iterator myIterator = iterator() ;
Iterator otherIterator = ior.iterator() ;
while (myIterator.hasNext() && otherIterator.hasNext()) {
TaggedProfile myProfile = (TaggedProfile)(myIterator.next()) ;
TaggedProfile otherProfile = (TaggedProfile)(otherIterator.next()) ;
if (!myProfile.isEquivalent( otherProfile ))
return false ;
}
return myIterator.hasNext() == otherIterator.hasNext() ;
|
public boolean | isNil()
//
// The check for typeId length of 0 below is commented out
// as a workaround for a bug in ORBs which send a
// null objref with a non-empty typeId string.
//
return ((size() == 0) /* && (typeId.length() == 0) */);
|
public synchronized void | makeImmutable()
makeElementsImmutable() ;
if (iortemps != null)
iortemps.makeImmutable() ;
super.makeImmutable() ;
|
public java.lang.String | stringify()
StringWriter bs;
MarshalOutputStream s = new EncapsOutputStream(factory);
s.putEndian();
write( (OutputStream)s );
bs = new StringWriter();
try {
s.writeTo(new HexOutputStream(bs));
} catch (IOException ex) {
throw wrapper.stringifyWriteError( ex ) ;
}
return ORBConstants.STRINGIFY_PREFIX + bs;
|
public void | write(org.omg.CORBA_2_3.portable.OutputStream os)
os.write_string( typeId ) ;
EncapsulationUtility.writeIdentifiableSequence( this, os ) ;
|