001 /* RequestInfoOperations.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.Any; 042 import org.omg.CORBA.BAD_PARAM; 043 import org.omg.CORBA.NO_RESOURCES; 044 import org.omg.CORBA.TypeCode; 045 import org.omg.Dynamic.Parameter; 046 import org.omg.IOP.ServiceContext; 047 048 /** 049 * Defines operations that are applicable for both server and client request. 050 * The additional operations, specific to the server and client request are 051 * defined in the derived interfaces {@link ServerRequestInfoOperations} and 052 * {@link ClientRequestInfoOperations}. 053 * 054 * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) 055 */ 056 public interface RequestInfoOperations 057 { 058 /** 059 * Return the parameters of the operation being invoked. 060 * 061 * @return the array, containing parameters of the operations or an empty 062 * array for the operations with no parameters. 063 * 064 * @throws NO_RESOURCES if the parameters are not available. The parameters 065 * are only available for DII (via {@link org.omg.CORBA.Request} or DSI calls. 066 * They are not available for calls via IDL - generated stubs. 067 */ 068 Parameter[] arguments(); 069 070 /** 071 * Returns the names of all contexts of the operation being invoked. 072 * 073 * @return the array of strings, defining contexts. 074 * 075 * @throws NO_RESOURCES if the contexts are not available. The contexts are 076 * only available for DII (via {@link org.omg.CORBA.Request} or DSI calls. 077 * They are not available for calls via IDL - generated stubs. 078 */ 079 String[] contexts(); 080 081 /** 082 * Returns the typecodes, defining all exceptions that the operation may 083 * throw. 084 * 085 * @return the array of exception typecodes, empty array if the operation 086 * should not throw any exceptions. 087 * 088 * @throws NO_RESOURCES if the exception list is not available. This list is 089 * only available for DII (via {@link org.omg.CORBA.Request} or DSI calls and 090 * only on the client side. It is not available for calls via IDL - generated 091 * stubs or on the server side. 092 */ 093 TypeCode[] exceptions(); 094 095 /** 096 * If the request contains forwarding information (the reply_status attribute 097 * being LOCATION_FORWARD), return the forwarding target. 098 * 099 * @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 }