Methods Summary |
---|
public boolean | equals(java.lang.Object obj)
if (!(obj instanceof IIOPProfileImpl))
return false ;
IIOPProfileImpl other = (IIOPProfileImpl)obj ;
return oid.equals( other.oid ) && proftemp.equals( other.proftemp ) &&
oktemp.equals( other.oktemp ) ;
|
public synchronized java.lang.String | getCodebase()
if (!cachedCodebase) {
cachedCodebase = true ;
codebase = uncachedGetCodeBase() ;
}
return codebase ;
|
public synchronized com.sun.corba.se.spi.ior.iiop.GIOPVersion | getGIOPVersion()Return GIOPVersion for this IOR.
Requests created against this IOR will be of the
return Version.
return proftemp.getGIOPVersion() ;
|
public org.omg.IOP.TaggedProfile | getIOPProfile()
EncapsOutputStream os = new EncapsOutputStream( orb ) ;
os.write_long( getId() ) ;
write( os ) ;
InputStream is = (InputStream)(os.create_input_stream()) ;
return org.omg.IOP.TaggedProfileHelper.read( is ) ;
|
public int | getId()
return proftemp.getId() ;
|
public com.sun.corba.se.spi.orb.ORBVersion | getORBVersion()
return oktemp.getORBVersion();
|
public com.sun.corba.se.spi.ior.ObjectId | getObjectId()
return oid ;
|
public com.sun.corba.se.spi.ior.ObjectKey | getObjectKey()
ObjectKey result = IORFactories.makeObjectKey( oktemp, oid ) ;
return result ;
|
public com.sun.corba.se.spi.ior.ObjectKeyTemplate | getObjectKeyTemplate()
return oktemp ;
|
public java.lang.Object | getServant()Return the servant for this IOR, if it is local AND if the OA that
implements this objref supports direct access to servants outside of an
invocation.
XXX revisit: do we want this at all? If we do, it might move to the
ObjectKeyTemplate instead.
if (!isLocal())
return null ;
RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
ObjectAdapterFactory oaf = scr.getObjectAdapterFactory(
oktemp.getSubcontractId() ) ;
ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
ObjectAdapter oa = null ;
try {
oa = oaf.find( oaid ) ;
} catch (SystemException exc) {
// Could not find the OA, so just return null.
// This usually happens when POAs are being deleted,
// and the POA always return null for getLocalServant anyway.
wrapper.getLocalServantFailure( exc, oaid.toString() ) ;
return null ;
}
byte[] boid = oid.getId() ;
java.lang.Object servant = oa.getLocalServant( boid ) ;
return servant ;
|
public com.sun.corba.se.spi.ior.TaggedProfileTemplate | getTaggedProfileTemplate()
return proftemp ;
|
public int | hashCode()
return oid.hashCode() ^ proftemp.hashCode() ^ oktemp.hashCode() ;
|
private void | init(org.omg.CORBA_2_3.portable.InputStream istr)
// First, read all of the IIOP IOR data
GIOPVersion version = new GIOPVersion() ;
version.read( istr ) ;
IIOPAddress primary = new IIOPAddressImpl( istr ) ;
byte[] key = EncapsulationUtility.readOctets( istr ) ;
ObjectKey okey = orb.getObjectKeyFactory().create( key ) ;
oktemp = okey.getTemplate() ;
oid = okey.getId() ;
proftemp = IIOPFactories.makeIIOPProfileTemplate( orb,
version, primary ) ;
// Handle any tagged components (if applicable)
if (version.getMinor() > 0)
EncapsulationUtility.readIdentifiableSequence( proftemp,
orb.getTaggedComponentFactoryFinder(), istr ) ;
// If there is no codebase in this IOR and there IS a
// java.rmi.server.codebase property set, we need to
// update the IOR with the local codebase. Note that
// there is only one instance of the local codebase, but it
// can be safely shared in multiple IORs since it is immutable.
if (uncachedGetCodeBase() == null) {
JavaCodebaseComponent jcc = LocalCodeBaseSingletonHolder.comp ;
if (jcc != null) {
if (version.getMinor() > 0)
proftemp.add( jcc ) ;
codebase = jcc.getURLs() ;
}
// Whether codebase is null or not, we have it,
// and so getCodebase ned never call uncachedGetCodebase.
cachedCodebase = true;
}
|
public boolean | isEquivalent(com.sun.corba.se.spi.ior.TaggedProfile prof)
if (!(prof instanceof IIOPProfile))
return false ;
IIOPProfile other = (IIOPProfile)prof ;
return oid.equals( other.getObjectId() ) &&
proftemp.isEquivalent( other.getTaggedProfileTemplate() ) &&
oktemp.equals( other.getObjectKeyTemplate() ) ;
|
public synchronized boolean | isLocal()
if (!checkedIsLocal) {
checkedIsLocal = true ;
String host = proftemp.getPrimaryAddress().getHost() ;
cachedIsLocal = orb.isLocalHost(host) &&
orb.isLocalServerId(oktemp.getSubcontractId(),
oktemp.getServerId()) &&
orb.getLegacyServerSocketManager()
.legacyIsLocalServerPort(
proftemp.getPrimaryAddress().getPort());
}
return cachedIsLocal ;
|
public void | makeImmutable()
proftemp.makeImmutable() ;
|
private java.lang.String | uncachedGetCodeBase()
Iterator iter = proftemp.iteratorById( TAG_JAVA_CODEBASE.value ) ;
if (iter.hasNext()) {
JavaCodebaseComponent jcbc = (JavaCodebaseComponent)(iter.next()) ;
return jcbc.getURLs() ;
}
return null ;
|
public void | writeContents(org.omg.CORBA_2_3.portable.OutputStream os)
proftemp.write( oktemp, oid, os ) ;
|