1. package org.omg.CosNaming;
  2. /**
  3. * org/omg/CosNaming/NamingContextExtHelper.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.2"
  5. * from ../../../../src/share/classes/org/omg/CosNaming/nameservice.idl
  6. * Wednesday, September 15, 2004 10:28:47 AM GMT
  7. */
  8. /**
  9. * <code>NamingContextExt</code> is the extension of <code>NamingContext</code>
  10. * which
  11. * contains a set of name bindings in which each name is unique and is
  12. * part of Interoperable Naming Service.
  13. * Different names can be bound to an object in the same or different
  14. * contexts at the same time. Using <tt>NamingContextExt</tt>, you can use
  15. * URL-based names to bind and resolve. <p>
  16. *
  17. * See <a href="http://www.omg.org/technology/documents/formal/naming_service.htm">
  18. * CORBA COS
  19. * Naming Specification.</a>
  20. */
  21. abstract public class NamingContextExtHelper
  22. {
  23. private static String _id = "IDL:omg.org/CosNaming/NamingContextExt:1.0";
  24. public static void insert (org.omg.CORBA.Any a, org.omg.CosNaming.NamingContextExt that)
  25. {
  26. org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
  27. a.type (type ());
  28. write (out, that);
  29. a.read_value (out.create_input_stream (), type ());
  30. }
  31. public static org.omg.CosNaming.NamingContextExt extract (org.omg.CORBA.Any a)
  32. {
  33. return read (a.create_input_stream ());
  34. }
  35. private static org.omg.CORBA.TypeCode __typeCode = null;
  36. synchronized public static org.omg.CORBA.TypeCode type ()
  37. {
  38. if (__typeCode == null)
  39. {
  40. __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.CosNaming.NamingContextExtHelper.id (), "NamingContextExt");
  41. }
  42. return __typeCode;
  43. }
  44. public static String id ()
  45. {
  46. return _id;
  47. }
  48. public static org.omg.CosNaming.NamingContextExt read (org.omg.CORBA.portable.InputStream istream)
  49. {
  50. return narrow (istream.read_Object (_NamingContextExtStub.class));
  51. }
  52. public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CosNaming.NamingContextExt value)
  53. {
  54. ostream.write_Object ((org.omg.CORBA.Object) value);
  55. }
  56. public static org.omg.CosNaming.NamingContextExt narrow (org.omg.CORBA.Object obj)
  57. {
  58. if (obj == null)
  59. return null;
  60. else if (obj instanceof org.omg.CosNaming.NamingContextExt)
  61. return (org.omg.CosNaming.NamingContextExt)obj;
  62. else if (!obj._is_a (id ()))
  63. throw new org.omg.CORBA.BAD_PARAM ();
  64. else
  65. {
  66. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
  67. org.omg.CosNaming._NamingContextExtStub stub = new org.omg.CosNaming._NamingContextExtStub ();
  68. stub._set_delegate(delegate);
  69. return stub;
  70. }
  71. }
  72. public static org.omg.CosNaming.NamingContextExt unchecked_narrow (org.omg.CORBA.Object obj)
  73. {
  74. if (obj == null)
  75. return null;
  76. else if (obj instanceof org.omg.CosNaming.NamingContextExt)
  77. return (org.omg.CosNaming.NamingContextExt)obj;
  78. else
  79. {
  80. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
  81. org.omg.CosNaming._NamingContextExtStub stub = new org.omg.CosNaming._NamingContextExtStub ();
  82. stub._set_delegate(delegate);
  83. return stub;
  84. }
  85. }
  86. }