diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-23 19:36:46 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-23 19:36:46 +0000 |
| commit | 49792907376493f0939563eb0219b96a48f1ae3b (patch) | |
| tree | b2c2abf473309eac532cafbad81b20f3270ff45f /libjava/classpath/org/omg/PortableInterceptor | |
| parent | 68cf394a99ed232a528346d711e946d4c9a902b5 (diff) | |
| download | ppe42-gcc-49792907376493f0939563eb0219b96a48f1ae3b.tar.gz ppe42-gcc-49792907376493f0939563eb0219b96a48f1ae3b.zip | |
Initial revision
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104578 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/org/omg/PortableInterceptor')
30 files changed, 3161 insertions, 0 deletions
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfo.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfo.java new file mode 100644 index 00000000000..dd3cd5808f3 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfo.java @@ -0,0 +1,54 @@ +/* ClientRequestInfo.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * Provides request information, accessible for the + * {@link ClientRequestInterceptor}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ClientRequestInfo extends ClientRequestInfoOperations, + org.omg.CORBA.Object, + IDLEntity, + RequestInfo +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java new file mode 100644 index 00000000000..73efa122f2e --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java @@ -0,0 +1,328 @@ +/* ClientRequestInfoOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.INV_POLICY; +import org.omg.CORBA.Policy; +import org.omg.IOP.ServiceContext; +import org.omg.IOP.TaggedComponent; +import org.omg.IOP.TaggedProfile; + +/** + * Provides request information, accessible for the + * {@linkplain ClientRequestInterceptor}. Some methods of this interface are + * not valid at all interception points. The following table shows the validity + * of each method. If it is not valid, BAD_INV_ORDER minor 14 will be thrown. + * + * <table border="1"> + * <tr> + * <th></th> + * <th>{@linkplain ClientRequestInterceptorOperations#send_request send_request}</th> + * <th>{@linkplain ClientRequestInterceptorOperations#send_poll send_poll}</th> + * <th>{@linkplain ClientRequestInterceptorOperations#receive_reply receive_reply}</th> + * <th>{@linkplain ClientRequestInterceptorOperations#receive_exception receive_exception}</th> + * <th>{@linkplain ClientRequestInterceptorOperations#receive_other receive_other}</th> + * </tr> + * <tr> + * <td colspan="6" align="center" bgcolor="#E0E0FF"><i>Inherited from + * {@linkplain RequestInfoOperations}:</i></td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#arguments arguments}</th> + * <td bgcolor="#E0E0E0" title="in and inout only">yes <sub><a href="#1">1</a></sub></td> + * <td bgcolor="lightgray">no </td> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td bgcolor="lightgray">no </td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#exceptions exceptions}</th> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#contexts contexts}</th> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#operation_context operation_context}</th> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align ="center">yes</td> + * </tr> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#result result}</th> + * <td bgcolor="lightgray">no </td> + * <td bgcolor="lightgray">no </td> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td bgcolor="lightgray">no </td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#sync_scope sync_scope}</th> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align ="center">yes</td> + * </tr> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#reply_status reply_status}</th> + * <td bgcolor="lightgray">no </td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#forward_reference forward_reference}</th> + * <td>no</td> + * <td bgcolor="lightgray" colspan="3" align="center">no</td> + * <td bgcolor="#E0E0E0" title="When reply_status = LOCATION_FORWARD">yes <sub><a + * href="#2">2</a></sub> </td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#get_request_service_context get_request_service_context}</th> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#get_reply_service_context get_reply_service_context}</th> + * <td bgcolor="lightgray">no </td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align ="center">yes</td> + * </tr> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#request_id request_id}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#operation operation}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#response_expected response_expected}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#get_slot get_slot}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <td colspan="6" align="center" bgcolor="#E0E0FF"><i>ClientRequestInfo-specific:</i></td> + * </tr> + * <tr> + * <th>{@linkplain #target target}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain #effective_target effective_target}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain #effective_profile effective_profile}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain #received_exception received_exception}</th> + * <td bgcolor="lightgray" colspan="3" align="center">no</td> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * </tr> + * <tr> + * <th>{@linkplain #received_exception_id received_exception_id}</th> + * <td bgcolor="lightgray" colspan="3" align="center">no</td> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * </tr> + * <tr> + * <th>{@linkplain #get_effective_component get_effective_component}</th> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain #get_effective_components get_effective_components}</th> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain #get_request_policy get_request_policy}</th> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain #add_request_service_context add_request_service_context}</th> + * <td>yes</td> + * <td bgcolor="lightgray" colspan="4" align="center">no</td> + * </tr> + * <tr> + * <th></th> + * <th>{@linkplain ClientRequestInterceptorOperations#send_request send_request}</th> + * <th>{@linkplain ClientRequestInterceptorOperations#send_poll send_poll}</th> + * <th>{@linkplain ClientRequestInterceptorOperations#receive_reply receive_reply}</th> + * <th>{@linkplain ClientRequestInterceptorOperations#receive_exception receive_exception}</th> + * <th>{@linkplain ClientRequestInterceptorOperations#receive_other receive_other}</th> + * </tr> + * </table> + * <ol> + * <li><a name="1">When ClientRequestInfo is passed to send_request, there is + * an entry in the list for every argument, but only the in and inout arguments + * will be available.</a></li> + * <li><a name="2">If the reply_status atribute is not LOCATION_FORWARD, + * accessing this attribute will throw BAD_INV_ORDER with a standard minor code + * of 14.</a></li> + * </ol> + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ClientRequestInfoOperations extends RequestInfoOperations +{ + /** + * Returns the object on that the client has invoked the the operation. If the + * request was forwarded, it will not be the same object that actually + * processed the request. + * + * @return the initial client invocation target. + * + * @see #effective_target() + */ + org.omg.CORBA.Object target(); + + /** + * Returns the object on that the operation will be invoked after handling the + * possible forwarding. + * + * @return the final invocation target. + * + * @see #target() + */ + org.omg.CORBA.Object effective_target(); + + /** + * Returns the tagged profile (IOR) of the invocation target. If the request + * was forwarded, the method returns the new location, shown by the forwarding + * message. + * + * @return the invocation IOR. + */ + TaggedProfile effective_profile(); + + /** + * Returns the given component of the invocation target profile. If the + * profile contains multiple components with the same Id, it is not defined, + * which one will be returned. + * + * @param id the component id. + * + * @return the profile component with the given Id. + * + * @throws BAD_PARAM minor 28 in there are no any components with the given Id + * in the profile. + */ + TaggedComponent get_effective_component(int id) throws BAD_PARAM; + + /** + * Returns the given components of the invocation target profile. This method + * is uses when the profile may contain multiple components with the same Id. + * + * @param id the component id. + * + * @return the array of all profile components with the given Id. + * + * @throws BAD_PARAM minor 28 in there are no any components with the given Id + * in the profile. + */ + TaggedComponent[] get_effective_components(int id) throws BAD_PARAM; + + /** + * This should return the policy of the given type that applies to this + * operation, but it is not implemented up till JDK 1.5 inclusive. + * + * @param type the type of the policy being requested. + * + * @return should return the policy that applies to this operation. + * + * @throws NO_IMPLEMENT always. + */ + Policy get_request_policy(int type) throws INV_POLICY; + + /** + * Returns the repository id of the remote exception that was thrown on the + * server side. + * + * @return the exception repository id. + * + * @see #received_exception() + */ + String received_exception_id(); + + /** + * Returns the remote exception that was thrown on the server side. + * + * @return the Any, holding this exception. + * + * @see #received_exception_id() + */ + Any received_exception(); + + /** + * Allows the interceptor to add the service contexts to the request. Such + * added contexts can carry arbitrary data and can be later accessed on the + * server side by the server request interceptor, using + * {@link RequestInfoOperations#get_request_service_context}. + * + * @param service_context the context to add. + * @param replace if true, the existing context with the same Id will be + * replaced. If false, the BAD_INV_ORDER will be thrown in that case. + * + * @throws BAD_INV_ORDER minor 15 if the context with the same Id already + * exists and replace=false. + */ + void add_request_service_context(ServiceContext service_context, + boolean replace + ); +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptor.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptor.java new file mode 100644 index 00000000000..9fdf2f12065 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptor.java @@ -0,0 +1,54 @@ +/* ClientRequestInterceptor.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * A client side request interceptor that is notified on various request + * processing steps on a client side. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ClientRequestInterceptor extends Interceptor, + ClientRequestInterceptorOperations, + org.omg.CORBA.Object, + IDLEntity +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java new file mode 100644 index 00000000000..4a60b77f5d1 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java @@ -0,0 +1,128 @@ +/* ClientRequestInterceptorOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + + +/** + * Defines operations, applicable to the client side request interceptor. The + * operations are called by ORB at the appropriate interception points. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ClientRequestInterceptorOperations + extends InterceptorOperations +{ + /** + * ORB calls this method before sending the request to the server. + * + * @param info the object for accessing and manipulating the request + * information. + * + * @throws SystemException if it does, the send_request is not called for the + * subsequent interceptors, calling receive_exception instead. The completion + * status of this exception must be COMPLETED_NO. + * + * @throws ForwardRequest to forward the invocation to another target. The + * send_request is not called for the subsequent interceptors, calling + * receive_other instead. + */ + void send_request(ClientRequestInfo info) throws ForwardRequest; + + /** + * ORB calls this method after the normal reply is received from the server + * and before the control is returned to the calling client code. + * + * @param info the object for accessing and manipulating the request + * information. + * + * @throws SystemException if it does, the receive_reply is not called for the + * subsequent interceptors, calling receive_exception instead. The completion + * status of this exception must be COMPLETED_YES. + */ + void receive_reply(ClientRequestInfo info); + + /** + * ORB calls this method after the receiving the message that a remote + * exception has been thrown on a server side and before raising this + * exception in the client side. + * + * @param info the object for accessing and manipulating the request + * information. + * + * @throws SystemException has the effect of changing the exception that + * successive interceptors receive on their calls to receive_other. If the + * original exception is a system exception, the completion_status of the new + * exception must match the exception being replaced. If the original + * exception is a user exception, then the completion_status of the new + * exception must be COMPLETED_YES. + * + * @throws ForwardRequest to forward the invocation to another target. The + * receive_exception is not called for the subsequent interceptors, calling + * receive_other instead. If the completion_status of the original exception + * is not a COMPLETED_NO, the ForwardRequest must not be raised. + */ + void receive_exception(ClientRequestInfo info) throws ForwardRequest; + + /** + * /** ORB normally calls this method after receiving the forwarding message. + * + * @param info the object for accessing and manipulating the request + * information. + * + * @throws SystemException if it does, the receive_other is not called for the + * subsequent interceptors, calling receive_exception instead. + * + * @throws ForwardRequest has the effect of changing the redirection that + * successive interceptors receive on their calls to receive_other. + */ + void receive_other(ClientRequestInfo info) throws ForwardRequest; + + /** + * This method is called by if ORB uses the Time- Independent Invocation (TII) + * polling. + * + * @param info the object for accessing and manipulating the request + * information. + * + * @throws SystemException if it does, the send_poll is not called for the + * subsequent interceptors, calling receive_exception instead. The completion + * status of this exception must be COMPLETED_NO. + */ + void send_poll(ClientRequestInfo info); +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/Current.java b/libjava/classpath/org/omg/PortableInterceptor/Current.java new file mode 100644 index 00000000000..d53d5c33a79 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/Current.java @@ -0,0 +1,85 @@ +/* Current.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * <p> + * The portable interceptor Current (PICurrent) contains multiple slots where an + * interceptor can rememeber the request - specific values between subsequent + * calls of the interceptor methods. In multithreaded environment, it is not + * possible just to store such data in the interceptor object fields. + * </p> + * <p> + * On the client side, it is possible to set the initial slot values by + * modifying slots on the Current, returend by ORB.resolve_initial_references + * ("PICurrent"). The returned value is narrowed with the + * {@link CurrentHelper#narrow}. On the subsequent invocation, made from the + * same thread, the interceptors will see the initial slot values as they were + * set using this approach. + * </p> + * <p> + * There are no way to set the initial values for the server side interceptors, + * the default values (Any with typecode TCKind.tk_null) should be always + * assumed. + * </p> + * <p> + * Since an Interceptor is running in a thread, it is running with a thread + * context and there is a PICurrent on that context. If the Interceptor calls + * ORB.resolve_initial_references ("PICurrent"), it gets the PICurrent within + * its thread scope. This PICurrent is different than the request scope + * PICurrent that the Interceptor obtains via calls to the Client- or Server- + * RequestInfo object. + * </p> + * <p> + * On the client side the PICurrent can be used to detect the recursive + * invocations, performed by interceptors. If one of the interceptors makes call + * via the same ORB, this call is then showed to all interceptors, including the + * interceptor that made it. To avoid infinite recursion, the during each call + * this interceptor can set some "recursion flag" into one of the slots of the + * PICurrent. If the flag is set on the entry point, this indicates a recursive + * call of that request. + * </p> + */ +public interface Current extends CurrentOperations, + org.omg.CORBA.Current, + IDLEntity +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java b/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java new file mode 100644 index 00000000000..b7a5a541e93 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java @@ -0,0 +1,150 @@ +/* CurrentHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the CORBA object {@link Current}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class CurrentHelper +{ + /** + * The cached {@link Current} typecode, computed once. + */ + private static TypeCode typeCode; + + /** + * Get the type code of the {@link Current}. + */ + public static TypeCode type() + { + if (typeCode == null) + { + typeCode = ORB.init().create_interface_tc(id(), "Current"); + } + return typeCode; + } + + /** + * Insert the Current into the given Any. + * + * @param any the Any to insert into. + * @param that the Current to insert. + */ + public static void insert(Any any, Current that) + { + any.insert_Object(that); + } + + /** + * Extract the Current from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain Current. + */ + public static Current extract(Any any) + { + return narrow(any.extract_Object()); + } + + /** + * Get the Current repository id. + * + * @return "org.omg.PortableInterceptor.CurrentOperations", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/Current:1.0"; + } + + /** + * Cast the passed object into the Current. + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a Current. + */ + public static Current narrow(org.omg.CORBA.Object obj) + { + if (obj == null) + { + return null; + } + else if (obj instanceof Current) + { + return (Current) obj; + } + else + { + throw new BAD_PARAM("Not a Current"); + } + } + + /** + * Not supported for compatibility reasons. + * + * @specnote Not supported by Sun at least till jdk 1.5 inclusive. + * + * @throws MARSHAL always. + */ + public static Current read(InputStream input) + { + throw new MARSHAL(); + } + + /** + * Not supported for compatibility reasons. + * + * @specnote Not supported by Sun at least till jdk 1.5 inclusive. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, Current value) + { + throw new MARSHAL(); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/CurrentOperations.java b/libjava/classpath/org/omg/PortableInterceptor/CurrentOperations.java new file mode 100644 index 00000000000..63515678e38 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/CurrentOperations.java @@ -0,0 +1,87 @@ +/* CurrentOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_INV_ORDER; + +/** + * Defines the operations, applicable to the portable interceptor Current. + * + * Portable Interceptors Current (also known as PICurrent) is a slot table. Each + * slot has an integer identifier, can hold a CORBA {@link Any} and is used by + * some service to transfer data between thread and request contexts. Each + * service which wishes to use PICurrent reserves a slot or slots at + * initialization time and uses those slots during the processing of requests + * and replies. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface CurrentOperations + extends org.omg.CORBA.CurrentOperations +{ + /** + * Get data from the slot with the given slot_id. + * + * @param slot_id the slot slot_id. + * + * @return the Any that was stored in the slot. If the given slot has not been + * set, the returned Any contains a type code with a TCKind value of tk_null + * and has no value. + * + * @throws InvalidSlot for the unknown slot. + * @throws BAD_INV_ORDER minor 10 if called from the {@link ORBInitializer} + * methods. + */ + Any get_slot(int slot_id) throws InvalidSlot, BAD_INV_ORDER; + + /** + * Sets data for the slot with the given slot_id. + * + * @param slot_id the slot slot_id. + * + * @param data the Any that will be stored into the slot. + * + * @throws InvalidSlot for the unknown slot. + * @throws BAD_INV_ORDER minor 10 if called from the {@link ORBInitializer} + * methods. + * + */ + void set_slot(int slot_id, Any data) throws InvalidSlot, BAD_INV_ORDER; +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ForwardRequest.java b/libjava/classpath/org/omg/PortableInterceptor/ForwardRequest.java new file mode 100644 index 00000000000..7e7d7a3f4b3 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ForwardRequest.java @@ -0,0 +1,97 @@ +/* ForwardRequest.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * The ForwardRequest is thrown by interceptors to forward the request to + * another target. The field {@link #forward} contains the reference to this + * alternative location. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class ForwardRequest extends UserException implements IDLEntity, + Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 2128007517550526397L; + + /** + * The field forward. + */ + public org.omg.CORBA.Object forward; + + /** + * Create ForwardRequest with no explaining + * message and all fields left unitialised with the default initial java values. + */ + public ForwardRequest() + { + } + + /** + * Create the ForwardRequest with explaining + * message and all fields initialised to the given values. + * + * @param why a string, explaining, why this exception has been thrown. + * @param a_forward a value for forward. + */ + public ForwardRequest(String why, org.omg.CORBA.Object a_forward) + { + super(why); + this.forward = a_forward; + } + + /** + * Create the ForwardRequest without explaining + * message and all fields initialised to the given values. + * + * @param a_forward a value for forward. + */ + public ForwardRequest(org.omg.CORBA.Object a_forward) + { + this.forward = a_forward; + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ForwardRequestHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ForwardRequestHelper.java new file mode 100644 index 00000000000..11d6b7f0fd6 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ForwardRequestHelper.java @@ -0,0 +1,152 @@ +/* ForwardRequestHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import gnu.CORBA.Interceptor.ForwardRequestHolder; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.ObjectHelper; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link ForwardRequest}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ForwardRequestHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the ForwardRequest typecode (structure, named "ForwardRequest"). The + * typecode states that the structure contains the following fields: forward. + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = ORB.init(); + StructMember[] members = new StructMember[ 1 ]; + + TypeCode field = ObjectHelper.type(); + members [ 0 ] = new StructMember("forward", field, null); + typeCode = orb.create_exception_tc(id(), "ForwardRequest", members); + } + return typeCode; + } + + /** + * Insert the ForwardRequest into the given Any. This method uses the + * ForwardRequestHolder. + * + * @param any the Any to insert into. + * @param that the ForwardRequest to insert. + */ + public static void insert(Any any, ForwardRequest that) + { + any.insert_Streamable(new ForwardRequestHolder(that)); + } + + /** + * Extract the ForwardRequest from given Any. This method uses the + * ForwardRequestHolder. + * + * @throws BAD_OPERATION if the passed Any does not contain ForwardRequest. + */ + public static ForwardRequest extract(Any any) + { + try + { + return ((ForwardRequestHolder) any.extract_Streamable()).value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION(id() + " expected"); + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the ForwardRequest repository id. + * + * @return "IDL:omg.org/PortableInterceptor/ForwardRequest:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ForwardRequest:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static ForwardRequest read(InputStream input) + { + // Read (and discard) the exception repository id. + input.read_string(); + + ForwardRequest value = new ForwardRequest(); + + value.forward = input.read_Object(); + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, ForwardRequest value) + { + // Write the exception repository id. + output.write_string(id()); + output.write_Object(value.forward); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInfo.java b/libjava/classpath/org/omg/PortableInterceptor/IORInfo.java new file mode 100644 index 00000000000..9495d79ecec --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInfo.java @@ -0,0 +1,58 @@ +/* IORInfo.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Provides the server-side ORB service possibility to add components to the new + * IOR being created. Also, provides access to policies, applicable to the + * object, referenced by that IOR. The ORB passes an instance of IORInfo as a + * parameter to {@link IORInterceptor#establish_components}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IORInfo extends IORInfoOperations, + IDLEntity, + org.omg.CORBA.Object, + Serializable +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/IORInfoOperations.java new file mode 100644 index 00000000000..58ef02fb0c0 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInfoOperations.java @@ -0,0 +1,88 @@ +/* IORInfoOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Policy; +import org.omg.IOP.TaggedComponent; + +/** + * The ORB service uses this interface to add the service specific components to + * the new IOR being constructed. The interface provides also possibility to get + * the POA policies the apply to the IOR being constructed. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IORInfoOperations +{ + /** + * Adds a service-specific component to the IOR profile being constructed. + * + * @param tagged_component a tagged component being added. + * + * @param profile_id the IOR profile to that the component must be added. + * The 0 value ({@link org.omg.IOP.TAG_INTERNET_IOP#value}) adds to the + * Internet profile where host and port are stored by default. + */ + void add_ior_component_to_profile(TaggedComponent tagged_component, + int profile_id + ); + + /** + * Adds a service-specific component to the IOR profile being constructed. + * The specified component will be included in all profiles, present in the + * IOR being constructed. + * + * @param tagged_component a tagged component being added. + */ + void add_ior_component(TaggedComponent tagged_component); + + /** + * Get the server side policy for an IOR being constructed. The method returns + * policies applying for POA where the object, represented by this IOR, is + * connected. + * + * @param policy_type the type of the policy. + * + * @return the policy of the given type that applies to the IOR being + * constructed. + * + * @see org.omg.PortableServer.POAOperations#create_POA + */ + Policy get_effective_policy(int policy_type); +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor.java new file mode 100644 index 00000000000..e78fbf2c32b --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor.java @@ -0,0 +1,61 @@ +/* IORInterceptor.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * An ORB service implementation may need to add information describing the + * serverORB service related capabilities to object references + * (IORs). This is supported through the IORInterceptor and {@link IORInfo} + * interfaces. The IOR Interceptor is used to establish tagged components in the + * profiles within a new IOR being created. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IORInterceptor extends IDLEntity, + Interceptor, + InterceptorOperations, + IORInterceptorOperations, + org.omg.CORBA.Object, + Serializable +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptorOperations.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptorOperations.java new file mode 100644 index 00000000000..868fcab6c62 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptorOperations.java @@ -0,0 +1,58 @@ +/* IORInterceptorOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + + +/** + * Defines operation, applicable to the IORInterceptor. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IORInterceptorOperations extends InterceptorOperations +{ + /** + * A server side ORB calls this method on all registered IORInterceptor's when + * creating the object reference (IOR). The interceptors have the possibility + * to add additional tags to the IOR being created. + * + * @param info the interface class providing methods to insert additional tags + * into IOR being constructed. The same instan + */ + public void establish_components(IORInfo info); +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/Interceptor.java b/libjava/classpath/org/omg/PortableInterceptor/Interceptor.java new file mode 100644 index 00000000000..8ec375c9a7d --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/Interceptor.java @@ -0,0 +1,58 @@ +/* Interceptor.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Object; +import org.omg.CORBA.portable.IDLEntity; + +/** + * Portable Interceptors are hooks into the ORB through which ORB services can + * intercept the normal flow of execution in creation of IOR, sending request, + * receiving request and returning the reply. + * + * See {@link ORBInitializer} for explanation, how the interceptors are + * registered within the ORB. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface Interceptor extends InterceptorOperations, + Object, + IDLEntity +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/InterceptorOperations.java b/libjava/classpath/org/omg/PortableInterceptor/InterceptorOperations.java new file mode 100644 index 00000000000..da08c90dbfd --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/InterceptorOperations.java @@ -0,0 +1,77 @@ +/* InterceptorOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + + +/** + * Defines operations, applicable for all types of {@link Interceptor}. + * The the derived interfaces define additional operations for they + * specific functionality. + * + * Portable Interceptors are hooks into the ORB through which ORB services can + * intercept the normal flow of execution in creation of IOR, sending request, + * receiving request and returning the reply. + * + * See {@link org.omg.PortableInterceptor} for more details about the possible + * interceptors and how to register them within the ORB. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface InterceptorOperations +{ + /** + * This method is called when orb is being destroyed and destroys + * the interceptor. The ORB calls this method after completing all + * incoming requests. The method body should not invoke methods on other + * object, belonging to ORB being destoryed, as in this stage it is no + * longer capable to act as server. It is still, however, capable + * to act as a client, permitting remote invocations on other objects. + */ + void destroy(); + + /** + * All interceptors of the same type, registered on the single ORB, must + * either have different names or be anonymous. The name of the anonymous + * interceptor is an empty string. The ORB supports multiple anonymous + * interceptors of the same type. + * + * @return the name of the interceptor. + */ + String name(); +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/InvalidSlot.java b/libjava/classpath/org/omg/PortableInterceptor/InvalidSlot.java new file mode 100644 index 00000000000..72805cf72cf --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/InvalidSlot.java @@ -0,0 +1,76 @@ +/* InvalidSlot.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * The InvalidSlot is thrown when the slot identifier, passed in one of the + * methods, related to {@link Current}, does not define a valid slot. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class InvalidSlot extends UserException implements IDLEntity, + Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 2471643293291821501L; + + /** + * Create InvalidSlot with no explaining message. + */ + public InvalidSlot() + { + } + + /** + * Create the InvalidSlot with explaining message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public InvalidSlot(String why) + { + super(why); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/InvalidSlotHelper.java b/libjava/classpath/org/omg/PortableInterceptor/InvalidSlotHelper.java new file mode 100644 index 00000000000..c0aa0ee1bb4 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/InvalidSlotHelper.java @@ -0,0 +1,149 @@ +/* InvalidSlotHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import gnu.CORBA.EmptyExceptionHolder; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link InvalidSlot}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class InvalidSlotHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the InvalidSlot typecode (structure, named "InvalidSlot"). + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = ORB.init(); + StructMember[] members = new StructMember[ 0 ]; + typeCode = orb.create_exception_tc(id(), "InvalidSlot", members); + } + return typeCode; + } + + /* + * Every user exception with no user defined fields can use + * EmptyExceptionHolder + */ + + /** + * Insert the InvalidSlot into the given Any. + * + * @param any the Any to insert into. + * @param that the InvalidSlot to insert. + */ + public static void insert(Any any, InvalidSlot that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the InvalidSlot from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain InvalidSlot. + */ + public static InvalidSlot extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (InvalidSlot) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("InvalidSlot expected"); + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the InvalidSlot repository id. + * + * @return "IDL:omg.org/PortableInterceptor/InvalidSlot:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/InvalidSlot:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static InvalidSlot read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + InvalidSlot value = new InvalidSlot(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, InvalidSlot value) + { + // Write the exception repository id. + output.write_string(id()); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfo.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfo.java new file mode 100644 index 00000000000..d13dacdd6f4 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfo.java @@ -0,0 +1,54 @@ +/* ORBInitInfo.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Object; +import org.omg.CORBA.portable.IDLEntity; + +/** + * The instance of this interface is passed to {@link ORBInitializerOperations} + * and is used by {@link ORBInitializer} to register its {@link Interceptor}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ORBInitInfo extends ORBInitInfoOperations, + Object, + IDLEntity +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java new file mode 100644 index 00000000000..9cffbe1b551 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java @@ -0,0 +1,169 @@ +/* ORBInitInfoOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.IOP.CodecFactory; +import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName; + +/** + * Defines operations, applicable to {@link ORBInitInfo}. The + * {@link ORBInitInfo} is passed to the {@link ORBInitializer} that is + * reponsible for registering an {@link Interceptor}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ORBInitInfoOperations +{ + /** + * Register the client request interceptor. + * + * @param interceptor the interceptor to register. + * + * @throws DuplicateName if the interceptor name is not an empty string and an + * interceptor with this name is already registered with the ORB being + * created. + */ + void add_client_request_interceptor(ClientRequestInterceptor interceptor) + throws DuplicateName; + + /** + * Register the IOR (object reference) interceptor. + * + * @param interceptor the interceptor to register. + * + * @throws DuplicateName if the interceptor name is not an empty string and an + * interceptor with this name is already registered with the ORB being + * created. + */ + void add_ior_interceptor(IORInterceptor interceptor) + throws DuplicateName; + + /** + * Register the server request interceptor. + * + * @param interceptor the interceptor to register. + * + * @throws DuplicateName if the interceptor name is not an empty string and an + * interceptor with this name is already registered with the ORB being + * created. + */ + void add_server_request_interceptor(ServerRequestInterceptor interceptor) + throws DuplicateName; + + /** + * Allocate a slot on a {@link PortableInterceptor.Current}. While slots can + * be allocated by this method, they cannot be initialized. + * {@link CurrentOperations#get_slot} and {@link CurrentOperations#set_slot} + * throw {@link org.omg.CORBA.BAD_INV_ORDER} while called from the interceptor + * initializer. + * + * @return the index to the slot that has been allocated. + */ + int allocate_slot_id(); + + /** + * Returns the arguments passed to the ORB.init. + * + * @return the first parameter, passed to the method + * {@link org.omg.CORBA.ORB#init}. + */ + String[] arguments(); + + /** + * Get the CodecFactory that may be needed during the interceptor + * initialization. The method ORB.resolve_initial_references ("CodecFactory") + * cannot be used during ORB initialization. + * + * @return the CodecFactory. + */ + CodecFactory codec_factory(); + + /** + * Returns the ID of the ORB being initialized. + * + * @return the ORB id that differs for each new ORB being created during the + * current run of the java virtual machine. + */ + String orb_id(); + + /** + * Register the initial reference. The registered object will be accessible by + * the {@link ORB.resolve_initial_references} under the object_name. + * + * @param object_name the name of the object to register. + * @param object the object to register. + * + * @throws org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName if the + * name being registered is assumed to be invalid. + */ + void register_initial_reference(String object_name, + org.omg.CORBA.Object object + ) throws org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName; + + /** + * Identical to {@link org.omg.CORBA.ORB#resolve_initial_references}. + * + * This method can only be called from + * {@link ORBInitializerOperations#post_init} and not during + * {@link ORBInitializerOperations#pre_init}. + * + * @param object_name the name of the object to search. + * + * @return the object, accessible by the given name. + * + * @throws org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName if the + * given name is not associated with the known object. + * + * @see org.omg.CORBA.ORB#resolve_initial_references + */ + org.omg.CORBA.Object resolve_initial_references(String object_name) + throws org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName; + + /** + * Registers a PolicyFactory for the given PolicyType. + * + * @param policy_type the type of policy for that the factory is being + * registered. + * @param policy_factory the policy factory to register. + * + * @throws BAD_INV_ORDER minor 16 if the policy of the given type already has + * the registered factory in this ORB. + */ + void register_policy_factory(int policy_type, PolicyFactory policy_factory); +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitializer.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitializer.java new file mode 100644 index 00000000000..47191820c99 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitializer.java @@ -0,0 +1,132 @@ +/* ORBInitializer.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Object; +import org.omg.CORBA.portable.IDLEntity; + +/** + * <p> + * Registers the interceptor. + * + * Direct interceptor registration would open a security hole. Hence instead the + * interceptors from the ORB.init(..) method, passing the names of the needed + * initialized classes via properties. + * </p> + * <p> + * These property names are of the form + * </p> + * <p><i>org.omg.PortableInterceptor.ORBInitializerClass.<Service></i></p> + * where <i><Service></i> is the string name of a class, which implements + * {@link ORBInitializer}. During <code>ORB.init(..)</code>, the properties + * begining with <i>org.omg.PortableInterceptor.ORBInitializerClass</i> are + * collected, the <i><Service></i> portion of each property is extracted, + * the initialiser is instantiated with the <i><Service></i> string as its + * class name and then <code>pre_init</code> and <code>post_init</code> + * (defined in {@link ORBInitializerOperations}) are called on that initializer. + * The runtime exceptions, thrown by these two methods, are ignored. + * </p> + * <p> + * <h3>Example</h3> + * A client-side logging service may have the following ORBInitializer + * implementation: + * + * <code><pre> + * package gnu.x.logging; + * + * import org.omg.PortableInterceptor.*; + * import org.omg.CORBA.LocalObject; + * + * public class LoggingService extends LocalObject implements ORBInitializer + * { + * public void pre_init (ORBInitInfo info) + * { + * // More than one interceptor can be registered. + * ServerRequestInterceptor log_requests = new rLoggingInterceptor(); + * info.add_server_request_interceptor(log_requests); + * + * IORInterceptor log_iors = new iLoggingInterceptor(); + * info.add_ior_interceptor(log_iors); + * } + * + * public void post_init (ORBInitInfo info) + * { + * // Unused. + * } + * } + * </code></pre> + * <p> + * Then, one of the used set of properties then must contain the property, named + * <i> + * org.omg.PortableInterceptor.ORBInitializerClass.gnu.x.Logging.LoggingService + * </i>. + * The value of the property is ignored and may empty string. The + * agreed locations, where this property will be searched for, are: + * </p><p> + * 1. The properties parameter in the ORB.init(..), if any.<br> + * 2. The System properties.<br> + * 3. The orb.properties file located in the user.home directory (if any).<br> + * 4. The orb.properties file located in the java.home/lib directory (if any). + * </p> + * <p> + * The applet parameters and command line arguments are <i>not</i> scanned + * for the possible initializers. + * </p> + * <p> + * Interceptors are registered on a per-ORB basis. The virtual per-object + * Interceptors can be simulated by checking the policies on the target from + * within the interception points to determine whether they should work. The + * virtual per-POA Interceptors can be obtained instantiating each POA such with + * a different ORB. + * </p> + * <p> + * The registration code should not call directly any methods on the ORB being + * registered. + * </p> + * <p> + * The new interceptors cannot be registered after the ORB.init(..) returns. + * </p> + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ORBInitializer extends ORBInitializerOperations, + Object, + IDLEntity +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java new file mode 100644 index 00000000000..90c2325f22b --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java @@ -0,0 +1,73 @@ +/* ORBInitializerOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + + +/** + * Defines operations, applicable to the ORBInitializer. These operations are + * invoked on initializer from the ORB.init. + * + * @see ORBInitializer + */ +public interface ORBInitializerOperations +{ + /** + * This method is called during the first step of initialization. It must + * register all initial references that are expected to be used by other + * interceptors. + * + * @param info the object describing ORB being created and containing methods + * to register the interceptor. + * + * @see ORBInitInfoOperations#register_initial_reference + */ + void pre_init(ORBInitInfo info); + + /** + * This method called during the subsequent step of initialization. In this + * method it can be assumed that all required initial references are already + * registered. + * + * @param info the object describing ORB being created and containing methods + * to register the interceptor. + * + * @see ORBInitInfoOperations#register_initial_references + */ + void post_init(ORBInitInfo info); +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/PolicyFactory.java b/libjava/classpath/org/omg/PortableInterceptor/PolicyFactory.java new file mode 100644 index 00000000000..6478e408c80 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/PolicyFactory.java @@ -0,0 +1,57 @@ +/* PolicyFactory.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * The {@link ORBInitializer} may register the PolicyFactory to create the + * service specific policies later. The factory will be later used by + * {@link org.omg.CORBA.ORB#create_policy}. + * + * @see org.omg.PortableInterceptor.ORBInitInfoOperations#register_policy_factory + * @see org.omg.CORBA.ORB#create_policy + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface PolicyFactory extends PolicyFactoryOperations, + org.omg.CORBA.Object, + IDLEntity +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/PolicyFactoryOperations.java b/libjava/classpath/org/omg/PortableInterceptor/PolicyFactoryOperations.java new file mode 100644 index 00000000000..4e5a54ef754 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/PolicyFactoryOperations.java @@ -0,0 +1,69 @@ +/* PolicyFactoryOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; + +/** + * A service implementation can register policy factory during ORB initialization + * for creating the service-specific policies. This factory then will be + * invoked form {@link org.omg.CORBA.ORB#create_policy(int, Any)}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + * + * @see org.omg.CORBA.ORB#create_policy + * @see ORBInitInfoOperations#register_policy_factory + */ +public interface PolicyFactoryOperations +{ + /** + * Create and return the policy of the given type, having the given value. + * + * @param policy_type the type of the policy being created + * @param policy_value the value of the policy, wrapped in {@link Any}. + * Depending from the policy, the Any can hold various values, + * including complex data structures. + * + * @return the created policy. + */ + Policy create_policy(int policy_type, Any policy_value) + throws PolicyError; +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/RequestInfo.java b/libjava/classpath/org/omg/PortableInterceptor/RequestInfo.java new file mode 100644 index 00000000000..0285a80636a --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/RequestInfo.java @@ -0,0 +1,55 @@ +/* RequestInfo.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * Provides access to request information, available to the + * {@link ClientRequestInterceptor} or {@link ServerRequestInterceptor}. The + * additional operations, specific to the server and client are defined in the + * derived interfaces {@link ServerRequestInfo} and {@link ClientRequestInfo}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface RequestInfo extends RequestInfoOperations, + org.omg.CORBA.Object, + IDLEntity +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java new file mode 100644 index 00000000000..f865a14d258 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java @@ -0,0 +1,190 @@ +/* RequestInfoOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +import org.omg.Dynamic.Parameter; +import org.omg.IOP.ServiceContext; + +/** + * Defines operations that are applicable for both server and client request. + * The additional operations, specific to the server and client request are + * defined in the derived interfaces {@link ServerRequestInfoOperations} and + * {@link ClientRequestInfoOperations}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface RequestInfoOperations +{ + /** + * Return the parameters of the operation being invoked. + * + * @return the array, containing parameters of the operations or an empty + * array for the operations with no parameters. + * + * @throws NO_RESOURCES if the parameters are not available. The parameters + * are only available for DII (via {@link org.omg.CORBA.Request} or DSI calls. + * They are not available for calls via IDL - generated stubs. + */ + Parameter[] arguments(); + + /** + * Returns the names of all contexts of the operation being invoked. + * + * @return the array of strings, defining contexts. + * + * @throws NO_RESOURCES if the contexts are not available. The contexts are + * only available for DII (via {@link org.omg.CORBA.Request} or DSI calls. + * They are not available for calls via IDL - generated stubs. + */ + String[] contexts(); + + /** + * Returns the typecodes, defining all exceptions that the operation may + * throw. + * + * @return the array of exception typecodes, empty array if the operation + * should not throw any exceptions. + * + * @throws NO_RESOURCES if the exception list is not available. This list is + * only available for DII (via {@link org.omg.CORBA.Request} or DSI calls and + * only on the client side. It is not available for calls via IDL - generated + * stubs or on the server side. + */ + TypeCode[] exceptions(); + + /** + * If the request contains forwarding information (the reply_status attribute + * being LOCATION_FORWARD), return the forwarding target. + * + * @return the object where the request should be forwarded. + */ + org.omg.CORBA.Object forward_reference(); + + /** + * Get the service context with the given ctx_name that is associated with the + * reply. + * + * @param ctx_name the name of the service context + * + * @return the copy of the corresponding context. + * + * @throws BAD_PARAM minor 26, if the context with the give ctx_name does not + * exist. + */ + ServiceContext get_reply_service_context(int ctx_name) + throws BAD_PARAM; + + /** + * Get the service context with the given ctx_name that is associated with the + * request. + * + * @param ctx_name the name of the service context + * + * @return the copy of the corresponding context. + * + * @throws BAD_PARAM minor 26, if the context with the give ctx_name does not + * exist. + */ + ServiceContext get_request_service_context(int ctx_name) + throws BAD_PARAM; + + /** + * Get the data from the given slot of the PortableInterceptor.Current that is + * in the scope of the request. + */ + Any get_slot(int id) throws InvalidSlot; + + /** + * Get the names of the service contexts being sent on the request. + * + * @return array of strings, naming the contexts. + */ + String[] operation_context(); + + /** + * Get the name of the operation being invoked. + * + * @return the name of the operation, usually the name of method being called. + */ + String operation(); + + /** + * Get the reoly state as result of the operation invocation. + * + * @return the value field of one of the following: {@link SUCCESSFUL}, + * {@link SYSTEM_EXCEPTION}, {@link USER_EXCEPTION}, + * {@link LOCATION_FORWARD} or {@link TRANSPORT_RETRY}. + */ + short reply_status(); + + /** + * Get the request id. + * + * @return an id that uniquely identifies the current request/reply sequence. + */ + int request_id(); + + /** + * Indicates whether request sender expected any response. + * + * @return true if the response was expected, false otherwise. + */ + boolean response_expected(); + + /** + * Get the result of the operation invocation. + * + * @return an Any, containing the value, returned by the performed operation. + */ + Any result(); + + /** + * Determines how far the request shall progress before control is returned to + * the client. However up till JDK 1.5 inclusive this method always returns + * SYNC_WITH_TRANSPORT. + * + * @return {@link org.omg.Messaging.SYNC_WITH_TRANSPORT.value (1), always. + * + * @specnote as defined in the Suns 1.5 JDK API. + */ + short sync_scope(); +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfo.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfo.java new file mode 100644 index 00000000000..2aeba2b419c --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfo.java @@ -0,0 +1,54 @@ +/* ServerRequestInfo.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * Provides request information, accessible for the + * {@link ServerRequestInterceptor}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServerRequestInfo extends ServerRequestInfoOperations, + org.omg.CORBA.Object, + IDLEntity, + RequestInfo +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java new file mode 100644 index 00000000000..7646253d134 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java @@ -0,0 +1,302 @@ +/* ServerRequestInfoOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.INV_POLICY; +import org.omg.CORBA.Policy; +import org.omg.IOP.ServiceContext; + +/** + * Provides request information, accessible for the + * {@link ClientRequestInterceptor}. Some methods of this interface are not + * valid at all interception points. The following table shows the validity of + * each method. If it is not valid, BAD_INV_ORDER minor 14 will be thrown. + * + * <table border="1"> + * <tr> + * <th></th> + * <th>{@link ServerRequestInterceptorOperations#receive_request_service_contexts receive_request_<br>service_contexts}</th> + * <th>{@link ServerRequestInterceptorOperations#receive_request receive_request}</th> + * <th>{@link ServerRequestInterceptorOperations#send_reply send_reply}</th> + * <th>{@link ServerRequestInterceptorOperations#send_exception send_exception}</th> + * <th>{@link ServerRequestInterceptorOperations#send_other send_other}</th> + * </tr> + * <tr> + * <td colspan="6" align="center" bgcolor="#E0E0FF"><i>Inherited from + * {@link RequestInfoOperations}:</i></td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#arguments arguments}</th> + * <td bgcolor="lightgray">no </td> + * <td bgcolor="#E0E0E0" title="in and inout only">yes<sub><a href="#1">1</a></sub></td> + * <td>yes</td> + * <td bgcolor="#E0E0E0" title="When reply_status = LOCATION_FORWARD">no<sub><a + * href="#2">2</a></sub></td> + * <td bgcolor="#E0E0E0" title="When reply_status = LOCATION_FORWARD">no<sub><a + * href="#2">2</a></sub> </td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#exceptions exceptions}</th> + * <td bgcolor="lightgray">no </td> + * <td colspan="4" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#contexts contexts}</th> + * <td bgcolor="lightgray">no </td> + * <td colspan="4" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#operation_context operation_context}</th> + * <td bgcolor="lightgray">no </td> + * <td>yes</td> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td bgcolor="lightgray">no </td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#result result}</th> + * <td bgcolor="lightgray">no </td> + * <td bgcolor="lightgray">no </td> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td bgcolor="lightgray">no </td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#reply_status reply_status}</th> + * <td bgcolor="lightgray">no </td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align="center">yes</td> * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#forward_reference forward_reference}</th> + * <td bgcolor="lightgray" colspan="4" align="center">no</td> + * <td bgcolor="#E0E0E0" title="When reply_status = LOCATION_FORWARD">yes<sub><a + * href="#2">2</a></sub> </td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#get_request_service_context get_request_service_context}</th> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align="center">yes</td> * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#get_reply_service_context get_reply_service_context}</th> + * <td bgcolor="lightgray">no </td> + * <td bgcolor="lightgray">no </td> + * <td colspan="3" align="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#request_id request_id}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#operation operation}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#response_expected response_expected}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#sync_scope sync_scope}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain RequestInfoOperations#get_slot get_slot}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <td colspan="6" align="center" bgcolor="#E0E0FF"> + * <i>ServerRequestInfo-specific:</i></td> + * </tr> + * <tr> + * <th>{@linkplain #get_server_policy get_server_policy}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain #add_reply_service_context add_reply_service_context}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain #set_slot set_slot}</th> + * <td colspan="5" align ="center">yes</td> + * </tr> + * <tr> + * <th>{@linkplain #sending_exception sending_exception}</th> + * <td bgcolor="lightgray" colspan="3" align="center">no</td> + * <td>yes</td> + * <td bgcolor="lightgray">no </td> + * </tr> + * <tr> + * <th>{@linkplain #object_id object_id}</th> + * <td bgcolor="lightgray">no </td> + * <td>yes</td> + * <td>yes</td> + * <td bgcolor="#E0E0E0" title="Not always (see note)">yes<sub><a + * href="#3">3</a></sub></td> + * <td bgcolor="#E0E0E0" title="Not always (see note)">yes<sub><a + * href="#3">3</a></sub> </td> + * </tr> + * <tr> + * <th>{@linkplain #adapter_id adapter_id}</th> + * <td bgcolor="lightgray">no </td> + * <td>yes</td> + * <td>yes</td> + * <td bgcolor="#E0E0E0" title="Not always (see note)">yes<sub><a + * href="#3">3</a></sub></td> + * <td bgcolor="#E0E0E0" title="Not always (see note)">yes<sub><a + * href="#3">3</a></sub> </td> + * </tr> + * <tr> + * <th>{@linkplain #target_most_derived_interface target_most_derived_interface}</th> + * <td bgcolor="lightgray">no </td> + * <td>yes</td> + * <td bgcolor="lightgray" colspan="3" align="center">no</td> + * </tr> + * <tr> + * <th>{@linkplain #target_is_a target_is_a}</th> + * <td bgcolor="lightgray">no </td> + * <td>yes</td> + * <td bgcolor="lightgray" colspan="3" align="center">no</td> + * </tr> + * <tr> + * <th></th> + * <th>{@link ServerRequestInterceptorOperations#receive_request_service_contexts receive_request_<br>service_contexts }</th> + * <th>{@link ServerRequestInterceptorOperations#receive_request receive_request}</th> + * <th>{@link ServerRequestInterceptorOperations#send_reply send_reply}</th> + * <th>{@link ServerRequestInterceptorOperations#send_exception send_exception}</th> + * <th>{@link ServerRequestInterceptorOperations#send_other send_other}</th> + * </tr> + * </table> + * <ol> + * <li><a name="1">When ServerRequestInfo is passed to receive_request, there + * is an entry in the list for every argument. But only the in and inout + * arguments will be available.</a></li> + * <li><a name="2">If the reply_status attribute is not LOCATION_FORWARD, + * accessing this attribute throws BAD_INV_ORDER minor code of 14.</a></li> + * <li><a name="3">If the servant locator caused a location forward, or thrown + * an exception, this attribute/operation may not be available (NO_RESOURCES + * with a standard minor code of 1 will be thrown).</a></li> + * </ol> + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServerRequestInfoOperations extends RequestInfoOperations +{ + /** + * Allows the interceptor to add service contexts to the request. Such added + * contexts can carry arbitrary data and can be later accessed on the client + * side by the client request interceptor using + * {@link RequestInfoOperations#get_reply_service_context}. + * + * @param service_context the context to add. + * @param replace if true, the existing context with the same Id will be + * replaced. If false, the BAD_INV_ORDER will be thrown in that case. + * + * @throws BAD_INV_ORDER minor 15 if the context with the same Id already + * exists and replace=false. + */ + void add_reply_service_context(ServiceContext service_context, + boolean replace + ); + + /** + * Get the identifier for the object adapter (POA). + */ + byte[] adapter_id(); + + /** + * Get the object_id describing the target of the operation invocation. + */ + byte[] object_id(); + + /** + * Return the policy of the given type that applies to this operation. This + * method should only be used with policies, produced by the registered + * {@link PolicyFactory}. + * + * @param type the type of the policy being requested. + * + * @return the policy that applies to this operation. + * + * @throws INV_POLICY minor 2 if no factory was registered to produce this + * type of policy or the policy is otherwise invalid. + */ + Policy get_server_policy(int type) throws INV_POLICY; + + /** + * Get the exception to be returned to the client. If the returned Any cannot + * not support holding of that exception, it holds + * {@link org.omg.CORBA.UNKNOWN} minor 1 instead. + * + * @return an Any, holding exception that has been thrown and will be returned + * to client. + */ + Any sending_exception(); + + /** + * Allows the interceptor to set a slot in the PortableInterceptor.Current + * that is in the scope of the request. + * + * @param id the Id of the slot. + * @param data the value of the slot, replacing the previous value. + * + * @throws InvalidSlot if the slot with the given Id does not exist. + * + * @see RequestInfoOperations#get_slot(int) + * @see org.omg.PortableInterceptor#Current + */ + void set_slot(int id, Any data) throws InvalidSlot; + + /** + * Checks if the servant is the given repository id. + * + * @param the repository id to compare. + * + * @return true if the servant repository id matches the parameter, false + * otherwise. + */ + boolean target_is_a(String id); + + /** + * Get the most derived (most specific) repository Id of the servant. + * + * @return the repository id of the servant. + */ + String target_most_derived_interface(); +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptor.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptor.java new file mode 100644 index 00000000000..e74872f6b33 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptor.java @@ -0,0 +1,54 @@ +/* ServerRequestInterceptor.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * A server side request interceptor that is notified on various request + * processing steps on a server side. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServerRequestInterceptor extends Interceptor, + ServerRequestInterceptorOperations, + org.omg.CORBA.Object, + IDLEntity +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java new file mode 100644 index 00000000000..b57ca28f7ac --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java @@ -0,0 +1,134 @@ +/* ServerRequestInterceptorOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + + +/** + * Defines operations, applicable to the server side request interceptor. The + * operations are called by ORB at the appropriate interception points. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServerRequestInterceptorOperations + extends InterceptorOperations +{ + /** + * ORB calls this method before invoking the servant manager. Operation + * parameters are not available at this point. The interceptor has possibility + * to forward the request by throwing {@link ForwardRequest}. + * + * @throws SystemException if it does, the receive_request_service_contexts is + * not called for the subsequent interceptors, calling send_exception instead. + * The completion status of such exception must be COMPLETED_NO. + * + * @throws ForwardRequest to forward the invocation to another target. The + * receive_request_service_contexts is not called for the subsequent + * interceptors, calling send_other instead. + */ + void receive_request_service_contexts(ServerRequestInfo info) + throws ForwardRequest; + + /** + * ORB calls this method after all the information, including operation + * parameters, are available. The interceptor has possibility to forward the + * request by throwing {@link ForwardRequest}. + * + * @param info the object for accessing and manipulating the request + * information. + * + * @throws SystemException if it does, the receive_request is not called for + * the subsequent interceptors, calling send_exception instead. The completion + * status of such exception must be COMPLETED_NO. + * + * @throws ForwardRequest to forward the invocation to another target. The + * receive_request is not called for the subsequent interceptors, calling + * send_other instead. + */ + void receive_request(ServerRequestInfo info) throws ForwardRequest; + + /** + * ORB calls this method after the target operation has been invoked and + * before the reply is returned to the client. This interception point shall + * execute in the same thread as the target invocation. + * + * @param info the object for accessing and manipulating the request + * information. + * + * @throws SystemException if it does, the send_reply is not called for the + * subsequent interceptors, calling send_exception instead. The completion + * status of such exception must be COMPLETED_YES. + */ + void send_reply(ServerRequestInfo info); + + /** + * ORB calls this method if the exception has been throw during the request + * processing. The interceptor has possibility to forward the request by + * throwing {@link ForwardRequest}. + * + * @param info the object for accessing and manipulating the request + * information. + * + * @throws SystemException has the effect of changing the exception that + * successive interceptors receive on their calls to send_exception. If the + * original exception is a system exception, the completion_status of the new + * exception must match the exception being replaced. If the original + * exception is a user exception, then the completion_status of the new + * exception must be COMPLETED_YES. + * + * @throws ForwardRequest to forward the invocation to another target. The + * send_exception is not called for the subsequent interceptors, calling + * send_other instead. If the completion_status of the original exception is + * not a COMPLETED_NO, the ForwardRequest must not be raised. + */ + void send_exception(ServerRequestInfo info) throws ForwardRequest; + + /** + * ORB normally calls this method if the request has been forwarded. + * + * @param info the object for accessing and manipulating the request + * information. + * + * @throws SystemException if it does, the send_other is not called for the + * subsequent interceptors, calling send_exception instead. + * + * @throws ForwardRequest has the effect of changing the redirection that + * successive interceptors receive on their calls to send_other. + */ + void send_other(ServerRequestInfo info) throws ForwardRequest; +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/package.html b/libjava/classpath/org/omg/PortableInterceptor/package.html new file mode 100644 index 00000000000..b29c84fbf48 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/package.html @@ -0,0 +1,58 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. --> + +<html> +<head><title>GNU Classpath - org.omg.PortableInterceptor</title></head> + +<body> +Interceptors are hooks than can monitor various stages of the CORBA request +processing. The {@link org.omg.PortableInterceptor.IORInterceptor} monitors +all new object refereces (IORs) being created and can add to them additional +information. The {@link org.omg.PortableInterceptor.ClientRequestInterceptor} +monitors request handling on the client side and the +{@link org.omg.PortableInterceptor.ServerRequestInterceptor} monitors request +handling on the server side. The client and server request interceptors can +add additional data to the CORBA message that is accessible on remote side +after the message is transmitted. They can also forward request to another +target. All interceptor functions also work for the local invocations. The +interceptors are registered in ORB.init(...) using +{@link org.omg.PortableInterceptor.ORBInitializer}. + +@author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +</body> +</html> |

