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