001    /* Object.java --
002       Copyright (C) 2005 Free Software Foundation, Inc.
003    
004    This file is part of GNU Classpath.
005    
006    GNU Classpath is free software; you can redistribute it and/or modify
007    it under the terms of the GNU General Public License as published by
008    the Free Software Foundation; either version 2, or (at your option)
009    any later version.
010    
011    GNU Classpath is distributed in the hope that it will be useful, but
012    WITHOUT ANY WARRANTY; without even the implied warranty of
013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014    General Public License for more details.
015    
016    You should have received a copy of the GNU General Public License
017    along with GNU Classpath; see the file COPYING.  If not, write to the
018    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
019    02110-1301 USA.
020    
021    Linking this library statically or dynamically with other modules is
022    making a combined work based on this library.  Thus, the terms and
023    conditions of the GNU General Public License cover the whole
024    combination.
025    
026    As a special exception, the copyright holders of this library give you
027    permission to link this library with independent modules to produce an
028    executable, regardless of the license terms of these independent
029    modules, and to copy and distribute the resulting executable under
030    terms of your choice, provided that you also meet, for each linked
031    independent module, the terms and conditions of the license of that
032    module.  An independent module is a module which is not derived from
033    or based on this library.  If you modify this library, you may extend
034    this exception to your version of the library, but you are not
035    obligated to do so.  If you do not wish to do so, delete this
036    exception statement from your version. */
037    
038    
039    package org.omg.CORBA;
040    
041    /**
042     * The CORBA object reference. The object can be either local or remote.
043     * For the local object, the methods of the derived object are called
044     * like on any other java object. For the remote object, the reference
045     * points to the stup (proxy), responsible for the remote invocation.
046     *
047     * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
048     */
049    public interface Object
050    {
051      /**
052       * Create a request to invoke the method of this object.
053       *
054       * @param context a list of additional properties.
055       * @param operation the name of method to be invoked.
056       * @param parameters the method parameters.
057       * @param returns the container for tge method returned value.
058       *
059       * @return the created reaquest.
060       */
061      Request _create_request(Context context, String operation, NVList parameters,
062                              NamedValue returns
063                             );
064    
065      /**
066       * Create a request to invoke the method of this object, specifying
067       * context list and the list of the expected exception.
068       *
069       * @param context a list of additional properties.
070       * @param operation the name of method to be invoked.
071       * @param parameters the method parameters.
072       * @param returns the container for tge method returned value.
073       * @param exceptions the list of the possible exceptions that the method
074       * can throw.
075       * @param ctx_list the list of the context strings that need to be
076       * resolved and send as a context instance.
077       *
078       * @return the created reaquest.
079       */
080      Request _create_request(Context context, String operation, NVList parameters,
081                              NamedValue returns, ExceptionList exceptions,
082                              ContextList ctx_list
083                             );
084    
085      /**
086       * Duplicate the object reference. This does not make much sense for
087       * java platform and is just included for the sake of compliance with
088       * CORBA APIs.
089       *
090       * The method may return the object reference itself.
091       *
092       * @return as a rule, <code>this</code>.
093       */
094      org.omg.CORBA.Object _duplicate();
095    
096      /**
097       * Retrieve the domain managers for this object.
098       *
099       * @return the domain managers.
100       */
101      DomainManager[] _get_domain_managers();
102    
103      /**
104       * Get the <code>InterfaceDef</code> for this Object.
105       */
106      org.omg.CORBA.Object _get_interface_def();
107    
108      /**
109       * Returns the {@link Policy}, applying to this object.
110       *
111       * @param a_policy_type a type of policy to be obtained.
112       * @return a corresponding Policy object.
113       *
114       * @throws BAD_PARAM if the policy of the given type is not
115       * associated with this object, or if it is not supported by this ORB.
116       */
117      Policy _get_policy(int a_policy_type)
118                  throws BAD_PARAM;
119    
120      /**
121       * Get the hashcode this object reference. The same hashcode still
122       * does not means that the references are the same. From the other
123       * side, two different references may still refer to the same CORBA
124       * object. The returned value must not change during the object
125       * lifetime.
126       *
127       * @param maximum the maximal value to return.
128       *
129       * @return the hashcode.
130       */
131      int _hash(int maximum);
132    
133      /**
134       * Check if this object can be referenced by the given repository id.
135       *
136       * @param repositoryIdentifer the repository id.
137       *
138       * @return true if the passed parameter is a repository id of this
139       * CORBA object.
140       */
141      boolean _is_a(String repositoryIdentifer);
142    
143      /**
144       * Return true if the other object references are equivalent, so far as
145       * it is possible to determine this easily.
146       *
147       * @param other the other object reference.
148       *
149       * @return true if both references refer the same object, false
150       * if they probably can refer different objects.
151       */
152      boolean _is_equivalent(org.omg.CORBA.Object other);
153    
154      /**
155       * Determines if the server object for this reference has already
156       * been destroyed.
157       *
158       * @return true if the object has been destroyed, false otherwise.
159       */
160      boolean _non_existent();
161    
162      /**
163       * Free resoureces, occupied by this reference. The object implementation
164       * is not notified, and the other references to the same object are not
165       * affected.
166       */
167      void _release();
168    
169      /**
170       * Create a request to invoke the method of this CORBA object.
171       *
172       * @param operation the name of the method to invoke.
173       *
174       * @return the request.
175       */
176      Request _request(String operation);
177    
178      /**
179       * Returns a new object with the new policies either replacing or
180       * extending the current policies, depending on the second parameter.
181       *
182       * @param policies the policy additions or replacements.
183       *
184       * @param how either {@link SetOverrideType#SET_OVERRIDE} to override the
185       * current policies of {@link SetOverrideType#ADD_OVERRIDE} to replace
186       * them.
187       *
188       * @return the new reference with the changed policies.
189       */
190      Object _set_policy_override(Policy[] policies, SetOverrideType how);
191    }