FileDocCategorySizeDatePackage
WireObjectKeyTemplate.javaAPI DocJava SE 5 API3309Fri Aug 26 14:54:24 BST 2005com.sun.corba.se.impl.ior

WireObjectKeyTemplate

public class WireObjectKeyTemplate extends Object implements com.sun.corba.se.spi.ior.ObjectKeyTemplate
author
Ken Cavanaugh

Fields Summary
private com.sun.corba.se.spi.orb.ORB
orb
private com.sun.corba.se.impl.logging.IORSystemException
wrapper
Constructors Summary
public WireObjectKeyTemplate(com.sun.corba.se.spi.orb.ORB orb)

	initORB( orb ) ;
    
public WireObjectKeyTemplate(org.omg.CORBA_2_3.portable.InputStream is, org.omg.CORBA.OctetSeqHolder osh)

	osh.value = getId( is ) ;
	initORB( (ORB)(is.orb())) ;
    
Methods Summary
public booleanequals(java.lang.Object obj)

	if (obj == null)
	    return false ;

	return obj instanceof WireObjectKeyTemplate ;
    
public byte[]getAdapterId()
Adapter ID is not available, since our ORB did not implement the object carrying this key.

	throw wrapper.adapterIdNotAvailable() ;
    
private byte[]getId(org.omg.CORBA_2_3.portable.InputStream is)

	CDRInputStream cis = (CDRInputStream)is ;
	int len = cis.getBufferLength() ;
	byte[] result = new byte[ len ] ;
	cis.read_octet_array( result, 0, len ) ;
	return result ;
    
public java.lang.StringgetORBId()

	throw wrapper.orbIdNotAvailable() ;
    
public com.sun.corba.se.spi.orb.ORBVersiongetORBVersion()

	return ORBVersionFactory.getFOREIGN() ;
    
public com.sun.corba.se.spi.ior.ObjectAdapterIdgetObjectAdapterId()

	throw wrapper.objectAdapterIdNotAvailable() ;
    
public intgetServerId()
While it might make sense to throw an exception here, this causes problems since we need to check whether unusual object references are local or not. It seems that the easiest way to handle this is to return an invalid server id.

	return -1 ;
    
public com.sun.corba.se.spi.protocol.CorbaServerRequestDispatchergetServerRequestDispatcher(com.sun.corba.se.spi.orb.ORB orb, com.sun.corba.se.spi.ior.ObjectId id)

	byte[] bid = id.getId() ;
	String str = new String( bid ) ;
	return orb.getRequestDispatcherRegistry().getServerRequestDispatcher( str ) ;
    
public intgetSubcontractId()

	return ORBConstants.DEFAULT_SCID ;
    
public inthashCode()

	return 53 ; // All WireObjectKeyTemplates are the same, so they should 
		    // have the same hashCode.
    
private voidinitORB(com.sun.corba.se.spi.orb.ORB orb)

	this.orb = orb ;
	wrapper = IORSystemException.get( orb,
	    CORBALogDomains.OA_IOR ) ;
    
public voidwrite(com.sun.corba.se.spi.ior.ObjectId id, org.omg.CORBA_2_3.portable.OutputStream os)

	byte[] key = id.getId() ;
	os.write_octet_array( key, 0, key.length ) ;
    
public voidwrite(org.omg.CORBA_2_3.portable.OutputStream os)

	// Does nothing