001    /* ORBInitInfoOperations.java --
002       Copyright (C) 2005, 2006 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.PortableInterceptor;
040    
041    import org.omg.CORBA.BAD_INV_ORDER;
042    import org.omg.CORBA.ORB;
043    import org.omg.IOP.CodecFactory;
044    import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName;
045    
046    /**
047     * Defines operations, applicable to {@link ORBInitInfo}. The
048     * {@link ORBInitInfo} is passed to the {@link ORBInitializer} that is
049     * reponsible for registering an {@link Interceptor}.
050     *
051     * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
052     */
053    public interface ORBInitInfoOperations
054    {
055      /**
056       * Register the client request interceptor.
057       *
058       * @param interceptor the interceptor to register.
059       *
060       * @throws DuplicateName if the interceptor name is not an empty string and an
061       * interceptor with this name is already registered with the ORB being
062       * created.
063       */
064      void add_client_request_interceptor(ClientRequestInterceptor interceptor)
065        throws DuplicateName;
066    
067      /**
068       * Register the IOR (object reference) interceptor. If the registered
069       * interceptor implements the extended {@link IORInterceptor_3_0} interface,
070       * ORB will call its additional methods, defined in the
071       * {@link IORInterceptor_3_0Operations}.
072       * 
073       * @param interceptor the interceptor to register.
074       * 
075       * @throws DuplicateName if the interceptor name is not an empty string and an
076       * interceptor with this name is already registered with the ORB being
077       * created.
078       */
079      void add_ior_interceptor(IORInterceptor interceptor)
080        throws DuplicateName;
081    
082      /**
083       * Register the server request interceptor.
084       *
085       * @param interceptor the interceptor to register.
086       *
087       * @throws DuplicateName if the interceptor name is not an empty string and an
088       * interceptor with this name is already registered with the ORB being
089       * created.
090       */
091      void add_server_request_interceptor(ServerRequestInterceptor interceptor)
092        throws DuplicateName;
093    
094      /**
095       * Allocate a slot on a {@link Current} of this interceptor. While slots can
096       * be allocated by this method, they cannot be initialized.
097       * {@link CurrentOperations#get_slot} and {@link CurrentOperations#set_slot}
098       * throw {@link org.omg.CORBA.BAD_INV_ORDER} while called from the interceptor
099       * initializer.
100       *
101       * @return the index to the slot that has been allocated.
102       */
103      int allocate_slot_id();
104    
105      /**
106       * Returns the arguments passed to the ORB.init.
107       *
108       * @return the first parameter, passed to the methods from the group
109       * org.omg.CORBA.ORB#init(String[], ...).
110       */
111      String[] arguments();
112    
113      /**
114       * Get the CodecFactory that may be needed during the interceptor
115       * initialization. The method ORB.resolve_initial_references ("CodecFactory")
116       * cannot be used during ORB initialization.
117       *
118       * @return the CodecFactory.
119       */
120      CodecFactory codec_factory();
121    
122      /**
123       * Returns the ID of the ORB being initialized.
124       *
125       * @return the ORB id that differs for each new ORB being created during the
126       * current run of the java virtual machine.
127       */
128      String orb_id();
129    
130      /**
131       * Register the initial reference. The registered object will be accessible by
132       * the {@link ORB#resolve_initial_references} under the object_name.
133       *
134       * @param object_name the name of the object to register.
135       * @param object the object to register.
136       *
137       * @throws org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName if the
138       * name being registered is assumed to be invalid.
139       */
140      void register_initial_reference(String object_name,
141        org.omg.CORBA.Object object
142      ) throws org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName;
143    
144      /**
145       * Identical to {@link org.omg.CORBA.ORB#resolve_initial_references}.
146       *
147       * This method can only be called from
148       * {@link ORBInitializerOperations#post_init} and not during
149       * {@link ORBInitializerOperations#pre_init}.
150       *
151       * @param object_name the name of the object to search.
152       *
153       * @return the object, accessible by the given name.
154       *
155       * @throws org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName if the
156       * given name is not associated with the known object.
157       *
158       * @see org.omg.CORBA.ORB#resolve_initial_references
159       */
160      org.omg.CORBA.Object resolve_initial_references(String object_name)
161        throws org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName;
162    
163      /**
164       * Registers a PolicyFactory for the given PolicyType.
165       *
166       * @param policy_type the type of policy for that the factory is being
167       * registered.
168       * @param policy_factory the policy factory to register.
169       *
170       * @throws BAD_INV_ORDER minor 16 if the policy of the given type already has
171       * the registered factory in this ORB.
172       */
173      void register_policy_factory(int policy_type, PolicyFactory policy_factory);
174    }