1. /*
  2. * @(#)NewObjectKeyTemplateBase.java 1.6 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. // @(#)NewObjectKeyTemplateBase.java 1.6 03/01/23
  8. package com.sun.corba.se.internal.ior;
  9. import java.io.IOException ;
  10. import com.sun.corba.se.internal.ior.ObjectId ;
  11. import com.sun.corba.se.internal.ior.ObjectKeyFactory ;
  12. import org.omg.CORBA_2_3.portable.OutputStream ;
  13. import com.sun.corba.se.internal.iiop.CDROutputStream ;
  14. import com.sun.corba.se.internal.iiop.CDRInputStream ;
  15. import com.sun.corba.se.internal.core.GIOPVersion ;
  16. import com.sun.corba.se.internal.core.ORBVersion ;
  17. import com.sun.corba.se.internal.core.ORBVersionFactory ;
  18. import org.omg.CORBA.ORB ;
  19. import org.omg.CORBA.INTERNAL ;
  20. /**
  21. * @author
  22. */
  23. public abstract class NewObjectKeyTemplateBase extends ObjectKeyTemplateBase
  24. {
  25. /**
  26. * @param scid
  27. * @param serverid
  28. * @return
  29. * @exception
  30. * @author
  31. * @roseuid 3915FF9803AA
  32. */
  33. public NewObjectKeyTemplateBase( int magic, int scid, int serverid)
  34. {
  35. super( magic, scid, serverid ) ;
  36. // superclass must set the version, since we don't have the object key here.
  37. if (magic != ObjectKeyTemplate.JAVAMAGIC_NEWER)
  38. throw new INTERNAL() ;
  39. }
  40. /**
  41. * @param objectId
  42. * @param os
  43. * @return void
  44. * @exception
  45. * @author
  46. * @roseuid 3915FFEB0287
  47. */
  48. public void write(ObjectId objectId, OutputStream os)
  49. {
  50. super.write( objectId, os ) ;
  51. getORBVersion().write( os ) ;
  52. }
  53. protected void setVersion( CDRInputStream is )
  54. {
  55. ORBVersion version = ORBVersionFactory.create( is ) ;
  56. setORBVersion( version ) ;
  57. }
  58. }