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

ObjectKeyTemplateBase

public abstract class ObjectKeyTemplateBase extends Object implements com.sun.corba.se.spi.ior.ObjectKeyTemplate
author

Fields Summary
public static final String
JIDL_ORB_ID
private static final String[]
JIDL_OAID_STRINGS
public static final com.sun.corba.se.spi.ior.ObjectAdapterId
JIDL_OAID
private com.sun.corba.se.spi.orb.ORB
orb
protected com.sun.corba.se.impl.logging.IORSystemException
wrapper
private com.sun.corba.se.spi.orb.ORBVersion
version
private int
magic
private int
scid
private int
serverid
private String
orbid
private com.sun.corba.se.spi.ior.ObjectAdapterId
oaid
private byte[]
adapterId
Constructors Summary
public ObjectKeyTemplateBase(com.sun.corba.se.spi.orb.ORB orb, int magic, int scid, int serverid, String orbid, com.sun.corba.se.spi.ior.ObjectAdapterId oaid)

	this.orb = orb ;
	this.wrapper = IORSystemException.get( orb, 
	    CORBALogDomains.OA_IOR ) ;
	this.magic = magic ;
	this.scid = scid ;
	this.serverid = serverid ;
	this.orbid = orbid ;
	this.oaid = oaid ;

	adapterId = computeAdapterId() ;
    
Methods Summary
private byte[]computeAdapterId()

	// write out serverid, orbid, oaid
	ByteBuffer buff = new ByteBuffer() ;

	buff.append( getServerId() ) ;
	buff.append( orbid ) ;

	buff.append( oaid.getNumLevels() ) ;
	Iterator iter = oaid.iterator() ;
	while (iter.hasNext()) {
	    String comp = (String)(iter.next()) ;
	    buff.append( comp ) ;
	}

	buff.trimToSize() ;

	return buff.toArray() ;
    
public booleanequals(java.lang.Object obj)

	if (!(obj instanceof ObjectKeyTemplateBase))
	    return false ;

	ObjectKeyTemplateBase other = (ObjectKeyTemplateBase)obj ;

	return (magic == other.magic) && (scid == other.scid) && 
	    (serverid == other.serverid) && (version.equals( other.version ) &&
	    orbid.equals( other.orbid ) && oaid.equals( other.oaid )) ;
    
public byte[]getAdapterId()


      
    
	return (byte[])(adapterId.clone()) ;
    
protected intgetMagic()

	return magic ;
    
public java.lang.StringgetORBId()

	return orbid ;
    
public com.sun.corba.se.spi.orb.ORBVersiongetORBVersion()

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

	return oaid ;
    
public intgetServerId()

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

	return orb.getRequestDispatcherRegistry().getServerRequestDispatcher( scid ) ;
    
public intgetSubcontractId()

	return scid ;
    
public inthashCode()

	int result = 17 ;
	result = 37*result + magic ;
	result = 37*result + scid ;
	result = 37*result + serverid ;
	result = 37*result + version.hashCode() ;
	result = 37*result + orbid.hashCode() ;
	result = 37*result + oaid.hashCode() ;
	return result ;
    
protected byte[]readObjectKey(org.omg.CORBA_2_3.portable.InputStream is)

	int len = is.read_long() ;
	byte[] result = new byte[len] ;
	is.read_octet_array( result, 0, len ) ;
	return result ;
    
public voidsetORBVersion(com.sun.corba.se.spi.orb.ORBVersion version)

	this.version = version ;
    
public voidwrite(com.sun.corba.se.spi.ior.ObjectId objectId, org.omg.CORBA_2_3.portable.OutputStream os)

	writeTemplate( os ) ;
	objectId.write( os ) ;
    
public voidwrite(org.omg.CORBA_2_3.portable.OutputStream os)

	writeTemplate( os ) ;
    
protected abstract voidwriteTemplate(org.omg.CORBA_2_3.portable.OutputStream os)