Request.java 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /* Request.java --
  2. Copyright (C) 2005, 2006 Free Software Foundation, Inc.
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. 02110-1301 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package org.omg.CORBA;
  32. /**
  33. * An object, containing the information, needed to invoke the method of
  34. * the local or remote CORBA object. The Request is used in
  35. * Dynamic Invocation Interface (DII) which allows dynamic creation of
  36. * requests.
  37. *
  38. * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
  39. */
  40. public abstract class Request
  41. {
  42. /**
  43. * Add the named input parameter that passes value to
  44. * the method being invoked. This is similar to the "passing by value"
  45. * conception.
  46. *
  47. * The created parameter is returned allowing to set the value.
  48. *
  49. * @return the created parameter.
  50. */
  51. public abstract Any add_in_arg();
  52. /**
  53. * Add the input/output parameter that passes value both to and from
  54. * the method being invoked. This is similar to the "passing by reference"
  55. * conception.
  56. *
  57. * The created parameter is returned allowing to set the value.
  58. *
  59. * @return the created parameter.
  60. */
  61. public abstract Any add_inout_arg();
  62. /**
  63. * Add the named input parameter that passes value to
  64. * the method being invoked. This is similar to the "passing by value"
  65. * conception.
  66. *
  67. * The created parameter is returned allowing to set the value.
  68. *
  69. * @param name the parameter name.
  70. *
  71. * @return the created parameter.
  72. */
  73. public abstract Any add_named_in_arg(String name);
  74. /**
  75. * Add the named input/output parameter that passes value both to and from
  76. * the method being invoked. This is similar to the "passing by reference"
  77. * conception.
  78. *
  79. * The created parameter is returned allowing to set the value.
  80. *
  81. * @param name the parameter name.
  82. *
  83. * @return the created parameter.
  84. */
  85. public abstract Any add_named_inout_arg(String name);
  86. /**
  87. * Add the named output parameter that passes value from
  88. * the method being invoked. Differently from the java
  89. * language, the CORBA IDL method can return multiple values.
  90. *
  91. * The created parameter is returned allowing to set the value.
  92. *
  93. * @param name the parameter name.
  94. *
  95. * @return the created parameter.
  96. */
  97. public abstract Any add_named_out_arg(String name);
  98. /**
  99. * Add the output parameter that passes value from
  100. * the method being invoked. Differently from the java
  101. * language, the CORBA IDL method can return multiple values.
  102. *
  103. * The created parameter is returned allowing to set the value.
  104. *
  105. * @return the created parameter.
  106. */
  107. public abstract Any add_out_arg();
  108. /**
  109. * Return the list of all previously added parameters.
  110. *
  111. * @return the list of parameters.
  112. */
  113. public abstract NVList arguments();
  114. /**
  115. * Get the context list object for this request.
  116. *
  117. * @return a list of strings that must be resolved and sent with the
  118. * invocation.
  119. */
  120. public abstract ContextList contexts();
  121. /**
  122. * Get the context, previously set using {@link #ctx(Context)}.
  123. * The context contains the details about this request.
  124. */
  125. public abstract Context ctx();
  126. /**
  127. * Set the context that shuld be later returned by {@link #ctx()}.
  128. * This context contains the details about this request.
  129. *
  130. * @param a_context a context to set.
  131. */
  132. public abstract void ctx(Context a_context);
  133. /**
  134. * Returns the container, eclosing an exception that the invoked method
  135. * has thrown.
  136. *
  137. * @return the Environment object, containng the exception.
  138. */
  139. public abstract Environment env();
  140. /**
  141. * List the exceptions that may be thrown by the CORBA object method being
  142. * invoked.
  143. *
  144. * @return the list of exceptions.
  145. */
  146. public abstract ExceptionList exceptions();
  147. /**
  148. * Allow to access the response that has been previously sent using
  149. * {@link #send_deferred()}.
  150. *
  151. * @throws WrongTransaction if the transaction scope mismatches.
  152. */
  153. public abstract void get_response()
  154. throws WrongTransaction;
  155. /**
  156. * Submit the request, suspending the current thread until the
  157. * answer is received.
  158. */
  159. public abstract void invoke();
  160. /**
  161. * Get the name of the method being invoked.
  162. *
  163. * @return the name of the method being invoked.
  164. */
  165. public abstract String operation();
  166. /**
  167. * Check if the response is received to the request that was
  168. * previously send using {@link #send_deferred()}.
  169. *
  170. * @return true if the response has been already received, false otherwise.
  171. */
  172. public abstract boolean poll_response();
  173. /**
  174. * Get the value, returned by the method, together with its name.
  175. *
  176. * @return the value, returned by the method.
  177. */
  178. public abstract NamedValue result();
  179. /**
  180. * Get the value, returned by the method.
  181. *
  182. * @return the value, returned by the method.
  183. */
  184. public abstract Any return_value();
  185. /**
  186. * Send a request without suspending the current thread.
  187. *
  188. * Allow later check of the request status by {@link #poll_response()} and
  189. * retrieving the results by {@link #get_response()}.
  190. */
  191. public abstract void send_deferred();
  192. /**
  193. * Send a request and forget about it, not waiting for a response.
  194. * This can be done also for methods that normally are expected
  195. * to return some values.
  196. */
  197. public abstract void send_oneway();
  198. /**
  199. * Set the return type.
  200. *
  201. * @param returns the type of the value, returned in response to this
  202. * request.
  203. */
  204. public abstract void set_return_type(TypeCode returns);
  205. /**
  206. * Return the CORBA object on that the method would be invoked.
  207. *
  208. * @return the invocation target.
  209. */
  210. public abstract org.omg.CORBA.Object target();
  211. }