1. package org.omg.DynamicAny;
  2. /**
  3. * org/omg/DynamicAny/_DynAnyStub.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.2"
  5. * from ../../../../src/share/classes/org/omg/DynamicAny/DynamicAny.idl
  6. * Wednesday, September 15, 2004 10:28:49 AM GMT
  7. */
  8. /**
  9. * Any values can be dynamically interpreted (traversed) and constructed through DynAny objects.
  10. * A DynAny object is associated with a data value which corresponds to a copy of the value
  11. * inserted into an any.
  12. * <P>A DynAny object may be viewed as an ordered collection of component DynAnys.
  13. * For DynAnys representing a basic type, such as long, or a type without components,
  14. * such as an empty exception, the ordered collection of components is empty.
  15. * Each DynAny object maintains the notion of a current position into its collection
  16. * of component DynAnys. The current position is identified by an index value that runs
  17. * from 0 to n-1, where n is the number of components.
  18. * The special index value -1 indicates a current position that points nowhere.
  19. * For values that cannot have a current position (such as an empty exception),
  20. * the index value is fixed at -1.
  21. * If a DynAny is initialized with a value that has components, the index is initialized to 0.
  22. * After creation of an uninitialized DynAny (that is, a DynAny that has no value but a TypeCode
  23. * that permits components), the current position depends on the type of value represented by
  24. * the DynAny. (The current position is set to 0 or -1, depending on whether the new DynAny
  25. * gets default values for its components.)
  26. * <P>The iteration operations rewind, seek, and next can be used to change the current position
  27. * and the current_component operation returns the component at the current position.
  28. * The component_count operation returns the number of components of a DynAny.
  29. * Collectively, these operations enable iteration over the components of a DynAny, for example,
  30. * to (recursively) examine its contents.
  31. * <P>A constructed DynAny object is a DynAny object associated with a constructed type.
  32. * There is a different interface, inheriting from the DynAny interface, associated with
  33. * each kind of constructed type in IDL (fixed, enum, struct, sequence, union, array,
  34. * exception, and value type).
  35. * <P>A constructed DynAny object exports operations that enable the creation of new DynAny objects,
  36. * each of them associated with a component of the constructed data value.
  37. * As an example, a DynStruct is associated with a struct value. This means that the DynStruct
  38. * may be seen as owning an ordered collection of components, one for each structure member.
  39. * The DynStruct object exports operations that enable the creation of new DynAny objects,
  40. * each of them associated with a member of the struct.
  41. * <P>If a DynAny object has been obtained from another (constructed) DynAny object,
  42. * such as a DynAny representing a structure member that was created from a DynStruct,
  43. * the member DynAny is logically contained in the DynStruct.
  44. * Calling an insert or get operation leaves the current position unchanged.
  45. * Destroying a top-level DynAny object (one that was not obtained as a component of another DynAny)
  46. * also destroys any component DynAny objects obtained from it.
  47. * Destroying a non-top level DynAny object does nothing.
  48. * Invoking operations on a destroyed top-level DynAny or any of its descendants raises OBJECT_NOT_EXIST.
  49. * If the programmer wants to destroy a DynAny object but still wants to manipulate some component
  50. * of the data value associated with it, then he or she should first create a DynAny for the component
  51. * and, after that, make a copy of the created DynAny object.
  52. * <P>The behavior of DynAny objects has been defined in order to enable efficient implementations
  53. * in terms of allocated memory space and speed of access. DynAny objects are intended to be used
  54. * for traversing values extracted from anys or constructing values of anys at runtime.
  55. * Their use for other purposes is not recommended.
  56. * <P>Insert and get operations are necessary to handle basic DynAny objects
  57. * but are also helpful to handle constructed DynAny objects.
  58. * Inserting a basic data type value into a constructed DynAny object
  59. * implies initializing the current component of the constructed data value
  60. * associated with the DynAny object. For example, invoking insert_boolean on a
  61. * DynStruct implies inserting a boolean data value at the current position
  62. * of the associated struct data value.
  63. * A type is consistent for inserting or extracting a value if its TypeCode is equivalent to
  64. * the TypeCode contained in the DynAny or, if the DynAny has components, is equivalent to the TypeCode
  65. * of the DynAny at the current position.
  66. * <P>DynAny and DynAnyFactory objects are intended to be local to the process in which they are
  67. * created and used. This means that references to DynAny and DynAnyFactory objects cannot be exported
  68. * to other processes, or externalized with ORB.object_to_string().
  69. * If any attempt is made to do so, the offending operation will raise a MARSHAL system exception.
  70. * Since their interfaces are specified in IDL, DynAny objects export operations defined in the standard
  71. * org.omg.CORBA.Object interface. However, any attempt to invoke operations exported through the Object
  72. * interface may raise the standard NO_IMPLEMENT exception.
  73. * An attempt to use a DynAny object with the DII may raise the NO_IMPLEMENT exception.
  74. */
  75. public class _DynAnyStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.DynamicAny.DynAny
  76. {
  77. final public static java.lang.Class _opsClass = DynAnyOperations.class;
  78. /**
  79. * Returns the TypeCode associated with this DynAny object.
  80. * A DynAny object is created with a TypeCode value assigned to it.
  81. * This TypeCode value determines the type of the value handled through the DynAny object.
  82. * Note that the TypeCode associated with a DynAny object is initialized at the time the
  83. * DynAny is created and cannot be changed during lifetime of the DynAny object.
  84. *
  85. * @return The TypeCode associated with this DynAny object
  86. */
  87. public org.omg.CORBA.TypeCode type ()
  88. {
  89. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("type", _opsClass);
  90. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  91. try {
  92. return $self.type ();
  93. } finally {
  94. _servant_postinvoke ($so);
  95. }
  96. } // type
  97. /**
  98. * Initializes the value associated with a DynAny object with the value
  99. * associated with another DynAny object.
  100. * The current position of the target DynAny is set to zero for values that have components
  101. * and to -1 for values that do not have components.
  102. *
  103. * @param dyn_any
  104. * @exception TypeMismatch if the type of the passed DynAny is not equivalent to the type of target DynAny
  105. */
  106. public void assign (org.omg.DynamicAny.DynAny dyn_any) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch
  107. {
  108. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("assign", _opsClass);
  109. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  110. try {
  111. $self.assign (dyn_any);
  112. } finally {
  113. _servant_postinvoke ($so);
  114. }
  115. } // assign
  116. /**
  117. * Initializes the value associated with a DynAny object with the value contained in an any.
  118. * The current position of the target DynAny is set to zero for values that have components
  119. * and to -1 for values that do not have components.
  120. *
  121. * @exception TypeMismatch if the type of the passed Any is not equivalent to the type of target DynAny
  122. * @exception InvalidValue if the passed Any does not contain a legal value (such as a null string)
  123. */
  124. public void from_any (org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  125. {
  126. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("from_any", _opsClass);
  127. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  128. try {
  129. $self.from_any (value);
  130. } finally {
  131. _servant_postinvoke ($so);
  132. }
  133. } // from_any
  134. /**
  135. * Creates an any value from a DynAny object.
  136. * A copy of the TypeCode associated with the DynAny object is assigned to the resulting any.
  137. * The value associated with the DynAny object is copied into the any.
  138. *
  139. * @return a new Any object with the same value and TypeCode
  140. */
  141. public org.omg.CORBA.Any to_any ()
  142. {
  143. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("to_any", _opsClass);
  144. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  145. try {
  146. return $self.to_any ();
  147. } finally {
  148. _servant_postinvoke ($so);
  149. }
  150. } // to_any
  151. /**
  152. * Compares two DynAny values for equality.
  153. * Two DynAny values are equal if their TypeCodes are equivalent and, recursively, all component DynAnys
  154. * have equal values.
  155. * The current position of the two DynAnys being compared has no effect on the result of equal.
  156. *
  157. * @return true of the DynAnys are equal, false otherwise
  158. */
  159. public boolean equal (org.omg.DynamicAny.DynAny dyn_any)
  160. {
  161. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("equal", _opsClass);
  162. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  163. try {
  164. return $self.equal (dyn_any);
  165. } finally {
  166. _servant_postinvoke ($so);
  167. }
  168. } // equal
  169. /**
  170. * Destroys a DynAny object.
  171. * This operation frees any resources used to represent the data value associated with a DynAny object.
  172. * It must be invoked on references obtained from one of the creation operations on the ORB interface
  173. * or on a reference returned by DynAny.copy() to avoid resource leaks.
  174. * Invoking destroy on component DynAny objects (for example, on objects returned by the
  175. * current_component operation) does nothing.
  176. * Destruction of a DynAny object implies destruction of all DynAny objects obtained from it.
  177. * That is, references to components of a destroyed DynAny become invalid.
  178. * Invocations on such references raise OBJECT_NOT_EXIST.
  179. * It is possible to manipulate a component of a DynAny beyond the life time of the DynAny
  180. * from which the component was obtained by making a copy of the component with the copy operation
  181. * before destroying the DynAny from which the component was obtained.
  182. */
  183. public void destroy ()
  184. {
  185. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("destroy", _opsClass);
  186. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  187. try {
  188. $self.destroy ();
  189. } finally {
  190. _servant_postinvoke ($so);
  191. }
  192. } // destroy
  193. /**
  194. * Creates a new DynAny object whose value is a deep copy of the DynAny on which it is invoked.
  195. * The operation is polymorphic, that is, invoking it on one of the types derived from DynAny,
  196. * such as DynStruct, creates the derived type but returns its reference as the DynAny base type.
  197. *
  198. * @return a deep copy of the DynAny object
  199. */
  200. public org.omg.DynamicAny.DynAny copy ()
  201. {
  202. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("copy", _opsClass);
  203. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  204. try {
  205. return $self.copy ();
  206. } finally {
  207. _servant_postinvoke ($so);
  208. }
  209. } // copy
  210. /**
  211. * Inserts a boolean value into the DynAny.
  212. *
  213. * @exception InvalidValue if this DynAny has components but has a current position of -1
  214. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  215. */
  216. public void insert_boolean (boolean value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  217. {
  218. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_boolean", _opsClass);
  219. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  220. try {
  221. $self.insert_boolean (value);
  222. } finally {
  223. _servant_postinvoke ($so);
  224. }
  225. } // insert_boolean
  226. /**
  227. * Inserts a byte value into the DynAny. The IDL octet data type is mapped to the Java byte data type.
  228. *
  229. * @exception InvalidValue if this DynAny has components but has a current position of -1
  230. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  231. */
  232. public void insert_octet (byte value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  233. {
  234. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_octet", _opsClass);
  235. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  236. try {
  237. $self.insert_octet (value);
  238. } finally {
  239. _servant_postinvoke ($so);
  240. }
  241. } // insert_octet
  242. /**
  243. * Inserts a char value into the DynAny.
  244. *
  245. * @exception InvalidValue if this DynAny has components but has a current position of -1
  246. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  247. */
  248. public void insert_char (char value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  249. {
  250. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_char", _opsClass);
  251. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  252. try {
  253. $self.insert_char (value);
  254. } finally {
  255. _servant_postinvoke ($so);
  256. }
  257. } // insert_char
  258. /**
  259. * Inserts a short value into the DynAny.
  260. *
  261. * @exception InvalidValue if this DynAny has components but has a current position of -1
  262. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  263. */
  264. public void insert_short (short value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  265. {
  266. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_short", _opsClass);
  267. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  268. try {
  269. $self.insert_short (value);
  270. } finally {
  271. _servant_postinvoke ($so);
  272. }
  273. } // insert_short
  274. /**
  275. * Inserts a short value into the DynAny. The IDL ushort data type is mapped to the Java short data type.
  276. *
  277. * @exception InvalidValue if this DynAny has components but has a current position of -1
  278. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  279. */
  280. public void insert_ushort (short value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  281. {
  282. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_ushort", _opsClass);
  283. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  284. try {
  285. $self.insert_ushort (value);
  286. } finally {
  287. _servant_postinvoke ($so);
  288. }
  289. } // insert_ushort
  290. /**
  291. * Inserts an integer value into the DynAny. The IDL long data type is mapped to the Java int data type.
  292. *
  293. * @exception InvalidValue if this DynAny has components but has a current position of -1
  294. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  295. */
  296. public void insert_long (int value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  297. {
  298. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_long", _opsClass);
  299. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  300. try {
  301. $self.insert_long (value);
  302. } finally {
  303. _servant_postinvoke ($so);
  304. }
  305. } // insert_long
  306. /**
  307. * Inserts an integer value into the DynAny. The IDL ulong data type is mapped to the Java int data type.
  308. *
  309. * @exception InvalidValue if this DynAny has components but has a current position of -1
  310. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  311. */
  312. public void insert_ulong (int value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  313. {
  314. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_ulong", _opsClass);
  315. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  316. try {
  317. $self.insert_ulong (value);
  318. } finally {
  319. _servant_postinvoke ($so);
  320. }
  321. } // insert_ulong
  322. /**
  323. * Inserts a float value into the DynAny.
  324. *
  325. * @exception InvalidValue if this DynAny has components but has a current position of -1
  326. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  327. */
  328. public void insert_float (float value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  329. {
  330. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_float", _opsClass);
  331. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  332. try {
  333. $self.insert_float (value);
  334. } finally {
  335. _servant_postinvoke ($so);
  336. }
  337. } // insert_float
  338. /**
  339. * Inserts a double value into the DynAny.
  340. *
  341. * @exception InvalidValue if this DynAny has components but has a current position of -1
  342. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  343. */
  344. public void insert_double (double value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  345. {
  346. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_double", _opsClass);
  347. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  348. try {
  349. $self.insert_double (value);
  350. } finally {
  351. _servant_postinvoke ($so);
  352. }
  353. } // insert_double
  354. /**
  355. * Inserts a string value into the DynAny.
  356. * Both bounded and unbounded strings are inserted using this method.
  357. *
  358. * @exception InvalidValue if this DynAny has components but has a current position of -1
  359. * @exception InvalidValue if the string inserted is longer than the bound of a bounded string
  360. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  361. */
  362. public void insert_string (String value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  363. {
  364. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_string", _opsClass);
  365. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  366. try {
  367. $self.insert_string (value);
  368. } finally {
  369. _servant_postinvoke ($so);
  370. }
  371. } // insert_string
  372. /**
  373. * Inserts a reference to a CORBA object into the DynAny.
  374. *
  375. * @exception InvalidValue if this DynAny has components but has a current position of -1
  376. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  377. */
  378. public void insert_reference (org.omg.CORBA.Object value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  379. {
  380. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_reference", _opsClass);
  381. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  382. try {
  383. $self.insert_reference (value);
  384. } finally {
  385. _servant_postinvoke ($so);
  386. }
  387. } // insert_reference
  388. /**
  389. * Inserts a TypeCode object into the DynAny.
  390. *
  391. * @exception InvalidValue if this DynAny has components but has a current position of -1
  392. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  393. */
  394. public void insert_typecode (org.omg.CORBA.TypeCode value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  395. {
  396. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_typecode", _opsClass);
  397. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  398. try {
  399. $self.insert_typecode (value);
  400. } finally {
  401. _servant_postinvoke ($so);
  402. }
  403. } // insert_typecode
  404. /**
  405. * Inserts a long value into the DynAny. The IDL long long data type is mapped to the Java long data type.
  406. *
  407. * @exception InvalidValue if this DynAny has components but has a current position of -1
  408. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  409. */
  410. public void insert_longlong (long value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  411. {
  412. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_longlong", _opsClass);
  413. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  414. try {
  415. $self.insert_longlong (value);
  416. } finally {
  417. _servant_postinvoke ($so);
  418. }
  419. } // insert_longlong
  420. /**
  421. * Inserts a long value into the DynAny.
  422. * The IDL unsigned long long data type is mapped to the Java long data type.
  423. *
  424. * @exception InvalidValue if this DynAny has components but has a current position of -1
  425. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  426. */
  427. public void insert_ulonglong (long value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  428. {
  429. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_ulonglong", _opsClass);
  430. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  431. try {
  432. $self.insert_ulonglong (value);
  433. } finally {
  434. _servant_postinvoke ($so);
  435. }
  436. } // insert_ulonglong
  437. /**
  438. * Inserts a char value into the DynAny. The IDL wchar data type is mapped to the Java char data type.
  439. *
  440. * @exception InvalidValue if this DynAny has components but has a current position of -1
  441. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  442. */
  443. public void insert_wchar (char value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  444. {
  445. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_wchar", _opsClass);
  446. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  447. try {
  448. $self.insert_wchar (value);
  449. } finally {
  450. _servant_postinvoke ($so);
  451. }
  452. } // insert_wchar
  453. /**
  454. * Inserts a string value into the DynAny.
  455. * Both bounded and unbounded strings are inserted using this method.
  456. *
  457. * @exception InvalidValue if this DynAny has components but has a current position of -1
  458. * @exception InvalidValue if the string inserted is longer than the bound of a bounded string
  459. */
  460. public void insert_wstring (String value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  461. {
  462. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_wstring", _opsClass);
  463. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  464. try {
  465. $self.insert_wstring (value);
  466. } finally {
  467. _servant_postinvoke ($so);
  468. }
  469. } // insert_wstring
  470. /**
  471. * Inserts an Any value into the Any represented by this DynAny.
  472. *
  473. * @exception InvalidValue if this DynAny has components but has a current position of -1
  474. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  475. */
  476. public void insert_any (org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  477. {
  478. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_any", _opsClass);
  479. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  480. try {
  481. $self.insert_any (value);
  482. } finally {
  483. _servant_postinvoke ($so);
  484. }
  485. } // insert_any
  486. /**
  487. * Inserts the Any value contained in the parameter DynAny into the Any represented by this DynAny.
  488. *
  489. * @exception InvalidValue if this DynAny has components but has a current position of -1
  490. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  491. */
  492. public void insert_dyn_any (org.omg.DynamicAny.DynAny value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  493. {
  494. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_dyn_any", _opsClass);
  495. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  496. try {
  497. $self.insert_dyn_any (value);
  498. } finally {
  499. _servant_postinvoke ($so);
  500. }
  501. } // insert_dyn_any
  502. /**
  503. * Inserts a reference to a Serializable object into this DynAny.
  504. * The IDL ValueBase type is mapped to the Java Serializable type.
  505. *
  506. * @exception InvalidValue if this DynAny has components but has a current position of -1
  507. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  508. */
  509. public void insert_val (java.io.Serializable value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  510. {
  511. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("insert_val", _opsClass);
  512. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  513. try {
  514. $self.insert_val (value);
  515. } finally {
  516. _servant_postinvoke ($so);
  517. }
  518. } // insert_val
  519. /**
  520. * Extracts the boolean value from this DynAny.
  521. *
  522. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  523. * that is not equivalent to the requested type.
  524. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  525. * @exception InvalidValue if this DynAny has components but has a current position of -1
  526. */
  527. public boolean get_boolean () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  528. {
  529. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_boolean", _opsClass);
  530. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  531. try {
  532. return $self.get_boolean ();
  533. } finally {
  534. _servant_postinvoke ($so);
  535. }
  536. } // get_boolean
  537. /**
  538. * Extracts the byte value from this DynAny. The IDL octet data type is mapped to the Java byte data type.
  539. *
  540. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  541. * that is not equivalent to the requested type.
  542. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  543. * @exception InvalidValue if this DynAny has components but has a current position of -1
  544. */
  545. public byte get_octet () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  546. {
  547. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_octet", _opsClass);
  548. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  549. try {
  550. return $self.get_octet ();
  551. } finally {
  552. _servant_postinvoke ($so);
  553. }
  554. } // get_octet
  555. /**
  556. * Extracts the char value from this DynAny.
  557. *
  558. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  559. * that is not equivalent to the requested type.
  560. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  561. * @exception InvalidValue if this DynAny has components but has a current position of -1
  562. */
  563. public char get_char () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  564. {
  565. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_char", _opsClass);
  566. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  567. try {
  568. return $self.get_char ();
  569. } finally {
  570. _servant_postinvoke ($so);
  571. }
  572. } // get_char
  573. /**
  574. * Extracts the short value from this DynAny.
  575. *
  576. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  577. * that is not equivalent to the requested type.
  578. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  579. * @exception InvalidValue if this DynAny has components but has a current position of -1
  580. */
  581. public short get_short () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  582. {
  583. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_short", _opsClass);
  584. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  585. try {
  586. return $self.get_short ();
  587. } finally {
  588. _servant_postinvoke ($so);
  589. }
  590. } // get_short
  591. /**
  592. * Extracts the short value from this DynAny. The IDL ushort data type is mapped to the Java short data type.
  593. *
  594. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  595. * that is not equivalent to the requested type.
  596. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  597. * @exception InvalidValue if this DynAny has components but has a current position of -1
  598. */
  599. public short get_ushort () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  600. {
  601. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_ushort", _opsClass);
  602. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  603. try {
  604. return $self.get_ushort ();
  605. } finally {
  606. _servant_postinvoke ($so);
  607. }
  608. } // get_ushort
  609. /**
  610. * Extracts the integer value from this DynAny. The IDL long data type is mapped to the Java int data type.
  611. *
  612. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  613. * that is not equivalent to the requested type.
  614. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  615. * @exception InvalidValue if this DynAny has components but has a current position of -1
  616. */
  617. public int get_long () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  618. {
  619. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_long", _opsClass);
  620. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  621. try {
  622. return $self.get_long ();
  623. } finally {
  624. _servant_postinvoke ($so);
  625. }
  626. } // get_long
  627. /**
  628. * Extracts the integer value from this DynAny. The IDL ulong data type is mapped to the Java int data type.
  629. *
  630. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  631. * that is not equivalent to the requested type.
  632. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  633. * @exception InvalidValue if this DynAny has components but has a current position of -1
  634. */
  635. public int get_ulong () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  636. {
  637. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_ulong", _opsClass);
  638. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  639. try {
  640. return $self.get_ulong ();
  641. } finally {
  642. _servant_postinvoke ($so);
  643. }
  644. } // get_ulong
  645. /**
  646. * Extracts the float value from this DynAny.
  647. *
  648. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  649. * that is not equivalent to the requested type.
  650. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  651. * @exception InvalidValue if this DynAny has components but has a current position of -1
  652. */
  653. public float get_float () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  654. {
  655. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_float", _opsClass);
  656. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  657. try {
  658. return $self.get_float ();
  659. } finally {
  660. _servant_postinvoke ($so);
  661. }
  662. } // get_float
  663. /**
  664. * Extracts the double value from this DynAny.
  665. *
  666. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  667. * that is not equivalent to the requested type.
  668. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  669. * @exception InvalidValue if this DynAny has components but has a current position of -1
  670. */
  671. public double get_double () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  672. {
  673. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_double", _opsClass);
  674. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  675. try {
  676. return $self.get_double ();
  677. } finally {
  678. _servant_postinvoke ($so);
  679. }
  680. } // get_double
  681. /**
  682. * Extracts the string value from this DynAny.
  683. * Both bounded and unbounded strings are extracted using this method.
  684. *
  685. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  686. * that is not equivalent to the requested type.
  687. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  688. * @exception InvalidValue if this DynAny has components but has a current position of -1
  689. */
  690. public String get_string () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  691. {
  692. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_string", _opsClass);
  693. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  694. try {
  695. return $self.get_string ();
  696. } finally {
  697. _servant_postinvoke ($so);
  698. }
  699. } // get_string
  700. /**
  701. * Extracts the reference to a CORBA Object from this DynAny.
  702. *
  703. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  704. * that is not equivalent to the requested type.
  705. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  706. * @exception InvalidValue if this DynAny has components but has a current position of -1
  707. */
  708. public org.omg.CORBA.Object get_reference () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  709. {
  710. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_reference", _opsClass);
  711. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  712. try {
  713. return $self.get_reference ();
  714. } finally {
  715. _servant_postinvoke ($so);
  716. }
  717. } // get_reference
  718. /**
  719. * Extracts the TypeCode object from this DynAny.
  720. *
  721. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  722. * that is not equivalent to the requested type.
  723. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  724. * @exception InvalidValue if this DynAny has components but has a current position of -1
  725. */
  726. public org.omg.CORBA.TypeCode get_typecode () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  727. {
  728. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_typecode", _opsClass);
  729. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  730. try {
  731. return $self.get_typecode ();
  732. } finally {
  733. _servant_postinvoke ($so);
  734. }
  735. } // get_typecode
  736. /**
  737. * Extracts the long value from this DynAny. The IDL long long data type is mapped to the Java long data type.
  738. *
  739. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  740. * that is not equivalent to the requested type.
  741. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  742. * @exception InvalidValue if this DynAny has components but has a current position of -1
  743. */
  744. public long get_longlong () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  745. {
  746. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_longlong", _opsClass);
  747. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  748. try {
  749. return $self.get_longlong ();
  750. } finally {
  751. _servant_postinvoke ($so);
  752. }
  753. } // get_longlong
  754. /**
  755. * Extracts the long value from this DynAny.
  756. * The IDL unsigned long long data type is mapped to the Java long data type.
  757. *
  758. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  759. * that is not equivalent to the requested type.
  760. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  761. * @exception InvalidValue if this DynAny has components but has a current position of -1
  762. */
  763. public long get_ulonglong () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  764. {
  765. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_ulonglong", _opsClass);
  766. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  767. try {
  768. return $self.get_ulonglong ();
  769. } finally {
  770. _servant_postinvoke ($so);
  771. }
  772. } // get_ulonglong
  773. /**
  774. * Extracts the long value from this DynAny. The IDL wchar data type is mapped to the Java char data type.
  775. *
  776. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  777. * that is not equivalent to the requested type.
  778. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  779. * @exception InvalidValue if this DynAny has components but has a current position of -1
  780. */
  781. public char get_wchar () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  782. {
  783. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_wchar", _opsClass);
  784. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  785. try {
  786. return $self.get_wchar ();
  787. } finally {
  788. _servant_postinvoke ($so);
  789. }
  790. } // get_wchar
  791. /**
  792. * Extracts the string value from this DynAny.
  793. * Both bounded and unbounded strings are extracted using this method.
  794. *
  795. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  796. * that is not equivalent to the requested type.
  797. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  798. */
  799. public String get_wstring () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  800. {
  801. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_wstring", _opsClass);
  802. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  803. try {
  804. return $self.get_wstring ();
  805. } finally {
  806. _servant_postinvoke ($so);
  807. }
  808. } // get_wstring
  809. /**
  810. * Extracts an Any value contained in the Any represented by this DynAny.
  811. *
  812. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  813. * that is not equivalent to the requested type.
  814. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  815. * @exception InvalidValue if this DynAny has components but has a current position of -1
  816. */
  817. public org.omg.CORBA.Any get_any () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  818. {
  819. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_any", _opsClass);
  820. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  821. try {
  822. return $self.get_any ();
  823. } finally {
  824. _servant_postinvoke ($so);
  825. }
  826. } // get_any
  827. /**
  828. * Extracts the Any value contained in the Any represented by this DynAny and returns it wrapped
  829. * into a new DynAny.
  830. *
  831. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  832. * that is not equivalent to the requested type.
  833. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  834. * @exception InvalidValue if this DynAny has components but has a current position of -1
  835. */
  836. public org.omg.DynamicAny.DynAny get_dyn_any () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  837. {
  838. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_dyn_any", _opsClass);
  839. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  840. try {
  841. return $self.get_dyn_any ();
  842. } finally {
  843. _servant_postinvoke ($so);
  844. }
  845. } // get_dyn_any
  846. /**
  847. * Extracts a Serializable object from this DynAny.
  848. * The IDL ValueBase type is mapped to the Java Serializable type.
  849. *
  850. * @exception TypeMismatch if the accessed component in the DynAny is of a type
  851. * that is not equivalent to the requested type.
  852. * @exception TypeMismatch if called on a DynAny whose current component itself has components
  853. * @exception InvalidValue if this DynAny has components but has a current position of -1
  854. */
  855. public java.io.Serializable get_val () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue
  856. {
  857. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("get_val", _opsClass);
  858. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  859. try {
  860. return $self.get_val ();
  861. } finally {
  862. _servant_postinvoke ($so);
  863. }
  864. } // get_val
  865. /**
  866. * Sets the current position to index. The current position is indexed 0 to n-1, that is,
  867. * index zero corresponds to the first component. The operation returns true if the resulting
  868. * current position indicates a component of the DynAny and false if index indicates
  869. * a position that does not correspond to a component.
  870. * Calling seek with a negative index is legal. It sets the current position to -1 to indicate
  871. * no component and returns false. Passing a non-negative index value for a DynAny that does not
  872. * have a component at the corresponding position sets the current position to -1 and returns false.
  873. */
  874. public boolean seek (int index)
  875. {
  876. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("seek", _opsClass);
  877. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  878. try {
  879. return $self.seek (index);
  880. } finally {
  881. _servant_postinvoke ($so);
  882. }
  883. } // seek
  884. /**
  885. * Is equivalent to seek(0).
  886. */
  887. public void rewind ()
  888. {
  889. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("rewind", _opsClass);
  890. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  891. try {
  892. $self.rewind ();
  893. } finally {
  894. _servant_postinvoke ($so);
  895. }
  896. } // rewind
  897. /**
  898. * Advances the current position to the next component.
  899. * The operation returns true while the resulting current position indicates a component, false otherwise.
  900. * A false return value leaves the current position at -1.
  901. * Invoking next on a DynAny without components leaves the current position at -1 and returns false.
  902. */
  903. public boolean next ()
  904. {
  905. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("next", _opsClass);
  906. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  907. try {
  908. return $self.next ();
  909. } finally {
  910. _servant_postinvoke ($so);
  911. }
  912. } // next
  913. /**
  914. * Returns the number of components of a DynAny.
  915. * For a DynAny without components, it returns zero.
  916. * The operation only counts the components at the top level.
  917. * For example, if component_count is invoked on a DynStruct with a single member,
  918. * the return value is 1, irrespective of the type of the member.
  919. * <UL>
  920. * <LI>For sequences, the operation returns the current number of elements.
  921. * <LI>For structures, exceptions, and value types, the operation returns the number of members.
  922. * <LI>For arrays, the operation returns the number of elements.
  923. * <LI>For unions, the operation returns 2 if the discriminator indicates that a named member is active,
  924. * otherwise, it returns 1.
  925. * <LI>For DynFixed and DynEnum, the operation returns zero.
  926. * </UL>
  927. */
  928. public int component_count ()
  929. {
  930. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("component_count", _opsClass);
  931. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  932. try {
  933. return $self.component_count ();
  934. } finally {
  935. _servant_postinvoke ($so);
  936. }
  937. } // component_count
  938. /**
  939. * Returns the DynAny for the component at the current position.
  940. * It does not advance the current position, so repeated calls to current_component
  941. * without an intervening call to rewind, next, or seek return the same component.
  942. * The returned DynAny object reference can be used to get/set the value of the current component.
  943. * If the current component represents a complex type, the returned reference can be narrowed
  944. * based on the TypeCode to get the interface corresponding to the to the complex type.
  945. * Calling current_component on a DynAny that cannot have components,
  946. * such as a DynEnum or an empty exception, raises TypeMismatch.
  947. * Calling current_component on a DynAny whose current position is -1 returns a nil reference.
  948. * The iteration operations, together with current_component, can be used
  949. * to dynamically compose an any value. After creating a dynamic any, such as a DynStruct,
  950. * current_component and next can be used to initialize all the components of the value.
  951. * Once the dynamic value is completely initialized, to_any creates the corresponding any value.
  952. *
  953. * @exception TypeMismatch If called on a DynAny that cannot have components,
  954. * such as a DynEnum or an empty exception
  955. */
  956. public org.omg.DynamicAny.DynAny current_component () throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch
  957. {
  958. org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke ("current_component", _opsClass);
  959. DynAnyOperations $self = (DynAnyOperations) $so.servant;
  960. try {
  961. return $self.current_component ();
  962. } finally {
  963. _servant_postinvoke ($so);
  964. }
  965. } // current_component
  966. // Type-specific CORBA::Object operations
  967. private static String[] __ids = {
  968. "IDL:omg.org/DynamicAny/DynAny:1.0"};
  969. public String[] _ids ()
  970. {
  971. return (String[])__ids.clone ();
  972. }
  973. private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  974. {
  975. String str = s.readUTF ();
  976. String[] args = null;
  977. java.util.Properties props = null;
  978. org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
  979. org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
  980. _set_delegate (delegate);
  981. }
  982. private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  983. {
  984. String[] args = null;
  985. java.util.Properties props = null;
  986. String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
  987. s.writeUTF (str);
  988. }
  989. } // class _DynAnyStub