Source for org.omg.PortableInterceptor.RequestInfoOperations

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