1. package org.omg.IOP;
  2. /**
  3. * org/omg/IOP/TaggedComponentHelper.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.1"
  5. * from ../../../../src/share/classes/org/omg/PortableInterceptor/IOP.idl
  6. * Monday, February 23, 2004 7:03:03 AM GMT
  7. */
  8. /**
  9. * <code>TaggedComponents</code> contained in
  10. * <code>TAG_INTERNET_IOP</code> and
  11. * <code>TAG_MULTIPLE_COMPONENTS</code> profiles are identified by
  12. * unique numeric tags using a namespace distinct form that is used for
  13. * profile tags. Component tags are assigned by the OMG.
  14. * <p>
  15. * Specifications of components must include the following information:
  16. * <ul>
  17. * <li><i>Component ID</i>: The compound tag that is obtained
  18. * from OMG.</li>
  19. * <li><i>Structure and encoding</i>: The syntax of the component
  20. * data and the encoding rules. If the component value is
  21. * encoded as a CDR encapsulation, the IDL type that is
  22. * encapsulated and the GIOP version which is used for encoding
  23. * the value, if different than GIOP 1.0, must be specified as
  24. * part of the component definition.</li>
  25. * <li><i>Semantics</i>: How the component data is intended to be
  26. * used.</li>
  27. * <li><i>Protocols</i>: The protocol for which the component is
  28. * defined, and whether it is intended that the component be
  29. * usable by other protocols.</li>
  30. * <li><i>At most once</i>: whether more than one instance of this
  31. * component can be included in a profile.</li>
  32. * </ul>
  33. * Specification of protocols must describe how the components affect
  34. * the protocol. The following should be specified in any protocol
  35. * definition for each <code>TaggedComponent</code> that the protocol uses:
  36. * <ul>
  37. * <li><i>Mandatory presence</i>: Whether inclusion of the component
  38. * in profiles supporting the protocol is required (MANDATORY
  39. * PRESENCE) or not required (OPTIONAL PRESENCE).</li>
  40. * <li><i>Droppable</i>: For optional presence component, whether
  41. * component, if present, must be retained or may be dropped.</li>
  42. * </ul>
  43. */
  44. abstract public class TaggedComponentHelper
  45. {
  46. private static String _id = "IDL:omg.org/IOP/TaggedComponent:1.0";
  47. public static void insert (org.omg.CORBA.Any a, org.omg.IOP.TaggedComponent that)
  48. {
  49. org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
  50. a.type (type ());
  51. write (out, that);
  52. a.read_value (out.create_input_stream (), type ());
  53. }
  54. public static org.omg.IOP.TaggedComponent extract (org.omg.CORBA.Any a)
  55. {
  56. return read (a.create_input_stream ());
  57. }
  58. private static org.omg.CORBA.TypeCode __typeCode = null;
  59. private static boolean __active = false;
  60. synchronized public static org.omg.CORBA.TypeCode type ()
  61. {
  62. if (__typeCode == null)
  63. {
  64. synchronized (org.omg.CORBA.TypeCode.class)
  65. {
  66. if (__typeCode == null)
  67. {
  68. if (__active)
  69. {
  70. return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
  71. }
  72. __active = true;
  73. org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [2];
  74. org.omg.CORBA.TypeCode _tcOf_members0 = null;
  75. _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong);
  76. _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.IOP.ComponentIdHelper.id (), "ComponentId", _tcOf_members0);
  77. _members0[0] = new org.omg.CORBA.StructMember (
  78. "tag",
  79. _tcOf_members0,
  80. null);
  81. _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_octet);
  82. _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0);
  83. _members0[1] = new org.omg.CORBA.StructMember (
  84. "component_data",
  85. _tcOf_members0,
  86. null);
  87. __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.omg.IOP.TaggedComponentHelper.id (), "TaggedComponent", _members0);
  88. __active = false;
  89. }
  90. }
  91. }
  92. return __typeCode;
  93. }
  94. public static String id ()
  95. {
  96. return _id;
  97. }
  98. public static org.omg.IOP.TaggedComponent read (org.omg.CORBA.portable.InputStream istream)
  99. {
  100. org.omg.IOP.TaggedComponent value = new org.omg.IOP.TaggedComponent ();
  101. value.tag = istream.read_ulong ();
  102. int _len0 = istream.read_long ();
  103. value.component_data = new byte[_len0];
  104. istream.read_octet_array (value.component_data, 0, _len0);
  105. return value;
  106. }
  107. public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.IOP.TaggedComponent value)
  108. {
  109. ostream.write_ulong (value.tag);
  110. ostream.write_long (value.component_data.length);
  111. ostream.write_octet_array (value.component_data, 0, value.component_data.length);
  112. }
  113. }