1. /*
  2. * @(#)LocalObject.java 1.14 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package org.omg.CORBA;
  8. import org.omg.CORBA.portable.*;
  9. /**
  10. * <P>Used as a base class for implementation of a local IDL interface in the
  11. * Java language mapping. It is a class which implements all the operations
  12. * in the <tt>org.omg.CORBA.Object</tt> interface.
  13. * <P>Local interfaces are implemented by using CORBA::LocalObject
  14. * to provide implementations of <code>Object</code> pseudo
  15. * operations and any other ORB-specific support mechanisms that are
  16. * appropriate for such objects. Object implementation techniques are
  17. * inherently language-mapping specific. Therefore, the
  18. * <code>LocalObject</code> type is not defined in IDL, but is specified
  19. * in each language mapping.
  20. * <P>Methods that do not apply to local objects throw
  21. * an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with the message,
  22. * "This is a locally contrained object." Attempting to use a
  23. * <TT>LocalObject</TT> to create a DII request results in NO_IMPLEMENT
  24. * system exception. Attempting to marshal or stringify a
  25. * <TT>LocalObject</TT> results in a MARSHAL system exception. Narrowing
  26. * and widening references to <TT>LocalObjects</TT> must work as for regular
  27. * object references.
  28. * <P><code>LocalObject</code> is to be used as the base class of locally
  29. * constrained objects, such as those in the PortableServer module.
  30. * The specification here is based on the CORBA Components
  31. * Volume I - orbos/99-07-01<P>
  32. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  33. * comments for unimplemented features</a>
  34. */
  35. public class LocalObject implements org.omg.CORBA.Object
  36. {
  37. private static String reason = "This is a locally constrained object.";
  38. /**
  39. * Constructs a default <code>LocalObject</code> instance.
  40. */
  41. public LocalObject() {}
  42. /**
  43. * <P>Determines whether the two object references are equivalent,
  44. * so far as the ORB can easily determine. Two object references are equivalent
  45. * if they are identical. Two distinct object references which in fact refer to
  46. * the same object are also equivalent. However, ORBs are not required
  47. * to attempt determination of whether two distinct object references
  48. * refer to the same object, since such determination could be impractically
  49. * expensive.
  50. * <P>Default implementation of the org.omg.CORBA.Object method. <P>
  51. *
  52. * @param that the object reference with which to check for equivalence
  53. * @return <code>true</code> if this object reference is known to be
  54. * equivalent to the given object reference.
  55. * Note that <code>false</code> indicates only that the two
  56. * object references are distinct, not necessarily that
  57. * they reference distinct objects.
  58. */
  59. public boolean _is_equivalent(org.omg.CORBA.Object that) {
  60. return equals(that) ;
  61. }
  62. /**
  63. * Always returns <code>false</code>.
  64. * This method is the default implementation of the
  65. * <code>org.omg.CORBA.Object</code> method.<P>
  66. *
  67. * @return <code>false</code>
  68. */
  69. public boolean _non_existent() {
  70. return false;
  71. }
  72. /**
  73. * Returns a hash value that is consistent for the
  74. * lifetime of the object, using the given number as the maximum.
  75. * This method is the default implementation of the
  76. * <code>org.omg.CORBA.Object</code> method.<P>
  77. * @param maximum an <code>int</code> identifying maximum value of
  78. * the hashcode
  79. * @return this instance's hashcode
  80. */
  81. public int _hash(int maximum) {
  82. return hashCode() ;
  83. }
  84. /**
  85. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  86. * the message "This is a locally constrained object." This method
  87. * does not apply to local objects and is therefore not implemented.
  88. * This method is the default implementation of the
  89. * <code>org.omg.CORBA.Object</code> method.<P>
  90. *
  91. * @param repository_id a <code>String</code>
  92. * @return NO_IMPLEMENT because this is a locally constrained object
  93. * and this method does not apply to local objects
  94. * @exception NO_IMPLEMENT because this is a locally constrained object
  95. * and this method does not apply to local objects
  96. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  97. * comments for unimplemented features</a>
  98. */
  99. public boolean _is_a(String repository_id) {
  100. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  101. }
  102. /**
  103. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  104. * the message "This is a locally constrained object."
  105. * This method is the default implementation of the
  106. * <code>org.omg.CORBA.Object</code> method.<P>
  107. * @return a duplicate of this <code>LocalObject</code> instance.
  108. * @exception NO_IMPLEMENT
  109. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  110. * comments for unimplemented features</a>
  111. */
  112. public org.omg.CORBA.Object _duplicate() {
  113. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  114. }
  115. /**
  116. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  117. * the message "This is a locally constrained object."
  118. * This method is the default implementation of the
  119. * <code>org.omg.CORBA.Object</code> method.<P>
  120. * @exception NO_IMPLEMENT
  121. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  122. * comments for unimplemented features</a>
  123. */
  124. public void _release() {
  125. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  126. }
  127. /**
  128. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  129. * the message "This is a locally constrained object."
  130. * This method is the default implementation of the
  131. * <code>org.omg.CORBA.Object</code> method.<P>
  132. *
  133. * @param operation a <code>String</code> giving the name of an operation
  134. * to be performed by the request that is returned
  135. * @return a <code>Request</code> object with the given operation
  136. * @exception NO_IMPLEMENT
  137. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  138. * comments for unimplemented features</a>
  139. */
  140. public Request _request(String operation) {
  141. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  142. }
  143. /**
  144. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  145. * the message "This is a locally constrained object."
  146. * This method is the default implementation of the
  147. * <code>org.omg.CORBA.Object</code> method.<P>
  148. *
  149. * @param ctx a <code>Context</code> object containing
  150. * a list of properties
  151. * @param operation the <code>String</code> representing the name of the
  152. * method to be invoked
  153. * @param arg_list an <code>NVList</code> containing the actual arguments
  154. * to the method being invoked
  155. * @param result a <code>NamedValue</code> object to serve as a
  156. * container for the method's return value
  157. * @return a new <code>Request</code> object initialized with the given
  158. * arguments
  159. * @exception NO_IMPLEMENT
  160. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  161. * comments for unimplemented features</a>
  162. */
  163. public Request _create_request(Context ctx,
  164. String operation,
  165. NVList arg_list,
  166. NamedValue result) {
  167. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  168. }
  169. /**
  170. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  171. * the message "This is a locally constrained object."
  172. * This method is the default implementation of the
  173. * <code>org.omg.CORBA.Object</code> method.<P>
  174. *
  175. * @param ctx a <code>Context</code> object containing
  176. * a list of properties
  177. * @param operation the name of the method to be invoked
  178. * @param arg_list an <code>NVList</code> containing the actual arguments
  179. * to the method being invoked
  180. * @param result a <code>NamedValue</code> object to serve as a
  181. * container for the method's return value
  182. * @param exceptions an <code>ExceptionList</code> object containing a
  183. * list of possible exceptions the method can throw
  184. * @param contexts a <code>ContextList</code> object containing a list of
  185. * context strings that need to be resolved and sent
  186. * with the
  187. * <code>Request</code> instance
  188. * @return the new <code>Request</code> object initialized with the given
  189. * arguments
  190. * @exception NO_IMPLEMENT
  191. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  192. * comments for unimplemented features</a>
  193. */
  194. public Request _create_request(Context ctx,
  195. String operation,
  196. NVList arg_list,
  197. NamedValue result,
  198. ExceptionList exceptions,
  199. ContextList contexts) {
  200. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  201. }
  202. /**
  203. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  204. * the message "This is a locally constrained object." This method
  205. * does not apply to local objects and is therefore not implemented.
  206. * This method is the default implementation of the
  207. * <code>org.omg.CORBA.Object</code> method.<P>
  208. * @return NO_IMPLEMENT because this is a locally constrained object
  209. * and this method does not apply to local objects
  210. * @exception NO_IMPLEMENT because this is a locally constrained object
  211. * and this method does not apply to local objects
  212. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  213. * comments for unimplemented features</a>
  214. */
  215. public org.omg.CORBA.Object _get_interface()
  216. {
  217. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  218. }
  219. /**
  220. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  221. * the message "This is a locally constrained object."
  222. * This method is the default implementation of the
  223. * <code>org.omg.CORBA.Object</code> method.<P>
  224. * @exception NO_IMPLEMENT
  225. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  226. * comments for unimplemented features</a>
  227. */
  228. public org.omg.CORBA.Object _get_interface_def()
  229. {
  230. // First try to call the delegate implementation class's
  231. // "Object get_interface_def(..)" method (will work for JDK1.2
  232. // ORBs).
  233. // Else call the delegate implementation class's
  234. // "InterfaceDef get_interface(..)" method using reflection
  235. // (will work for pre-JDK1.2 ORBs).
  236. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  237. }
  238. /**
  239. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  240. * the message "This is a locally constrained object."
  241. * This method is the default implementation of the
  242. * <code>org.omg.CORBA.Object</code> method.<P>
  243. * @return the ORB instance that created the Delegate contained in this
  244. * <code>ObjectImpl</code>
  245. * @exception NO_IMPLEMENT
  246. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  247. * comments for unimplemented features</a>
  248. */
  249. public org.omg.CORBA.ORB _orb() {
  250. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  251. }
  252. /**
  253. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  254. * the message "This is a locally constrained object." This method
  255. * does not apply to local objects and is therefore not implemented.
  256. * This method is the default implementation of the
  257. * <code>org.omg.CORBA.Object</code> method.<P>
  258. * @param policy_type an <code>int</code>
  259. * @return NO_IMPLEMENT because this is a locally constrained object
  260. * and this method does not apply to local objects
  261. * @exception NO_IMPLEMENT because this is a locally constrained object
  262. * and this method does not apply to local objects
  263. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  264. * comments for unimplemented features</a>
  265. */
  266. public org.omg.CORBA.Policy _get_policy(int policy_type) {
  267. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  268. }
  269. /**
  270. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  271. * the message "This is a locally constrained object." This method
  272. * does not apply to local objects and is therefore not implemented.
  273. * This method is the default implementation of the
  274. * <code>org.omg.CORBA.Object</code> method.<P>
  275. * @exception NO_IMPLEMENT
  276. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  277. * comments for unimplemented features</a>
  278. */
  279. public org.omg.CORBA.DomainManager[] _get_domain_managers() {
  280. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  281. }
  282. /**
  283. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  284. * the message "This is a locally constrained object." This method
  285. * does not apply to local objects and is therefore not implemented.
  286. * This method is the default implementation of the
  287. * <code>org.omg.CORBA.Object</code> method.
  288. *
  289. * @param policies an array
  290. * @param set_add a flag
  291. * @return NO_IMPLEMENT because this is a locally constrained object
  292. * and this method does not apply to local objects
  293. * @exception NO_IMPLEMENT because this is a locally constrained object
  294. * and this method does not apply to local objects
  295. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  296. * comments for unimplemented features</a>
  297. */
  298. public org.omg.CORBA.Object
  299. _set_policy_override(org.omg.CORBA.Policy[] policies,
  300. org.omg.CORBA.SetOverrideType set_add) {
  301. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  302. }
  303. /**
  304. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  305. * the message "This is a locally constrained object."
  306. * This method is the default implementation of the
  307. * <code>org.omg.CORBA.Object</code> method.<P>
  308. * Returns <code>true</code> for this <code>LocalObject</code> instance.<P>
  309. * @return <code>true</code> always
  310. * @exception NO_IMPLEMENT
  311. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  312. * comments for unimplemented features</a>
  313. */
  314. public boolean _is_local() {
  315. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  316. }
  317. /**
  318. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  319. * the message "This is a locally constrained object."
  320. * This method is the default implementation of the
  321. * <code>org.omg.CORBA.Object</code> method.<P>
  322. * @param operation a <code>String</code> indicating which operation
  323. * to preinvoke
  324. * @param expectedType the class of the type of operation mentioned above
  325. * @return NO_IMPLEMENT because this is a locally constrained object
  326. * and this method does not apply to local objects
  327. * @exception NO_IMPLEMENT because this is a locally constrained object
  328. * and this method does not apply to local object
  329. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  330. * comments for unimplemented features</a>
  331. */
  332. public ServantObject _servant_preinvoke(String operation,
  333. Class expectedType) {
  334. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  335. }
  336. /**
  337. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  338. * the message "This is a locally constrained object."
  339. * This method is the default implementation of the
  340. * <code>org.omg.CORBA.Object</code> method.<P>
  341. * @param servant the servant object on which to post-invoke
  342. * @exception NO_IMPLEMENT
  343. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  344. * comments for unimplemented features</a>
  345. */
  346. public void _servant_postinvoke(ServantObject servant) {
  347. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  348. }
  349. /*
  350. * The following methods were added by orbos/98-04-03: Java to IDL
  351. * Mapping. These are used by RMI over IIOP.
  352. */
  353. /**
  354. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  355. * the message "This is a locally constrained object."
  356. * This method is the default implementation of the
  357. * <code>org.omg.CORBA.Object</code> method.
  358. * <P>Called by a stub to obtain an OutputStream for
  359. * marshaling arguments. The stub must supply the operation name,
  360. * and indicate if a response is expected (i.e is this a oneway
  361. * call).<P>
  362. * @param operation the name of the operation being requested
  363. * @param responseExpected <code>true</code> if a response is expected,
  364. * <code>false</code> if it is a one-way call
  365. * @return NO_IMPLEMENT because this is a locally constrained object
  366. * and this method does not apply to local objects
  367. * @exception NO_IMPLEMENT because this is a locally constrained object
  368. * and this method does not apply to local objects
  369. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  370. * comments for unimplemented features</a>
  371. */
  372. public OutputStream _request(String operation,
  373. boolean responseExpected) {
  374. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  375. }
  376. /**
  377. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  378. * the message "This is a locally constrained object."
  379. * This method is the default implementation of the
  380. * <code>org.omg.CORBA.Object</code> method.
  381. * <P>Called to invoke an operation. The stub provides an
  382. * <code>OutputStream</code> that was previously returned by a
  383. * <code>_request()</code>
  384. * call. <code>_invoke</code> returns an <code>InputStream</code> which
  385. * contains the
  386. * marshaled reply. If an exception occurs, <code>_invoke</code> may throw an
  387. * <code>ApplicationException</code> object which contains an
  388. * <code>InputStream</code> from
  389. * which the user exception state may be unmarshaled.<P>
  390. * @param output the <code>OutputStream</code> to invoke
  391. * @return NO_IMPLEMENT because this is a locally constrained object
  392. * and this method does not apply to local objects
  393. * @throws ApplicationException If an exception occurs,
  394. * <code>_invoke</code> may throw an
  395. * <code>ApplicationException</code> object which contains
  396. * an <code>InputStream</code> from
  397. * which the user exception state may be unmarshaled.
  398. * @throws RemarshalException If an exception occurs,
  399. * <code>_invoke</code> may throw an
  400. * <code>ApplicationException</code> object which contains
  401. * an <code>InputStream</code> from
  402. * which the user exception state may be unmarshaled.
  403. * @exception NO_IMPLEMENT because this is a locally constrained object
  404. * and this method does not apply to local objects
  405. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  406. * comments for unimplemented features</a>
  407. */
  408. public InputStream _invoke(OutputStream output)
  409. throws ApplicationException, RemarshalException
  410. {
  411. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  412. }
  413. /**
  414. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  415. * the message "This is a locally constrained object."
  416. * This method is the default implementation of the
  417. * <code>org.omg.CORBA.Object</code> method.
  418. * <P>May optionally be called by a stub to release a
  419. * reply stream back to the ORB when the unmarshaling has
  420. * completed. The stub passes the <code>InputStream</code> returned by
  421. * <code>_invoke()</code> or
  422. * <code>ApplicationException.getInputStream()</code>.
  423. * A null
  424. * value may also be passed to <code>_releaseReply</code>, in which case the
  425. * method is a no-op.<P>
  426. * @param input the reply stream back to the ORB or null
  427. * @exception NO_IMPLEMENT
  428. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  429. * comments for unimplemented features</a>
  430. */
  431. public void _releaseReply(InputStream input) {
  432. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  433. }
  434. /**
  435. * Throws an <code>org.omg.CORBA.NO_IMPLEMENT</code> exception with
  436. * the message "This is a locally constrained object." This method
  437. * does not apply to local objects and is therefore not implemented.
  438. * This method is the default implementation of the
  439. * <code>org.omg.CORBA.Object</code> method.<P>
  440. * @return NO_IMPLEMENT because this is a locally constrained object
  441. * and this method does not apply to local objects
  442. * @exception NO_IMPLEMENT because this is a locally constrained object
  443. * and this method does not apply to local objects
  444. * @see <a href="package-summary.html#unimpl"><code>CORBA</code> package
  445. * comments for unimplemented features</a>
  446. */
  447. public boolean validate_connection() {
  448. throw new org.omg.CORBA.NO_IMPLEMENT(reason);
  449. }
  450. }