1. package org.omg.CosNaming;
  2. /**
  3. * org/omg/CosNaming/NameComponentHelper.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.1"
  5. * from ../../../../src/share/classes/org/omg/CosNaming/nameservice.idl
  6. * Monday, February 23, 2004 7:03:07 AM GMT
  7. */
  8. /**
  9. * Many of the operations defined on a naming context take names as
  10. * parameters. Names have structure. A name is an ordered sequence of
  11. * components. <p>
  12. *
  13. * A name with a single component is called a simple name; a name with
  14. * multiple components is called a compound name. Each component except
  15. * the last is used to name a context; the last component denotes the
  16. * bound object. <p>
  17. *
  18. * A name component consists of two attributes: the identifier
  19. * attribute and the kind attribute. Both the identifier attribute and the
  20. * kind attribute are represented as IDL strings. The kind attribute adds
  21. * descriptive power to names in a syntax-independent way. Examples of the
  22. * value of the kind attribute include c_source, object_code, executable,
  23. * postscript, or " ".
  24. */
  25. abstract public class NameComponentHelper
  26. {
  27. private static String _id = "IDL:omg.org/CosNaming/NameComponent:1.0";
  28. public static void insert (org.omg.CORBA.Any a, org.omg.CosNaming.NameComponent that)
  29. {
  30. org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
  31. a.type (type ());
  32. write (out, that);
  33. a.read_value (out.create_input_stream (), type ());
  34. }
  35. public static org.omg.CosNaming.NameComponent extract (org.omg.CORBA.Any a)
  36. {
  37. return read (a.create_input_stream ());
  38. }
  39. private static org.omg.CORBA.TypeCode __typeCode = null;
  40. private static boolean __active = false;
  41. synchronized public static org.omg.CORBA.TypeCode type ()
  42. {
  43. if (__typeCode == null)
  44. {
  45. synchronized (org.omg.CORBA.TypeCode.class)
  46. {
  47. if (__typeCode == null)
  48. {
  49. if (__active)
  50. {
  51. return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
  52. }
  53. __active = true;
  54. org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [2];
  55. org.omg.CORBA.TypeCode _tcOf_members0 = null;
  56. _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0);
  57. _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CosNaming.IstringHelper.id (), "Istring", _tcOf_members0);
  58. _members0[0] = new org.omg.CORBA.StructMember (
  59. "id",
  60. _tcOf_members0,
  61. null);
  62. _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0);
  63. _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CosNaming.IstringHelper.id (), "Istring", _tcOf_members0);
  64. _members0[1] = new org.omg.CORBA.StructMember (
  65. "kind",
  66. _tcOf_members0,
  67. null);
  68. __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.omg.CosNaming.NameComponentHelper.id (), "NameComponent", _members0);
  69. __active = false;
  70. }
  71. }
  72. }
  73. return __typeCode;
  74. }
  75. public static String id ()
  76. {
  77. return _id;
  78. }
  79. public static org.omg.CosNaming.NameComponent read (org.omg.CORBA.portable.InputStream istream)
  80. {
  81. org.omg.CosNaming.NameComponent value = new org.omg.CosNaming.NameComponent ();
  82. value.id = istream.read_string ();
  83. value.kind = istream.read_string ();
  84. return value;
  85. }
  86. public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CosNaming.NameComponent value)
  87. {
  88. ostream.write_string (value.id);
  89. ostream.write_string (value.kind);
  90. }
  91. }