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

IIOPProfileTemplateImpl

public class IIOPProfileTemplateImpl extends com.sun.corba.se.spi.ior.TaggedProfileTemplateBase implements com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate
author
If getMinorVersion==0, this does not contain any tagged components

Fields Summary
private com.sun.corba.se.spi.orb.ORB
orb
private com.sun.corba.se.spi.ior.iiop.GIOPVersion
giopVersion
private com.sun.corba.se.spi.ior.iiop.IIOPAddress
primary
Constructors Summary
public IIOPProfileTemplateImpl(com.sun.corba.se.spi.orb.ORB orb, com.sun.corba.se.spi.ior.iiop.GIOPVersion version, com.sun.corba.se.spi.ior.iiop.IIOPAddress primary)

	this.orb = orb ;
	this.giopVersion = version ;
	this.primary = primary ;
	if (giopVersion.getMinor() == 0)
	    // Adding tagged components is not allowed for IIOP 1.0,
	    // so this template is complete and should be made immutable.
	    makeImmutable() ;
    
public IIOPProfileTemplateImpl(org.omg.CORBA_2_3.portable.InputStream istr)

	byte major = istr.read_octet() ;
	byte minor = istr.read_octet() ;
	giopVersion = GIOPVersion.getInstance( major, minor ) ;
	primary = new IIOPAddressImpl( istr ) ;
	orb = (ORB)(istr.orb()) ;
	// Handle any tagged components (if applicable)
	if (minor > 0) 
	    EncapsulationUtility.readIdentifiableSequence( 	
		this, orb.getTaggedComponentFactoryFinder(), istr ) ;

	makeImmutable() ;
    
Methods Summary
public com.sun.corba.se.spi.ior.TaggedProfilecreate(com.sun.corba.se.spi.ior.ObjectKeyTemplate oktemp, com.sun.corba.se.spi.ior.ObjectId id)

	return IIOPFactories.makeIIOPProfile( orb, oktemp, id, this ) ;
    
public booleanequals(java.lang.Object obj)

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

	IIOPProfileTemplateImpl other = (IIOPProfileTemplateImpl)obj ;

	return super.equals( obj ) && giopVersion.equals( other.giopVersion ) &&
	    primary.equals( other.primary ) ;
    
public com.sun.corba.se.spi.ior.iiop.GIOPVersiongetGIOPVersion()

	return giopVersion ;
    
public intgetId()

	return TAG_INTERNET_IOP.value ;
    
public com.sun.corba.se.spi.ior.iiop.IIOPAddressgetPrimaryAddress()

	return primary ;
    
public inthashCode()

	return super.hashCode() ^ giopVersion.hashCode() ^ primary.hashCode() ;
    
public booleanisEquivalent(com.sun.corba.se.spi.ior.TaggedProfileTemplate temp)

	if (!(temp instanceof IIOPProfileTemplateImpl))
	    return false ;

	IIOPProfileTemplateImpl tempimp = (IIOPProfileTemplateImpl)temp ;

	return primary.equals( tempimp.primary )  ;
    
public voidwrite(com.sun.corba.se.spi.ior.ObjectKeyTemplate okeyTemplate, com.sun.corba.se.spi.ior.ObjectId id, org.omg.CORBA_2_3.portable.OutputStream os)

	giopVersion.write( os ) ;
	primary.write( os ) ;

	// Note that this is NOT an encapsulation: do not marshal
	// the endianness flag.  However, the length is required.
	// Note that this cannot be accomplished with a codec!

        // Use the byte order of the given stream
        OutputStream encapsulatedOS = new EncapsOutputStream( (ORB)os.orb(),
	    ((CDROutputStream)os).isLittleEndian() ) ;

	okeyTemplate.write( id, encapsulatedOS ) ;
	EncapsulationUtility.writeOutputStream( encapsulatedOS, os ) ;

	if (giopVersion.getMinor() > 0) 
	    EncapsulationUtility.writeIdentifiableSequence( this, os ) ;
    
public voidwriteContents(org.omg.CORBA_2_3.portable.OutputStream os)
Write out this IIOPProfileTemplateImpl only.

	giopVersion.write( os ) ;
	primary.write( os ) ;

	if (giopVersion.getMinor() > 0) 
	    EncapsulationUtility.writeIdentifiableSequence( this, os ) ;