Source for org.omg.PortableInterceptor.ORBInitInfoOperations

   1: /* ORBInitInfoOperations.java --
   2:    Copyright (C) 2005 Free Software Foundation, Inc.
   3: 
   4: This file is part of GNU Classpath.
   5: 
   6: GNU Classpath is free software; you can redistribute it and/or modify
   7: it under the terms of the GNU General Public License as published by
   8: the Free Software Foundation; either version 2, or (at your option)
   9: any later version.
  10: 
  11: GNU Classpath is distributed in the hope that it will be useful, but
  12: WITHOUT ANY WARRANTY; without even the implied warranty of
  13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14: General Public License for more details.
  15: 
  16: You should have received a copy of the GNU General Public License
  17: along with GNU Classpath; see the file COPYING.  If not, write to the
  18: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19: 02110-1301 USA.
  20: 
  21: Linking this library statically or dynamically with other modules is
  22: making a combined work based on this library.  Thus, the terms and
  23: conditions of the GNU General Public License cover the whole
  24: combination.
  25: 
  26: As a special exception, the copyright holders of this library give you
  27: permission to link this library with independent modules to produce an
  28: executable, regardless of the license terms of these independent
  29: modules, and to copy and distribute the resulting executable under
  30: terms of your choice, provided that you also meet, for each linked
  31: independent module, the terms and conditions of the license of that
  32: module.  An independent module is a module which is not derived from
  33: or based on this library.  If you modify this library, you may extend
  34: this exception to your version of the library, but you are not
  35: obligated to do so.  If you do not wish to do so, delete this
  36: exception statement from your version. */
  37: 
  38: 
  39: package org.omg.PortableInterceptor;
  40: 
  41: import org.omg.IOP.CodecFactory;
  42: import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName;
  43: 
  44: /**
  45:  * Defines operations, applicable to {@link ORBInitInfo}. The
  46:  * {@link ORBInitInfo} is passed to the {@link ORBInitializer} that is
  47:  * reponsible for registering an {@link Interceptor}.
  48:  *
  49:  * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
  50:  */
  51: public interface ORBInitInfoOperations
  52: {
  53:   /**
  54:    * Register the client request interceptor.
  55:    *
  56:    * @param interceptor the interceptor to register.
  57:    *
  58:    * @throws DuplicateName if the interceptor name is not an empty string and an
  59:    * interceptor with this name is already registered with the ORB being
  60:    * created.
  61:    */
  62:   void add_client_request_interceptor(ClientRequestInterceptor interceptor)
  63:     throws DuplicateName;
  64: 
  65:   /**
  66:    * Register the IOR (object reference) interceptor. If the registered
  67:    * interceptor implements the extended {@link IORInterceptor_3_0} interface,
  68:    * ORB will call its additional methods, defined in the
  69:    * {@link IORInterceptor_3_0Operations}.
  70:    * 
  71:    * @param interceptor the interceptor to register.
  72:    * 
  73:    * @throws DuplicateName if the interceptor name is not an empty string and an
  74:    * interceptor with this name is already registered with the ORB being
  75:    * created.
  76:    */
  77:   void add_ior_interceptor(IORInterceptor interceptor)
  78:     throws DuplicateName;
  79: 
  80:   /**
  81:    * Register the server request interceptor.
  82:    *
  83:    * @param interceptor the interceptor to register.
  84:    *
  85:    * @throws DuplicateName if the interceptor name is not an empty string and an
  86:    * interceptor with this name is already registered with the ORB being
  87:    * created.
  88:    */
  89:   void add_server_request_interceptor(ServerRequestInterceptor interceptor)
  90:     throws DuplicateName;
  91: 
  92:   /**
  93:    * Allocate a slot on a {@link PortableInterceptor.Current}. While slots can
  94:    * be allocated by this method, they cannot be initialized.
  95:    * {@link CurrentOperations#get_slot} and {@link CurrentOperations#set_slot}
  96:    * throw {@link org.omg.CORBA.BAD_INV_ORDER} while called from the interceptor
  97:    * initializer.
  98:    *
  99:    * @return the index to the slot that has been allocated.
 100:    */
 101:   int allocate_slot_id();
 102: 
 103:   /**
 104:    * Returns the arguments passed to the ORB.init.
 105:    *
 106:    * @return the first parameter, passed to the method
 107:    * {@link org.omg.CORBA.ORB#init}.
 108:    */
 109:   String[] arguments();
 110: 
 111:   /**
 112:    * Get the CodecFactory that may be needed during the interceptor
 113:    * initialization. The method ORB.resolve_initial_references ("CodecFactory")
 114:    * cannot be used during ORB initialization.
 115:    *
 116:    * @return the CodecFactory.
 117:    */
 118:   CodecFactory codec_factory();
 119: 
 120:   /**
 121:    * Returns the ID of the ORB being initialized.
 122:    *
 123:    * @return the ORB id that differs for each new ORB being created during the
 124:    * current run of the java virtual machine.
 125:    */
 126:   String orb_id();
 127: 
 128:   /**
 129:    * Register the initial reference. The registered object will be accessible by
 130:    * the {@link ORB.resolve_initial_references} under the object_name.
 131:    *
 132:    * @param object_name the name of the object to register.
 133:    * @param object the object to register.
 134:    *
 135:    * @throws org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName if the
 136:    * name being registered is assumed to be invalid.
 137:    */
 138:   void register_initial_reference(String object_name,
 139:     org.omg.CORBA.Object object
 140:   ) throws org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName;
 141: 
 142:   /**
 143:    * Identical to {@link org.omg.CORBA.ORB#resolve_initial_references}.
 144:    *
 145:    * This method can only be called from
 146:    * {@link ORBInitializerOperations#post_init} and not during
 147:    * {@link ORBInitializerOperations#pre_init}.
 148:    *
 149:    * @param object_name the name of the object to search.
 150:    *
 151:    * @return the object, accessible by the given name.
 152:    *
 153:    * @throws org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName if the
 154:    * given name is not associated with the known object.
 155:    *
 156:    * @see org.omg.CORBA.ORB#resolve_initial_references
 157:    */
 158:   org.omg.CORBA.Object resolve_initial_references(String object_name)
 159:     throws org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName;
 160: 
 161:   /**
 162:    * Registers a PolicyFactory for the given PolicyType.
 163:    *
 164:    * @param policy_type the type of policy for that the factory is being
 165:    * registered.
 166:    * @param policy_factory the policy factory to register.
 167:    *
 168:    * @throws BAD_INV_ORDER minor 16 if the policy of the given type already has
 169:    * the registered factory in this ORB.
 170:    */
 171:   void register_policy_factory(int policy_type, PolicyFactory policy_factory);