Source for org.omg.PortableInterceptor.RequestInfoOperations

   1: /* RequestInfoOperations.java --
   2:    Copyright (C) 2005, 2006 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.CORBA.Any;
  42: import org.omg.CORBA.BAD_PARAM;
  43: import org.omg.CORBA.NO_RESOURCES;
  44: import org.omg.CORBA.TypeCode;
  45: import org.omg.Dynamic.Parameter;
  46: import org.omg.IOP.ServiceContext;
  47: 
  48: /**
  49:  * Defines operations that are applicable for both server and client request.
  50:  * The additional operations, specific to the server and client request are
  51:  * defined in the derived interfaces {@link ServerRequestInfoOperations} and
  52:  * {@link ClientRequestInfoOperations}.
  53:  *
  54:  * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
  55:  */
  56: public interface RequestInfoOperations
  57: {
  58:   /**
  59:    * Return the parameters of the operation being invoked.
  60:    *
  61:    * @return the array, containing parameters of the operations or an empty
  62:    * array for the operations with no parameters.
  63:    *
  64:    * @throws NO_RESOURCES if the parameters are not available. The parameters
  65:        * are only available for DII (via {@link org.omg.CORBA.Request} or DSI calls.
  66:    * They are not available for calls via IDL - generated stubs.
  67:    */
  68:   Parameter[] arguments();
  69: 
  70:   /**
  71:    * Returns the names of all contexts of the operation being invoked.
  72:    *
  73:    * @return the array of strings, defining contexts.
  74:    *
  75:    * @throws NO_RESOURCES if the contexts are not available. The contexts are
  76:    * only available for DII (via {@link org.omg.CORBA.Request} or DSI calls.
  77:    * They are not available for calls via IDL - generated stubs.
  78:    */
  79:   String[] contexts();
  80: 
  81:   /**
  82:    * Returns the typecodes, defining all exceptions that the operation may
  83:    * throw.
  84:    *
  85:    * @return the array of exception typecodes, empty array if the operation
  86:    * should not throw any exceptions.
  87:    *
  88:    * @throws NO_RESOURCES if the exception list is not available. This list is
  89:    * only available for DII (via {@link org.omg.CORBA.Request} or DSI calls and
  90:    * only on the client side. It is not available for calls via IDL - generated
  91:    * stubs or on the server side.
  92:    */
  93:   TypeCode[] exceptions();
  94: 
  95:   /**
  96:    * If the request contains forwarding information (the reply_status attribute
  97:    * being LOCATION_FORWARD), return the forwarding target.
  98:    *
  99:    * @return the object where the request should be forwarded.
 100:    */
 101:   org.omg.CORBA.Object forward_reference();
 102: 
 103:   /**
 104:        * Get the service context with the given ctx_name that is associated with the
 105:    * reply.
 106:    *
 107:    * @param ctx_name the name of the service context
 108:    *
 109:    * @return the copy of the corresponding context.
 110:    *
 111:    * @throws BAD_PARAM minor 26, if the context with the give ctx_name does not
 112:    * exist.
 113:    */
 114:   ServiceContext get_reply_service_context(int ctx_name)
 115:     throws BAD_PARAM;
 116: 
 117:   /**
 118:        * Get the service context with the given ctx_name that is associated with the
 119:    * request.
 120:    *
 121:    * @param ctx_name the name of the service context
 122:    *
 123:    * @return the copy of the corresponding context.
 124:    *
 125:    * @throws BAD_PARAM minor 26, if the context with the give ctx_name does not
 126:    * exist.
 127:    */
 128:   ServiceContext get_request_service_context(int ctx_name)
 129:     throws BAD_PARAM;
 130: 
 131:   /**
 132:        * Get the data from the given slot of the PortableInterceptor.Current that is
 133:    * in the scope of the request.
 134:    */
 135:   Any get_slot(int id) throws InvalidSlot;
 136: 
 137:   /**
 138:    * Get the names of the service contexts being sent on the request.
 139:    *
 140:    * @return array of strings, naming the contexts.
 141:    */
 142:   String[] operation_context();
 143: 
 144:   /**
 145:    * Get the name of the operation being invoked.
 146:    *
 147:        * @return the name of the operation, usually the name of method being called.
 148:    */
 149:   String operation();
 150: 
 151:   /**
 152:    * Get the reoly state as result of the operation invocation.
 153:    *
 154:    * @return the value field of one of the following: {@link SUCCESSFUL},
 155:    * {@link SYSTEM_EXCEPTION}, {@link USER_EXCEPTION},
 156:    * {@link LOCATION_FORWARD} or {@link TRANSPORT_RETRY}.
 157:    */
 158:   short reply_status();
 159: 
 160:   /**
 161:    * Get the request id.
 162:    *
 163:    * @return an id that uniquely identifies the current request/reply sequence.
 164:    */
 165:   int request_id();
 166: 
 167:   /**
 168:    * Indicates whether request sender expected any response.
 169:    *
 170:    * @return true if the response was expected, false otherwise.
 171:    */
 172:   boolean response_expected();
 173: 
 174:   /**
 175:    * Get the result of the operation invocation.
 176:    *
 177:    * @return an Any, containing the value, returned by the performed operation.
 178:    */
 179:   Any result();
 180: 
 181:   /**
 182:        * Determines how far the request shall progress before control is returned to
 183:    * the client. However up till JDK 1.5 inclusive this method always returns
 184:    * SYNC_WITH_TRANSPORT.
 185:    *
 186:    * @return {@link org.omg.Messaging.SYNC_WITH_TRANSPORT#value} (1), always.
 187:    *
 188:    * @specnote as defined in the Suns 1.5 JDK API.
 189:    */
 190:   short sync_scope();
 191: }