1. /*
  2. * @(#)Object.java 1.48 00/02/02
  3. *
  4. * Copyright 1995-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package org.omg.CORBA;
  11. /**
  12. * The definition for a CORBA object reference.
  13. * <p>
  14. * A CORBA object reference is a handle for a particular
  15. * CORBA object implemented by a server. A CORBA object reference
  16. * identifies the same CORBA object each time the reference is used to invoke
  17. * a method on the object.
  18. * A CORBA object may have multiple, distinct object references.
  19. * <p>
  20. * The <code>org.omg.CORBA.Object</code> interface is the root of
  21. * the inheritance hierarchy for all CORBA object references in the Java
  22. * programming language, analogous to <code>java.rmi.Remote</code>
  23. * for RMI remote objects.
  24. * <p>
  25. * A CORBA object may be either local or remote.
  26. * If it is a local object (that is, running in the same
  27. * VM as the client), invocations may be directly serviced by
  28. * the object instance, and the object reference could point to the actual
  29. * instance of the object implementation class.
  30. * If a CORBA object is a remote object (that is, running in a different
  31. * VM from the client), the object reference points to a stub (proxy) which uses the
  32. * ORB machinery to make a remote invocation on the server where the object
  33. * implementation resides.
  34. * <p>
  35. * Default implementations of the methods in the interface
  36. * <code>org.omg.CORBA.Object</code>
  37. * are provided in the class <code>org.omg.CORBA.portable.ObjectImpl</code>,
  38. * which is the base class for stubs and object implementations.
  39. * <p>
  40. * @see org.omg.CORBA.portable.ObjectImpl
  41. */
  42. public interface Object {
  43. /**
  44. * Checks whether this object is an instance of a class that
  45. * implements the given interface.
  46. *
  47. * @param repositoryIdentifier the interface to check against
  48. * @return <code>true</code> if this object reference is an instance
  49. * of a class that implements the interface;
  50. * <code>false</code> otherwise
  51. */
  52. boolean _is_a(String repositoryIdentifier);
  53. /**
  54. * Determines whether the two object references are equivalent,
  55. * so far as the ORB can easily determine. Two object references are equivalent
  56. * if they are identical. Two distinct object references which in fact refer to
  57. * the same object are also equivalent. However, ORBs are not required
  58. * to attempt determination of whether two distinct object references
  59. * refer to the same object, since such determination could be impractically
  60. * expensive.
  61. * @param other the other object reference with which to check for equivalence
  62. * @return <code>true</code> if this object reference is known to be
  63. * equivalent to the given object reference.
  64. * Note that <code>false</code> indicates only that the two
  65. * object references are distinct, not necessarily that
  66. * they reference distinct objects.
  67. */
  68. boolean _is_equivalent(org.omg.CORBA.Object other);
  69. /**
  70. * Determines whether the server object for this object reference has been
  71. * destroyed.
  72. * @return <code>true</code> if the ORB knows authoritatively that the
  73. * server object does not exist; <code>false</code> otherwise
  74. */
  75. boolean _non_existent();
  76. /**
  77. * Returns an ORB-internal identifier for this object reference.
  78. * This is a hash identifier, which does
  79. * not change during the lifetime of the object reference, and so
  80. * neither will any hash function of that identifier change. The value returned
  81. * is not guaranteed to be unique; in other words, another object
  82. * reference may have the same hash value.
  83. * If two object references hash differently,
  84. * then they are distinct object references; however, both may still refer
  85. * to the same CORBA object.
  86. *
  87. * @param maximum the upper bound on the hash value returned by the ORB
  88. * @return the ORB-internal hash identifier for this object reference
  89. */
  90. int _hash(int maximum);
  91. /**
  92. * Returns a duplicate of this CORBA object reference.
  93. * The server object implementation is not involved in creating
  94. * the duplicate, and the implementation cannot distinguish whether
  95. * the original object reference or a duplicate was used to make a request.
  96. * <P>
  97. * Note that this method is not very useful in the Java platform,
  98. * since memory management is handled by the VM.
  99. * It is included for compliance with the CORBA APIs.
  100. * <P>
  101. * The method <code>_duplicate</code> may return this object reference itself.
  102. *
  103. * @return a duplicate of this object reference or this object reference
  104. * itself
  105. */
  106. org.omg.CORBA.Object _duplicate();
  107. /**
  108. * Signals that the caller is done using this object reference, so
  109. * internal ORB resources associated with this object reference can be
  110. * released. Note that the object implementation is not involved in
  111. * this operation, and other references to the same object are not affected.
  112. */
  113. void _release();
  114. /**
  115. * Obtains an <code>InterfaceDef</code> for the object implementation
  116. * referenced by this object reference.
  117. * The <code>InterfaceDef</code> object
  118. * may be used to introspect on the methods, attributes, and other
  119. * type information for the object referred to by this object reference.
  120. *
  121. * @return the <code>InterfaceDef</code> object in the Interface Repository
  122. * which provides type information about the object referred to by
  123. * this object reference
  124. */
  125. org.omg.CORBA.Object _get_interface_def();
  126. /**
  127. * Creates a <code>Request</code> instance for use in the
  128. * Dynamic Invocation Interface.
  129. *
  130. * @param operation the name of the method to be invoked using the
  131. * <code>Request</code> instance
  132. * @return the newly-created <code>Request</code> instance
  133. */
  134. Request _request(String operation);
  135. /**
  136. * Creates a <code>Request</code> instance initialized with the
  137. * given context, method name, list of arguments, and container
  138. * for the method's return value.
  139. *
  140. * @param ctx a <code>Context</code> object containing
  141. * a list of properties
  142. * @param operation the name of the method to be invoked
  143. * @param arg_list an <code>NVList</code> containing the actual arguments
  144. * to the method being invoked
  145. * @param result a <code>NamedValue</code> object to serve as a
  146. * container for the method's return value
  147. * @return the newly-created <code>Request</code> object
  148. *
  149. * @see Request
  150. * @see NVList
  151. * @see NamedValue
  152. */
  153. Request _create_request(Context ctx,
  154. String operation,
  155. NVList arg_list,
  156. NamedValue result);
  157. /**
  158. * Creates a <code>Request</code> instance initialized with the
  159. * given context, method name, list of arguments, container
  160. * for the method's return value, list of possible exceptions,
  161. * and list of context strings needing to be resolved.
  162. *
  163. * @param ctx a <code>Context</code> object containing
  164. * a list of properties
  165. * @param operation the name of the method to be invoked
  166. * @param arg_list an <code>NVList</code> containing the actual arguments
  167. * to the method being invoked
  168. * @param result a <code>NamedValue</code> object to serve as a
  169. * container for the method's return value
  170. * @param exclist an <code>ExceptionList</code> object containing a
  171. * list of possible exceptions the method can throw
  172. * @param ctxlist a <code>ContextList</code> object containing a list of
  173. * context strings that need to be resolved and sent with the
  174. * <code>Request</code> instance
  175. * @return the newly-created <code>Request</code> object
  176. *
  177. * @see Request
  178. * @see NVList
  179. * @see NamedValue
  180. * @see ExceptionList
  181. * @see ContextList
  182. */
  183. Request _create_request(Context ctx,
  184. String operation,
  185. NVList arg_list,
  186. NamedValue result,
  187. ExceptionList exclist,
  188. ContextList ctxlist);
  189. /**
  190. * Returns the <code>Policy</code> object of the specified type
  191. * which applies to this object.
  192. *
  193. * @param policy_type the type of policy to be obtained
  194. * @return A <code>Policy</code> object of the type specified by
  195. * the policy_type parameter
  196. * @exception org.omg.CORBA.BAD_PARAM when the value of policy type
  197. * is not valid either because the specified type is not supported by this
  198. * ORB or because a policy object of that type is not associated with this
  199. * Object
  200. */
  201. Policy _get_policy(int policy_type);
  202. /**
  203. * Retrieves the <code>DomainManagers</code> of this object.
  204. * This allows administration services (and applications) to retrieve the
  205. * domain managers, and hence the security and other policies applicable
  206. * to individual objects that are members of the domain.
  207. *
  208. * @return the list of immediately enclosing domain managers of this object.
  209. * At least one domain manager is always returned in the list since by
  210. * default each object is associated with at least one domain manager at
  211. * creation.
  212. */
  213. DomainManager[] _get_domain_managers();
  214. /**
  215. * Returns a new <code>Object</code> with the given policies
  216. * either replacing any existing policies in this
  217. * <code>Object</code> or with the given policies added
  218. * to the existing ones, depending on the value of the
  219. * given <code>SetOverrideType</code> object.
  220. *
  221. * @param policies an array of <code>Policy</code> objects containing
  222. * the policies to be added or to be used as replacements
  223. * @param set_add either <code>SetOverrideType.SET_OVERRIDE</code>, indicating
  224. * that the given policies will replace any existing ones, or
  225. * <code>SetOverrideType.ADD_OVERRIDE</code>, indicating that
  226. * the given policies should be added to any existing ones
  227. * @return a new <code>Object</code> with the given policies replacing
  228. * or added to those in this <code>Object</code>
  229. */
  230. org.omg.CORBA.Object _set_policy_override(Policy[] policies,
  231. SetOverrideType set_add);
  232. }