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

ObjectReferenceTemplateImpl

public class ObjectReferenceTemplateImpl extends ObjectReferenceProducerBase implements org.omg.CORBA.portable.StreamableValue, org.omg.PortableInterceptor.ObjectReferenceTemplate
This is an implementation of the ObjectReferenceTemplate abstract value type defined by the portable interceptors IDL. Note that this is a direct Java implementation of the abstract value type: there is no stateful value type defined in IDL, since defining the state in IDL is awkward and inefficient. The best way to define the state is to use internal data structures that can be written to and read from CORBA streams.

Fields Summary
private transient com.sun.corba.se.spi.ior.IORTemplate
iorTemplate
public static final String
repositoryId
Constructors Summary
public ObjectReferenceTemplateImpl(org.omg.CORBA.portable.InputStream is)

	super( (ORB)(is.orb()) ) ;
	_read( is ) ;
    
public ObjectReferenceTemplateImpl(com.sun.corba.se.spi.orb.ORB orb, com.sun.corba.se.spi.ior.IORTemplate iortemp)

	super( orb ) ;
	iorTemplate = iortemp ;
    
Methods Summary
public void_read(org.omg.CORBA.portable.InputStream is)
Read the data into a (presumably) empty ORTImpl. This sets the orb to the ORB of the InputStream.

	org.omg.CORBA_2_3.portable.InputStream istr =
	    (org.omg.CORBA_2_3.portable.InputStream)is ;
	iorTemplate = IORFactories.makeIORTemplate( istr ) ;
	orb = (ORB)(istr.orb()) ;
    
public java.lang.String[]_truncatable_ids()


       
    
	return new String[] { repositoryId } ;
    
public org.omg.CORBA.TypeCode_type()

	return ObjectReferenceTemplateHelper.type() ;
    
public void_write(org.omg.CORBA.portable.OutputStream os)
Write the state to the OutputStream.

	org.omg.CORBA_2_3.portable.OutputStream ostr = 
	    (org.omg.CORBA_2_3.portable.OutputStream)os ;

	iorTemplate.write( ostr ) ;
    
public java.lang.String[]adapter_name()

	ObjectAdapterId poaid = 
	    iorTemplate.getObjectKeyTemplate().getObjectAdapterId() ;

	return poaid.getAdapterName() ;
    
public booleanequals(java.lang.Object obj)

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

	ObjectReferenceTemplateImpl other = (ObjectReferenceTemplateImpl)obj ;

	return (iorTemplate != null) && 
	    iorTemplate.equals( other.iorTemplate ) ;
    
public com.sun.corba.se.spi.ior.IORFactorygetIORFactory()

	return iorTemplate ;
    
public com.sun.corba.se.spi.ior.IORTemplateListgetIORTemplateList()

	IORTemplateList tl = IORFactories.makeIORTemplateList() ;
	tl.add( iorTemplate ) ;
	tl.makeImmutable() ;
	return tl ;
    
public inthashCode()

	return iorTemplate.hashCode() ;
    
public java.lang.Stringorb_id()

	return iorTemplate.getObjectKeyTemplate().getORBId() ;
    
public java.lang.Stringserver_id()

	int val = iorTemplate.getObjectKeyTemplate().getServerId() ;
	return Integer.toString( val ) ;