1. /*
  2. * @(#)StandardIIOPProfileTemplate.java 1.12 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.internal.core;
  8. import java.io.StringWriter;
  9. import java.io.IOException;
  10. import java.util.Iterator ;
  11. import javax.rmi.CORBA.Util ;
  12. import com.sun.corba.se.internal.ior.IIOPAddress ;
  13. import com.sun.corba.se.internal.ior.JavaCodebaseComponent ;
  14. import com.sun.corba.se.internal.ior.CodeSetsComponent ;
  15. import com.sun.corba.se.internal.ior.ObjectId ;
  16. import com.sun.corba.se.internal.ior.IIOPAddressImpl ;
  17. import com.sun.corba.se.internal.ior.IIOPProfileTemplate ;
  18. import com.sun.corba.se.internal.ior.ObjectKeyTemplate ;
  19. import org.omg.IOP.TAG_JAVA_CODEBASE ;
  20. import org.omg.IOP.TAG_INTERNET_IOP ;
  21. public class StandardIIOPProfileTemplate extends IIOPProfileTemplate
  22. {
  23. public StandardIIOPProfileTemplate(
  24. IIOPAddress addr, int major, int minor,
  25. ObjectKeyTemplate ktemp, Object servant, ORB factory )
  26. {
  27. super((byte)major, (byte)minor, addr, ktemp);
  28. // Version 1.0 of the IIOP Profile does not have
  29. // tagged components.
  30. if (minor > 0 || major > 1) {
  31. if (servant != null) {
  32. String codebase = Util.getCodebase(servant.getClass());
  33. if (codebase != null)
  34. add( new JavaCodebaseComponent(codebase) ) ;
  35. }
  36. add( new CodeSetsComponent( factory ) ) ;
  37. }
  38. }
  39. }