diff options
Diffstat (limited to 'libjava/classpath/org/omg/PortableInterceptor')
64 files changed, 6734 insertions, 0 deletions
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ACTIVE.java b/libjava/classpath/org/omg/PortableInterceptor/ACTIVE.java new file mode 100644 index 000000000..d7e7e1487 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ACTIVE.java @@ -0,0 +1,55 @@ +/* ACTIVE.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; + +/** + * A single constant interface, defining the adapter state (ACTIVE) = 1. + * Used with IOR interceptors. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ACTIVE +{ + /** + * Specifies the ACTIVE value, 1. + */ + short value = 1; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/AdapterManagerIdHelper.java b/libjava/classpath/org/omg/PortableInterceptor/AdapterManagerIdHelper.java new file mode 100644 index 000000000..df4bd3e72 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/AdapterManagerIdHelper.java @@ -0,0 +1,120 @@ +/* AdapterManagerIdHelper.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.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A helper operations for the adapter manager id. An adapter manager id is an + * integer constant and needs no helper, but the one is included anyway. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class AdapterManagerIdHelper +{ + /** + * Create the AdapterManagerId typecode (alias of CORBA long (java int), named + * "AdapterManagerId"). + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "AdapterManagerId", + orb.get_primitive_tc(TCKind.tk_long)); + } + + /** + * Insert the int into the given Any. + */ + public static void insert(Any any, int that) + { + any.insert_long(that); + } + + /** + * Extract the int from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain int. + */ + public static int extract(Any any) + { + return any.extract_long(); + } + + /** + * Get the adapter manager id repository id. + * + * @return "IDL:omg.org/PortableInterceptor/AdapterManagerId:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/AdapterManagerId:1.0"; + } + + /** + * Read the int (adapter manager id) from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static int read(InputStream input) + { + return input.read_long(); + } + + /** + * Write the int (adapter manager id) 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, int value) + { + output.write_long(value); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/AdapterNameHelper.java b/libjava/classpath/org/omg/PortableInterceptor/AdapterNameHelper.java new file mode 100644 index 000000000..0f37a6a30 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/AdapterNameHelper.java @@ -0,0 +1,135 @@ +/* AdapterNameHelper.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.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StringSeqHelper; +import org.omg.CORBA.StringSeqHolder; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * Provides static helper methods for working with the adapter name helper. + * The adapter name helper is an array of strings, so {@link StringSeqHelper} + * could be used for io operations. The separate helper is provided anyway. + * + * @since 1.5 + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class AdapterNameHelper +{ + + /** + * Extract the adapter name (<code>String[]</code>) from the given {@link Any}. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + */ + public static String[] extract(Any a) + { + StringSeqHolder h = (StringSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id. + * + * @return "IDL:omg.org/PortableInterceptor/AdapterName:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/AdapterName:1.0"; + } + + /** + * Insert into the given adapter name (<code>String[]</code>) into the + * given {@link Any}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, String[] that) + { + StringSeqHolder holder = new StringSeqHolder(that); + into.insert_Streamable(holder); + into.type(type()); + } + + /** + * Reads the <code>String[]</code> from the CORBA input stream. + * + * @param input the CORBA stream to read from. + * @return the value from the stream. + */ + public static String[] read(InputStream input) + { + return StringSeqHelper.read(input); + } + + /** + * Creates and returns a new instance of the TypeCode, corresponding the + * adapter name. + * + * @return the alias of the string sequence, named "AdapterName". + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + + TypeCode component = orb.create_string_tc(0); + return orb.create_alias_tc(id(), "AdapterName", component); + } + + /** + * Writes the <code>String[]</code> into the given stream. + * + * @param output the CORBA output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, String[] value) + { + StringSeqHelper.write(output, value); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/AdapterStateHelper.java b/libjava/classpath/org/omg/PortableInterceptor/AdapterStateHelper.java new file mode 100644 index 000000000..ea208474b --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/AdapterStateHelper.java @@ -0,0 +1,121 @@ +/* AdapterStateHelper.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.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A helper operations for the adapter state. An adapter state is an + * short integer constant and needs no helper, but the one is included anyway. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class AdapterStateHelper +{ + /** + * Create the AdapterState typecode (alias of <code>short</code>, + * named "AdapterState"). + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "AdapterState", + orb.get_primitive_tc(TCKind.tk_short) + ); + } + + /** + * Insert the <code>short</code> into the given Any. + */ + public static void insert(Any any, short that) + { + any.insert_short(that); + } + + /** + * Extract the <code>short</code> from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain int. + */ + public static short extract(Any any) + { + return any.extract_short(); + } + + /** + * Get the adapter state repository id. + * + * @return "IDL:omg.org/PortableInterceptor/AdapterState:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/AdapterState:1.0"; + } + + /** + * Read the <code>short</code> (adapter state) from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static short read(InputStream input) + { + return input.read_short(); + } + + /** + * Write the <code>short</code> (adapter state) 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, short value) + { + output.write_short(value); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfo.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfo.java new file mode 100644 index 000000000..d25fe6163 --- /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 +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java new file mode 100644 index 000000000..3b7ed24f3 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java @@ -0,0 +1,327 @@ +/* ClientRequestInfoOperations.java -- + Copyright (C) 2005, 2006 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; +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. + */ + 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 + ); +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptor.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptor.java new file mode 100644 index 000000000..210ac7b02 --- /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 +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java new file mode 100644 index 000000000..5b1ab84c5 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java @@ -0,0 +1,130 @@ +/* ClientRequestInterceptorOperations.java -- + Copyright (C) 2005, 2006 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.SystemException; + + +/** + * 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); +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/Current.java b/libjava/classpath/org/omg/PortableInterceptor/Current.java new file mode 100644 index 000000000..5f609b61e --- /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 +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java b/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java new file mode 100644 index 000000000..881c592a8 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java @@ -0,0 +1,165 @@ +/* CurrentHelper.java -- + Copyright (C) 2005, 2006 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.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.MARSHAL; +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 +{ + /** + * Get the type code of the {@link Current}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.create_interface_tc(id(), "Current"); + } + + /** + * 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"); + } + } + + /** + * Narrow the given object to the Current. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). See also OMG issue 4158. + * + * @param obj the object to cast. + * + * @return the casted Current. + * + * @since 1.5 + */ + public static Current unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + + /** + * 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) + { + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; + } + + /** + * 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) + { + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/CurrentOperations.java b/libjava/classpath/org/omg/PortableInterceptor/CurrentOperations.java new file mode 100644 index 000000000..347b040d0 --- /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; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/DISCARDING.java b/libjava/classpath/org/omg/PortableInterceptor/DISCARDING.java new file mode 100644 index 000000000..bec0c25e0 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/DISCARDING.java @@ -0,0 +1,55 @@ +/* DISCARDING.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; + +/** + * A single constant interface, defining the adapter state (DISCARDING) = 2. + * Used with IOR interceptors. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DISCARDING +{ + /** + * Specifies the DISCARDING value, 2. + */ + short value = 2; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ForwardRequest.java b/libjava/classpath/org/omg/PortableInterceptor/ForwardRequest.java new file mode 100644 index 000000000..1018b2722 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ForwardRequest.java @@ -0,0 +1,97 @@ +/* ForwardRequest.java -- + Copyright (C) 2005, 2006 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 final 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; + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ForwardRequestHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ForwardRequestHelper.java new file mode 100644 index 000000000..1d44e9c0f --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ForwardRequestHelper.java @@ -0,0 +1,146 @@ +/* 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.Minor; +import gnu.CORBA.OrbRestricted; +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 +{ + /** + * Create the ForwardRequest typecode (structure, named "ForwardRequest"). The + * typecode states that the structure contains the following fields: forward. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[1]; + + TypeCode field = ObjectHelper.type(); + members[0] = new StructMember("forward", field, null); + return orb.create_exception_tc(id(), "ForwardRequest", members); + } + + /** + * 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.minor = Minor.Any; + 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); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/HOLDING.java b/libjava/classpath/org/omg/PortableInterceptor/HOLDING.java new file mode 100644 index 000000000..ce22a1f68 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/HOLDING.java @@ -0,0 +1,55 @@ +/* HOLDING.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; + +/** + * A single constant interface, defining the adapter state (HOLDING) = 0. + * Used with IOR interceptors. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface HOLDING +{ + /** + * Specifies the HOLDING value, 0. + */ + short value = 0; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/INACTIVE.java b/libjava/classpath/org/omg/PortableInterceptor/INACTIVE.java new file mode 100644 index 000000000..8a5cad1e1 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/INACTIVE.java @@ -0,0 +1,57 @@ +/* INACTIVE.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; + +/** + * A single constant interface, defining the adapter state (INACTIVE) = 3. + * The adapter is shutting down, and will eventually end up in the + * NON_EXISTENT state. + * Used with IOR interceptors. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface INACTIVE +{ + /** + * Specifies the INACTIVE value, 3. + */ + short value = 3; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInfo.java b/libjava/classpath/org/omg/PortableInterceptor/IORInfo.java new file mode 100644 index 000000000..489818456 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInfo.java @@ -0,0 +1,58 @@ +/* IORInfo.java -- + Copyright (C) 2005, 2006 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 IORInterceptorOperations#establish_components}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IORInfo extends IORInfoOperations, + IDLEntity, + org.omg.CORBA.Object, + Serializable +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/IORInfoOperations.java new file mode 100644 index 000000000..9ff8d0e27 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInfoOperations.java @@ -0,0 +1,138 @@ +/* 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); + + /** + * Get the adapter template that is associated with the object POA. + * The template is also a reference factory and can produce the new object + * references. + * + * @since 1.5 + */ + public ObjectReferenceTemplate adapter_template(); + + /** + * The current_factory is the factory, used by the adapter to create + * object references. This factory is initially the same as the + * adapter_template. + * + * @since 1.5 + */ + public ObjectReferenceFactory current_factory(); + + /** + * Set the current object reference factory, used to produce the new objects. + * + * The current factory can only be set during the call to the + * {@link IORInterceptor_3_0Operations#components_established(IORInfo)}. + * + * @since 1.5 + */ + public void current_factory(ObjectReferenceFactory factory); + + /** + * Get the POA manager Id. + * + * @return Id that uniquely refers to the poa manager, used by this POA. + * + * @since 1.5 + * + * @see IORInterceptor_3_0Operations#adapter_manager_state_changed + */ + public int manager_id(); + + /** + * Get the state of the adapter manager. + * + * @since 1.5 + * + * @return the state of the adapters to that the IOR being created belongs. + * One of the {@link HOLDING#value}, {@link DISCARDING#value}, + * {@link INACTIVE#value} or {@link NON_EXISTENT#value}. + */ + short state(); +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor.java new file mode 100644 index 000000000..d654f3998 --- /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 +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptorOperations.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptorOperations.java new file mode 100644 index 000000000..f955576b5 --- /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. + */ + public void establish_components(IORInfo info); +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0.java new file mode 100644 index 000000000..e77d34694 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0.java @@ -0,0 +1,59 @@ +/* IORInterceptor_3_0.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 IORInterceptor_3_0 adds to {@link Interceptor} functionality, available + * since CORBA 3.0. These new operations are defined separately in + * {@link IORInterceptor_3_0Operations}. + * + * IORInterceptor_3_0 is registered exactly in the same way as the + * {@link IORInterceptor}. The ORB calls the additional methods to all + * IOR interceptors that implement this extended interface. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IORInterceptor_3_0 + extends IORInterceptor_3_0Operations, IDLEntity, IORInterceptor +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java new file mode 100644 index 000000000..97875deb2 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java @@ -0,0 +1,189 @@ +/* IORInterceptor_3_0Helper.java -- + Copyright (C) 2005, 2006 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.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.Delegate; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the CORBA object {@link IORInterceptor_3_0}. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class IORInterceptor_3_0Helper +{ + /** + * Get the type code of the {@link IORInterceptor_3_0}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.create_interface_tc(id(), + "IORInterceptor_3_0"); + } + + /** + * Insert the IORInterceptor_3_0 into the given Any. + * + * @param any the Any to insert into. + * @param that the IORInterceptor_3_0 to insert. + */ + public static void insert(Any any, IORInterceptor_3_0 that) + { + any.insert_Streamable(new IORInterceptor_3_0Holder(that)); + } + + /** + * Extract the IORInterceptor_3_0 from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain + * IORInterceptor_3_0. + */ + public static IORInterceptor_3_0 extract(Any any) + { + try + { + IORInterceptor_3_0Holder holder = (IORInterceptor_3_0Holder) + any.extract_Streamable(); + return holder.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("IORInterceptor_3_0 expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the IORInterceptor_3_0 repository id. + * + * @return "IDL:omg.org/PortableInterceptor/IORInterceptor_3_0:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/IORInterceptor_3_0:1.0"; + } + + /** + * Narrow the passed object into the IORInterceptor_3_0. If the object has a + * different java type, create an instance of the _IORInterceptor_3_0Stub, + * using the same delegate, as for the passed parameter. Hence, unlike java + * type cast, this method may return a different object, than has been passed. + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a IORInterceptor_3_0. + */ + public static IORInterceptor_3_0 narrow(org.omg.CORBA.Object obj) + { + if (obj == null) + return null; + else if (obj instanceof IORInterceptor_3_0) + return (IORInterceptor_3_0) obj; + else if (!obj._is_a(id())) + throw new BAD_PARAM("Not a IORInterceptor_3_0"); + else + { + Delegate delegate = ((ObjectImpl) obj)._get_delegate(); + return new _IORInterceptor_3_0Stub(delegate); + } + } + + /** + * Narrow the passed object into the IORInterceptor_3_0. No type-checking is + * performed to verify that the object actually supports the requested type. + * The {@link BAD_OPERATION} will be thrown if unsupported operations are + * invoked on the new returned reference, but no failure is expected at the + * time of the unchecked_narrow. For instance, the narrowing of the + * remote instance of the {@link IORInterceptor} will work as long as only the + * methods, inherited from this parent, are invoked. + * + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a IORInterceptor_3_0. + */ + public static IORInterceptor_3_0 unchecked_narrow(org.omg.CORBA.Object obj) + { + if (obj == null) + return null; + else if (obj instanceof IORInterceptor_3_0) + return (IORInterceptor_3_0) obj; + else + { + Delegate delegate = ((ObjectImpl) obj)._get_delegate(); + return new _IORInterceptor_3_0Stub(delegate); + } + } + + + /** + * Read the IORInterceptor_3_0 from the CDR intput stream (IOR profile + * expected). + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static IORInterceptor_3_0 read(InputStream input) + { + return unchecked_narrow(input.read_Object()); + } + + /** + * Write the IORInterceptor_3_0 to the CDR output stream (as IOR profile). + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, IORInterceptor_3_0 value) + { + output.write_Object(value); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Holder.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Holder.java new file mode 100644 index 000000000..42462eab9 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Holder.java @@ -0,0 +1,106 @@ +/* IORInterceptor_3_0Holder.java -- + Copyright (C) 2005, 2006 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.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for the object {@link IORInterceptor_3_0}. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class IORInterceptor_3_0Holder + implements Streamable +{ + /** + * The stored IORInterceptor_3_0 value. + */ + public IORInterceptor_3_0 value; + + /** + * Create the unitialised instance, leaving the value field with default + * <code>null</code> value. + */ + public IORInterceptor_3_0Holder() + { + } + + /** + * Create the initialised instance. + * + * @param initialValue the value that will be assigned to the + * <code>value</code> field. + */ + public IORInterceptor_3_0Holder(IORInterceptor_3_0 initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link #value} by data from the CDR stream. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = IORInterceptor_3_0Helper.read(input); + } + + /** + * Write the stored value into the CDR stream. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + IORInterceptor_3_0Helper.write(output, value); + } + + /** + * Get the typecode of the IORInterceptor_3_0. + */ + public org.omg.CORBA.TypeCode _type() + { + return IORInterceptor_3_0Helper.type(); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Operations.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Operations.java new file mode 100644 index 000000000..56e19a5be --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Operations.java @@ -0,0 +1,90 @@ +/* IORInterceptor_3_0Operations.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 the operations, applicable to the IORInterceptor_3_0. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IORInterceptor_3_0Operations + extends IORInterceptorOperations +{ + /** + * This method is invoked on all registered IORInterceptor_3_0 instances when + * the state of the adapter manager changes. + * + * @param adapterManagerId the Id of the adapter manager that has changed the + * state. The same value is returned by + * {@link IORInfoOperations#manager_id()}. + * + * @param adapterState the new state of the adapter manager, one of the + * {@link HOLDING#value}, {@link DISCARDING#value}, {@link INACTIVE#value} + * or {@link NON_EXISTENT#value}. + */ + void adapter_manager_state_changed(int adapterManagerId, short adapterState); + + /** + * Notifies the interceptor about the adapter state changes that are unrelated + * to adapter manager state changes. This method is invoked on all registered + * IORInterceptor_3_0 instances. The only currently possible change of state + * is when POA is destroyed. In this case, the method is invoked passing the + * single element array witn the reference template of the POA being destroyed + * and the {@link NON_EXISTENT#value} state. + * + * @param adapters identifies the object adapters that have changed they + * state. + * @param adaptersState the new state of the adapters, one of the + * {@link HOLDING#value}, {@link DISCARDING#value}, {@link INACTIVE#value} + * or {@link NON_EXISTENT#value}. + */ + void adapter_state_changed(ObjectReferenceTemplate[] adapters, + short adaptersState); + + /** + * This metod is invoked after the + * {@link IORInterceptorOperations#establish_components} have been called on + * all registered interceptor instances. At this stage, it is possible to set + * the object reference factory using + * {@link IORInfo#current_factory(ObjectReferenceFactory )}. + */ + void components_established(IORInfo info); +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/Interceptor.java b/libjava/classpath/org/omg/PortableInterceptor/Interceptor.java new file mode 100644 index 000000000..4dcb2162a --- /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 +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/InterceptorOperations.java b/libjava/classpath/org/omg/PortableInterceptor/InterceptorOperations.java new file mode 100644 index 000000000..3758ab01a --- /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(); +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/InvalidSlot.java b/libjava/classpath/org/omg/PortableInterceptor/InvalidSlot.java new file mode 100644 index 000000000..e166e0631 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/InvalidSlot.java @@ -0,0 +1,76 @@ +/* InvalidSlot.java -- + Copyright (C) 2005, 2006 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 final 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); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/InvalidSlotHelper.java b/libjava/classpath/org/omg/PortableInterceptor/InvalidSlotHelper.java new file mode 100644 index 000000000..36e23a90c --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/InvalidSlotHelper.java @@ -0,0 +1,143 @@ +/* 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 gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +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 +{ + /** + * Create the InvalidSlot typecode (structure, named "InvalidSlot"). + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[0]; + return orb.create_exception_tc(id(), "InvalidSlot", members); + } + + /* + * 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.minor = Minor.Any; + 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()); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/LOCATION_FORWARD.java b/libjava/classpath/org/omg/PortableInterceptor/LOCATION_FORWARD.java new file mode 100644 index 000000000..f0d90788e --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/LOCATION_FORWARD.java @@ -0,0 +1,54 @@ +/* LOCATION_FORWARD.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; + + +/** + * A reply status flag, indicating, that the object has + * moved (temporary or permanently) to another location. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface LOCATION_FORWARD +{ + /** + * Specifies the LOCATION_FORWARD value, 3. + */ + short value = 3; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/NON_EXISTENT.java b/libjava/classpath/org/omg/PortableInterceptor/NON_EXISTENT.java new file mode 100644 index 000000000..136b64fb0 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/NON_EXISTENT.java @@ -0,0 +1,57 @@ +/* NON_EXISTENT.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; + +/** + * A single constant interface, defining the adapter state (NON_EXISTENT) = 4. + * NON_EXISTENT does not map directly to a particular POAManager state, but + * indicates that a POA has been destroyed. Used with IOR interceptors. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ + +public interface NON_EXISTENT +{ + /** + * Specifies the NON_EXISTENT value, 4. + */ + short value = 4; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBIdHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ORBIdHelper.java new file mode 100644 index 000000000..f80e71a9a --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBIdHelper.java @@ -0,0 +1,119 @@ +/* ORBIdHelper.java -- + Copyright (C) 2005, 2006 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.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The ORB Id is defined in OMG specification just as a narrow (not wide) + * string. As such, the ORB Id needs no helper, but one is included in + * the API anyway. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ORBIdHelper +{ + /** + * Insert the ORB Id into Any (uses {@link Any#insert_string}). + * + * @param a the Any to insert into. + * @param that the string to insert. + */ + public static void insert(Any a, String that) + { + a.insert_string(that); + } + + /** + * Extract the ORB Id from Any ((uses {@link Any#extract_string}). + * + * @param a the Any to extract from. + */ + public static String extract(Any a) + { + return a.extract_string(); + } + + /** + * Return an alias typecode. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "ORBId", orb.create_string_tc(0)); + } + + /** + * Return the ORB Id repository id. + * @return "IDL:omg.org/PortableInterceptor/ORBId:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ORBId:1.0"; + } + + /** + * Calls {@link InputStream#read_string()}. + * + * @param input the stream to read from. + */ + public static String read(InputStream input) + { + return input.read_string(); + } + + /** + * Calls {@link OutputStream#write_string(String)}. + * + * @param output the stream to write into. + * @param value the string (ORB Id) value to write. + */ + public static void write(OutputStream output, String value) + { + output.write_string(value); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfo.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfo.java new file mode 100644 index 000000000..a74b1e79d --- /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 +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java new file mode 100644 index 000000000..cacae3dce --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java @@ -0,0 +1,174 @@ +/* ORBInitInfoOperations.java -- + Copyright (C) 2005, 2006 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.BAD_INV_ORDER; +import org.omg.CORBA.ORB; +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. If the registered + * interceptor implements the extended {@link IORInterceptor_3_0} interface, + * ORB will call its additional methods, defined in the + * {@link IORInterceptor_3_0Operations}. + * + * @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 Current} of this interceptor. 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 methods from the group + * org.omg.CORBA.ORB#init(String[], ...). + */ + 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); +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateName.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateName.java new file mode 100644 index 000000000..bad7f8baa --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateName.java @@ -0,0 +1,101 @@ +/* DuplicateName.java -- + Copyright (C) 2005, 2006 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.ORBInitInfoPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * This exception is raised on an attempt to register a second + * {@link org.omg.PortableInterceptor#Interceptor} with the same name. + * For each {@link org.omg.PortableInterceptor#Interceptor} type, only + * one {@link org.omg.PortableInterceptor#Interceptor} of a given name can + * be registered with the {@link org.omg.CORBA.ORB}. + * + * @see org.omg.PortableInterceptor.ORBInitInfoOperations + * + * @author Audrius Meskauskas, Lithiania (AudriusA@Bioinformatics.org) + */ +public final class DuplicateName extends UserException implements IDLEntity, + Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 7748239257677851130L; + + /** + * The name that appears to be duplicate. + */ + public String name; + + /** + * Create DuplicateName with no explaining message field {@link #name} + * initialised to null. + */ + public DuplicateName() + { + } + + /** + * Create the DuplicateName with explaining message and field {@link #name} + * initialised to the given value. + * + * @param why a string, explaining, why this exception has been thrown. + * @param a_name a value for name. + */ + public DuplicateName(String why, String a_name) + { + super(why); + this.name = a_name; + } + + /** + * Create the DuplicateName without explaining message and and field + * {@link #name} initialised to the given value. + * + * @param a_name a value for name. + */ + public DuplicateName(String a_name) + { + this.name = a_name; + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHelper.java new file mode 100644 index 000000000..962da93c8 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHelper.java @@ -0,0 +1,145 @@ +/* DuplicateNameHelper.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.ORBInitInfoPackage; + +import gnu.CORBA.*; + +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.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link DuplicateName}. + * + * @author Audrius Meskauskas, Lithiania (AudriusA@Bioinformatics.org) + */ +public abstract class DuplicateNameHelper +{ + /** + * Create the DuplicateName typecode (structure, named "DuplicateName"). The + * typecode states that the structure contains the following fields: name. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[1]; + + TypeCode field; + + field = orb.get_primitive_tc(TCKind.tk_string); + members[0] = new StructMember("name", field, null); + return orb.create_exception_tc(id(), "DuplicateName", members); + } + + /** + * Insert the DuplicateName into the given Any. This method uses the + * DuplicateNameHolder. + * + * @param any the Any to insert into. + * @param that the DuplicateName to insert. + */ + public static void insert(Any any, DuplicateName that) + { + any.insert_Streamable(new DuplicateNameHolder(that)); + } + + /** + * Extract the DuplicateName from given Any. + * This method uses the DuplicateNameHolder. + * + * @throws BAD_OPERATION if the passed Any does not contain DuplicateName. + */ + public static DuplicateName extract(Any any) + { + try + { + return ((DuplicateNameHolder) any.extract_Streamable()).value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("DuplicateName expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the DuplicateName repository id. + * + * @return "IDL:omg.org/PortableInterceptor/ORBInitInfo/DuplicateName:1.0". + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ORBInitInfo/DuplicateName:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static DuplicateName read(InputStream input) + { + // Read the exception repository id. + input.read_string(); + DuplicateName value = new DuplicateName(); + + value.name = input.read_string(); + 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, DuplicateName value) + { + // Write the exception repository id. + output.write_string(id()); + output.write_string(value.name); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidName.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidName.java new file mode 100644 index 000000000..7a7e23cc0 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidName.java @@ -0,0 +1,79 @@ +/* InvalidName.java -- + Copyright (C) 2005, 2006 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.ORBInitInfoPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * This exception is raised by methods in + * {@link org.omg.PortableInterceptor.ORBInitInfoOperations} on the attempt to + * register or resolve an invalid name like empty string. The already + * registered names (including the default names, defined by OMG) are also + * invalid for registration. + * + * @author Audrius Meskauskas, Lithiania (AudriusA@Bioinformatics.org) + */ +public final class InvalidName extends UserException implements IDLEntity, + Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -4599417794753377115L; + + /** + * Create InvalidName with no explaining message. + */ + public InvalidName() + { + } + + /** + * Create the InvalidName with explaining message. + * + * @param why a string, explaining, why the name is invalid. + */ + public InvalidName(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java new file mode 100644 index 000000000..c7daf46b9 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java @@ -0,0 +1,138 @@ +/* InvalidNameHelper.java -- + Copyright (C) 2005, 2006 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.ORBInitInfoPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +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 InvalidName}. + * + * @author Audrius Meskauskas, Lithiania (AudriusA@Bioinformatics.org) + */ +public abstract class InvalidNameHelper +{ + /** + * Create the InvalidName typecode (structure, named "InvalidName"). + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[0]; + return orb.create_exception_tc(id(), "InvalidName", members); + } + + /** + * Insert the InvalidName into the given Any. + * + * @param any the Any to insert into. + * @param that the InvalidName to insert. + */ + public static void insert(Any any, InvalidName that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the InvalidName from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain InvalidName. + */ + public static InvalidName extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (InvalidName) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("InvalidName expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the InvalidName repository id. + * + * @return "IDL:omg.org/PortableInterceptor/ORBInitInfo/InvalidName:1.0". + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ORBInitInfo/InvalidName:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static InvalidName read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + InvalidName value = new InvalidName(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, InvalidName value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java new file mode 100644 index 000000000..b61720c56 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java @@ -0,0 +1,117 @@ +/* ObjectIdHelper.java -- + Copyright (C) 2005, 2006 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.ORBInitInfoPackage; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The Object Id is defined in OMG specification just as a narrow (not wide) + * string. As such, the Object Id needs no helper, but one is included in + * the API anyway. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectIdHelper +{ + /** + * Insert the Object Id into Any (uses {@link Any#insert_string(String)}). + * + * @param a the Any to insert into. + * @param that the string to insert. + */ + public static void insert(Any a, String that) + { + a.insert_string(that); + } + + /** + * Extract the Object Id from Any (uses {@link Any#extract_string()}). + * + * @param a the Any to extract from. + */ + public static String extract(Any a) + { + return a.extract_string(); + } + + /** + * Return an alias typecode. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "ObjectId", orb.create_string_tc(0)); + } + + /** + * Return the Object Id repository id. + * @return "IDL:omg.org/PortableInterceptor/ORBInitInfo/ObjectId:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ORBInitInfo/ObjectId:1.0"; + } + + /** + * Calls {@link InputStream#read_string()}. + * + * @param input the stream to read from. + */ + public static String read(InputStream input) + { + return input.read_string(); + } + + /** + * Calls {@link OutputStream#write_string(String)}. + * + * @param output the stream to write into. + * @param value the string (Object Id) value to write. + */ + public static void write(OutputStream output, String value) + { + output.write_string(value); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitializer.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitializer.java new file mode 100644 index 000000000..84ddfd9fe --- /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 +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java new file mode 100644 index 000000000..04bc387d1 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java @@ -0,0 +1,73 @@ +/* ORBInitializerOperations.java -- + Copyright (C) 2005, 2006 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_reference + */ + void post_init(ORBInitInfo info); +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectIdHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectIdHelper.java new file mode 100644 index 000000000..19fc05daf --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectIdHelper.java @@ -0,0 +1,121 @@ +/* ObjectIdHelper.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.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.ORB; +import org.omg.CORBA.OctetSeqHelper; +import org.omg.CORBA.OctetSeqHolder; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The Object Id of this package is defined in OMG specification as a byte array. + * As such, the Object Id needs no helper, but one is included in the API anyway. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectIdHelper +{ + /** + * Insert the Object Id into Any. + * + * @param a the Any to insert into. + * @param that the string to insert. + */ + public static void insert(Any a, byte[] that) + { + a.insert_Streamable(new OctetSeqHolder(that)); + a.type(type()); + } + + /** + * Extract the Object Id from Any. + * + * @param a the Any to extract from. + */ + public static byte[] extract(Any a) + { + return ((OctetSeqHolder) a.extract_Streamable()).value; + } + + /** + * Return an alias typecode (an alias of the octet sequence). + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "ObjectId", OctetSeqHelper.type()); + } + + /** + * Return the Object Id repository id. + * @return "IDL:omg.org/PortableInterceptor/ObjectId:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ObjectId:1.0"; + } + + /** + * Read the Object Id as a byte array. + * + * @param input the stream to read from. + */ + public static byte[] read(InputStream input) + { + return OctetSeqHelper.read(input); + } + + /** + * Write the Object Id as a byte array. + * + * @param output the stream to write into. + * @param value the Object Id value to write. + */ + public static void write(OutputStream output, byte[] value) + { + OctetSeqHelper.write(output, value); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactory.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactory.java new file mode 100644 index 000000000..7b669799a --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactory.java @@ -0,0 +1,75 @@ +/* ObjectReferenceFactory.java -- + Copyright (C) 2005, 2006 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; +import org.omg.CORBA.portable.ValueBase; + +/** + * Provides the possibility to create the CORBA object reference. + * The reference is created from repository id (defining the type of the + * object) and the object id (defining the identity of the object). + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ObjectReferenceFactory + extends ValueBase, IDLEntity +{ + /** + * Create an object with the given repository and object ids. This interface + * does not specify where and how the returned object must be connected and + * activated. The derived {@link ObjectReferenceTemplate} interface assumes + * the object must be connected to the POA that is specific to that + * template (name can be obtained). + * + * If the object with this objectId already exists in the given context, it + * is found and returned; a new object is <i>not</i> created. + * + * @param repositoryId the repository id of the object being created, defines + * the type of the object. + * + * @param objectId the byte array, defining the identity of the object. + * + * @return The created corba object. + */ + Object make_object(String repositoryId, byte[] objectId); +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java new file mode 100644 index 000000000..8f5af656e --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java @@ -0,0 +1,142 @@ +/* ObjectReferenceFactoryHelper.java -- + Copyright (C) 2005, 2006 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.CDR.Vio; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.ValueMember; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.VM_ABSTRACT; + +/** + * The helper operations for the CORBA object {@link ObjectReferenceFactory}. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectReferenceFactoryHelper +{ + /** + * Get the type code of the {@link ObjectReferenceFactory}. + * + * @return value type code with the agreed id, named "ObjectReferenceFactory", + * abstract, no members, no base type. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.create_value_tc(id(), "ObjectReferenceFactory", + VM_ABSTRACT.value, null, + new ValueMember[0]); + } + + /** + * Insert the ObjectReferenceFactory into the given Any. + * + * @param any the Any to insert into. + * @param that the ObjectReferenceFactory to insert. + */ + public static void insert(Any any, ObjectReferenceFactory that) + { + ObjectReferenceFactoryHolder h = new ObjectReferenceFactoryHolder(that); + any.insert_Streamable(h); + } + + /** + * Extract the ObjectReferenceFactory from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain ObjectReferenceFactory. + */ + public static ObjectReferenceFactory extract(Any any) + { + try + { + ObjectReferenceFactoryHolder h = + (ObjectReferenceFactoryHolder) (any.extract_Streamable()); + return h.value; + } + catch (ClassCastException ex) + { + BAD_OPERATION bad = + new BAD_OPERATION("ObjectReferenceFactory expected"); + bad.minor = Minor.Any; + bad.initCause(ex); + throw bad; + } + } + + /** + * Get the ObjectReferenceFactory repository id. + * + * @return "IDL:omg.org/PortableInterceptor/ObjectReferenceFactory:1.0", + * always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ObjectReferenceFactory:1.0"; + } + + /** + * Read the ObjectReferenceFactory from the CDR intput stream + * (ValueBase type expected). + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static ObjectReferenceFactory read(InputStream input) + { + return (ObjectReferenceFactory) Vio.read(input); + } + + /** + * Write the ObjectReferenceFactory to the CDR output stream (as a ValueBase). + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, ObjectReferenceFactory value) + { + Vio.write(output, value); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHolder.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHolder.java new file mode 100644 index 000000000..07be73a1d --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHolder.java @@ -0,0 +1,105 @@ +/* ObjectReferenceFactoryHolder.java -- + Copyright (C) 2005, 2006 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.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for the object {@link ObjectReferenceFactory}. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class ObjectReferenceFactoryHolder + implements Streamable +{ + /** + * The stored ObjectReferenceFactory value. + */ + public ObjectReferenceFactory value; + + /** + * Create the unitialised instance, leaving the value field + * with default <code>null</code> value. + */ + public ObjectReferenceFactoryHolder() + { + } + + /** + * Create the initialised instance. + * @param initialValue the value that will be assigned to + * the <code>value</code> field. + */ + public ObjectReferenceFactoryHolder(ObjectReferenceFactory initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link #value} by data from the CDR stream. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = ObjectReferenceFactoryHelper.read(input); + } + + /** + * Write the stored value into the CDR stream. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + ObjectReferenceFactoryHelper.write(output, value); + } + + /** + * Get the typecode of the ObjectReferenceFactory. + */ + public org.omg.CORBA.TypeCode _type() + { + return ObjectReferenceFactoryHelper.type(); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplate.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplate.java new file mode 100644 index 000000000..42ffdfd7e --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplate.java @@ -0,0 +1,78 @@ +/* ObjectReferenceTemplate.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.PortableServer.POA; + +/** + * Defines the identity of the portable object adapter ({@link POA}}. The + * adapter name, orb id and server id together uniquely define the identity + * of this adapter. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ObjectReferenceTemplate + extends ObjectReferenceFactory +{ + /** + * Get the name of this adapter. This name can be set by specifying + * the org.omg.CORBA.ORBid property in the ORB.Init(.., Properties). + * The default value includes the hashcode of the ORB instance and hence + * should normally differ for each ORB. + * + * @return the name of adapter, represented in the form of the string array. + */ + String[] adapter_name(); + + /** + * The id of the {@link org.omg.CORBA.ORB} of this adapter. + * + * @return the ORB id, represented in the form of string. + */ + String orb_id(); + + /** + * Get the server id of of this adapter. This name can be set by specifying + * the org.omg.CORBA.ServerId property in the ORB.Init(.., Properties) or + * in the system property. All ORB's on the same jre share the same value. + * + * @return the server id, represented in the form of string. + */ + String server_id(); +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java new file mode 100644 index 000000000..86b00c50a --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java @@ -0,0 +1,136 @@ +/* ObjectReferenceTemplateHelper.java -- + Copyright (C) 2005, 2006 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.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.VM_ABSTRACT; +import org.omg.CORBA.ValueMember; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the CORBA object + * {@link ObjectReferenceTemplate}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectReferenceTemplateHelper +{ + /** + * Get the type code of the {@link ObjectReferenceTemplate}. + * + * @return value type type code, named ObjectReferenceTemplate, no members, + * abstract. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.create_value_tc(id(), "ObjectReferenceTemplate", + VM_ABSTRACT.value, null, + new ValueMember[0]); + } + + /** + * Insert the ObjectReferenceTemplate into the given Any. + * + * @param any the Any to insert into. + * @param that the ObjectReferenceTemplate to insert. + */ + public static void insert(Any any, ObjectReferenceTemplate that) + { + any.insert_Streamable(new ObjectReferenceTemplateHolder(that)); + } + + /** + * Extract the ObjectReferenceTemplate from given Any. + * + * @throws BAD_OPERATION if the passed Any does not + * contain ObjectReferenceTemplate. + */ + public static ObjectReferenceTemplate extract(Any any) + { + try + { + ObjectReferenceTemplateHolder h = + (ObjectReferenceTemplateHolder) any.extract_Streamable(); + return h.value; + } + catch (ClassCastException ex) + { + BAD_OPERATION bad = + new BAD_OPERATION("ObjectReferenceTemplate expected"); + bad.minor = Minor.Any; + bad.initCause(ex); + throw bad; + } + } + + /** + * Get the ObjectReferenceTemplate repository id. + * + * @return "IDL:omg.org/PortableInterceptor/ObjectReferenceTemplate:1.0", + * always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ObjectReferenceTemplate:1.0"; + } + + /** + * Read the object reference template (as the value type). + */ + public static ObjectReferenceTemplate read(InputStream input) + { + return (ObjectReferenceTemplate) + ((org.omg.CORBA_2_3.portable.InputStream) input).read_value(); + } + + /** + * Write the object reference template (as the value type). + */ + public static void write(OutputStream output, ObjectReferenceTemplate value) + { + ((org.omg.CORBA_2_3.portable.OutputStream) output). + write_value(value); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHolder.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHolder.java new file mode 100644 index 000000000..32b769eb6 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHolder.java @@ -0,0 +1,103 @@ +/* ObjectReferenceTemplateHolder.java -- + Copyright (C) 2005, 2006 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.Streamable; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + + /** + * A holder for the object {@link ObjectReferenceTemplate}. + * +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class ObjectReferenceTemplateHolder + implements Streamable +{ + /** + * The stored ObjectReferenceTemplate value. + */ + public ObjectReferenceTemplate value; + + /** + * Create the unitialised instance, leaving the value field + * with default <code>null</code> value. + */ + public ObjectReferenceTemplateHolder() + { + } + + /** + * Create the initialised instance. + * @param initialValue the value that will be assigned to + * the <code>value</code> field. + */ + public ObjectReferenceTemplateHolder(ObjectReferenceTemplate initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link #value} by data from the CDR stream. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = ObjectReferenceTemplateHelper .read(input); + } + + /** + * Write the stored value into the CDR stream. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + ObjectReferenceTemplateHelper .write(output, value); + } + + /** + * Get the typecode of the ObjectReferenceTemplate. + */ + public org.omg.CORBA.TypeCode _type() + { + return ObjectReferenceTemplateHelper .type(); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHelper.java new file mode 100644 index 000000000..c16638fdf --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHelper.java @@ -0,0 +1,160 @@ +/* ObjectReferenceTemplateSeqHelper.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.Minor; +import gnu.CORBA.typecodes.GeneralTypeCode; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with the array of object reference + * templates. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectReferenceTemplateSeqHelper +{ + /** + * Extract the <code>ObjectReferenceTemplate[]</code> from the given + * {@link Any}. This implementation expects the {@link Any} to hold the + * instance of {@link ObjectReferenceTemplateSeqHolder} that is returned by + * {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws BAD_OPERATION if the Any contains something other than the the + * {@link ObjectReferenceTemplateSeqHolder}. + */ + public static ObjectReferenceTemplate[] extract(Any a) + { + try + { + ObjectReferenceTemplateSeqHolder h = (ObjectReferenceTemplateSeqHolder) + a.extract_Streamable(); + return h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION( + "ObjectReferenceTemplate[] expected"); + bad.initCause(cex); + bad.minor = Minor.Any; + throw bad; + } + } + + /** + * Returns the object reference template sequence repository Id. + * + * @return "IDL:omg.org/PortableInterceptor/ObjectReferenceTemplateSeq:1.0", + * always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ObjectReferenceTemplateSeq:1.0"; + } + + /** + * Insert into the given <code>ObjectReferenceTemplate[]</code> into the + * given {@link Any}. This implementation first creates a + * {@link ObjectReferenceTemplateSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, ObjectReferenceTemplate[] that) + { + ObjectReferenceTemplateSeqHolder holder = + new ObjectReferenceTemplateSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>ObjectReferenceTemplate[]</code> from the CORBA input + * stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static ObjectReferenceTemplate[] read(InputStream input) + { + ObjectReferenceTemplate[] value = + new ObjectReferenceTemplate[input.read_long()]; + for (int i = 0; i < value.length; i++) + value[i] = ObjectReferenceTemplateHelper.read(input); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, corresponding the CORBA + * <code>ObjectReferenceTemplate[]</code>. The length of the sequence is + * left with the initial value 0. + */ + public static TypeCode type() + { + GeneralTypeCode t = new GeneralTypeCode(TCKind.tk_sequence); + t.setId(id()); + t.setLength(0); + t.setContentType(ObjectReferenceTemplateHelper.type()); + return t; + } + + /** + * Writes the <code>ObjectReferenceTemplate[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, ObjectReferenceTemplate[] value) + { + output.write_long(value.length); + + for (int i = 0; i < value.length; i++) + ObjectReferenceTemplateHelper.write(output, value[i]); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHolder.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHolder.java new file mode 100644 index 000000000..5f175d429 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHolder.java @@ -0,0 +1,104 @@ +/* ObjectReferenceTemplateSeqHolder.java -- + Copyright (C) 2005, 2006 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.Streamable; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A holder for the array of {@link ObjectReferenceTemplate}s. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class ObjectReferenceTemplateSeqHolder + implements Streamable +{ + /** + * The stored ObjectReferenceTemplate value. + */ + public ObjectReferenceTemplate[] value; + + /** + * Create the unitialised instance, leaving the value field with default + * <code>null</code> value. + */ + public ObjectReferenceTemplateSeqHolder() + { + } + + /** + * Create the initialised instance. + * + * @param initialValue the value that will be assigned to the + * <code>value</code> field. + */ + public ObjectReferenceTemplateSeqHolder(ObjectReferenceTemplate[] initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link #value} by data from the CDR stream. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = ObjectReferenceTemplateSeqHelper.read(input); + } + + /** + * Write the stored value into the CDR stream. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + ObjectReferenceTemplateSeqHelper.write(output, value); + } + + /** + * Get the typecode of the ObjectReferenceTemplate. + */ + public org.omg.CORBA.TypeCode _type() + { + return ObjectReferenceTemplateSeqHelper.type(); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/PolicyFactory.java b/libjava/classpath/org/omg/PortableInterceptor/PolicyFactory.java new file mode 100644 index 000000000..dcb110185 --- /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 +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/PolicyFactoryOperations.java b/libjava/classpath/org/omg/PortableInterceptor/PolicyFactoryOperations.java new file mode 100644 index 000000000..49940e83d --- /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; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/RequestInfo.java b/libjava/classpath/org/omg/PortableInterceptor/RequestInfo.java new file mode 100644 index 000000000..22f108a48 --- /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 +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java new file mode 100644 index 000000000..851f46602 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java @@ -0,0 +1,191 @@ +/* RequestInfoOperations.java -- + Copyright (C) 2005, 2006 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.NO_RESOURCES; +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(); +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/SUCCESSFUL.java b/libjava/classpath/org/omg/PortableInterceptor/SUCCESSFUL.java new file mode 100644 index 000000000..64ff72ab3 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/SUCCESSFUL.java @@ -0,0 +1,54 @@ +/* SUCCESSFUL.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; + + +/** + * A reply status flag, indicating, that the remote method + * has been called and returned without exception. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface SUCCESSFUL +{ + /** + * Specifies the SUCCESSFUL value, 0. + */ + short value = 0; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/SYSTEM_EXCEPTION.java b/libjava/classpath/org/omg/PortableInterceptor/SYSTEM_EXCEPTION.java new file mode 100644 index 000000000..10f8dcea0 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/SYSTEM_EXCEPTION.java @@ -0,0 +1,55 @@ +/* SYSTEM_EXCEPTION.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; + + +/** + * A reply status flag, indicating, that the + * {@link org.omg.CORBA.SystemException} + * has been thrown while calling or from inside the remote method. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface SYSTEM_EXCEPTION +{ + /** + * Specifies the SYSTEM_EXCEPTION value, 1. + */ + short value = 1; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerIdHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ServerIdHelper.java new file mode 100644 index 000000000..34240e81a --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ServerIdHelper.java @@ -0,0 +1,119 @@ +/* ServerIdHelper.java -- + Copyright (C) 2005, 2006 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.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The Server Id is defined in OMG specification just as a narrow (not wide) + * string. As such, the Server Id needs no helper, but one is included in + * the API anyway. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ServerIdHelper +{ + /** + * Insert the Server Id into Any (uses {@link Any#insert_string}). + * + * @param a the Any to insert into. + * @param that the string to insert. + */ + public static void insert(Any a, String that) + { + a.insert_string(that); + } + + /** + * Extract the Server Id from Any ((uses {@link Any#extract_string}). + * + * @param a the Any to extract from. + */ + public static String extract(Any a) + { + return a.extract_string(); + } + + /** + * Return an alias typecode. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "ServerId", orb.create_string_tc(0)); + } + + /** + * Return the Server Id repository id. + * @return "IDL:omg.org/PortableInterceptor/ServerId:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ServerId:1.0"; + } + + /** + * Calls {@link InputStream#read_string()}. + * + * @param input the stream to read from. + */ + public static String read(InputStream input) + { + return input.read_string(); + } + + /** + * Calls {@link OutputStream#write_string(String)}. + * + * @param output the stream to write into. + * @param value the string (Server Id) value to write. + */ + public static void write(OutputStream output, String value) + { + output.write_string(value); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfo.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfo.java new file mode 100644 index 000000000..9136ca7e0 --- /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 +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java new file mode 100644 index 000000000..e03145e86 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java @@ -0,0 +1,327 @@ +/* ServerRequestInfoOperations.java -- + Copyright (C) 2005, 2006 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; +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 id 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(); + + /** + * Returns the name of the adapter that is handling the current request. + * The name is returned as a string array, representing full path from + * the root poa till the current poa, for instance + * {"RootPOA", "childPOA","grandchildPOA"}. + */ + public String[] adapter_name(); + + /** + * Returns the id of the ORB that is handling the current request. The ORB + * id can be specified as the property org.omg.CORBA.ORBid when creating + * the ORB. + */ + public String orb_id(); + + /** + * Returs the id of the server that is handling the current request. The server + * id is the same for all POAs and ORBs in the current virtual machine and + * can be set as the property org.omg.CORBA.ServerId when creating one of the + * ORBs. + */ + public String server_id(); +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptor.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptor.java new file mode 100644 index 000000000..db6c7a7d6 --- /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 +{ +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java new file mode 100644 index 000000000..e6af9503d --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java @@ -0,0 +1,136 @@ +/* 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; + +import org.omg.CORBA.SystemException; + + +/** + * 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; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/TRANSPORT_RETRY.java b/libjava/classpath/org/omg/PortableInterceptor/TRANSPORT_RETRY.java new file mode 100644 index 000000000..047ed20e9 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/TRANSPORT_RETRY.java @@ -0,0 +1,55 @@ +/* TRANSPORT_RETRY.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; + + +/** + * A reply status, indicating the necessity of the transport retry. + * This may happen, for example, if the GIOP message status flag + * is equal to NEEDS_ADDRESSING_MODE. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface TRANSPORT_RETRY +{ + /** + * Specifies the TRANSPORT_RETRY value, 4. + */ + short value = 4; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/USER_EXCEPTION.java b/libjava/classpath/org/omg/PortableInterceptor/USER_EXCEPTION.java new file mode 100644 index 000000000..44c3018a9 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/USER_EXCEPTION.java @@ -0,0 +1,55 @@ +/* USER_EXCEPTION.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; + + +/** + * A reply status flag, indicating, that the + * {@link org.omg.CORBA.UserException} + * has been thrown from inside the remote method. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface USER_EXCEPTION +{ + /** + * Specifies the USER_EXCEPTION value, 2. + */ + short value = 2; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/_IORInterceptor_3_0Stub.java b/libjava/classpath/org/omg/PortableInterceptor/_IORInterceptor_3_0Stub.java new file mode 100644 index 000000000..9e8fa0399 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/_IORInterceptor_3_0Stub.java @@ -0,0 +1,272 @@ +/* _IORInterceptor_3_0Stub.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.MARSHAL; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.Delegate; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; + +import java.io.Serializable; + +/** + * The IORInterceptor_3_0 stub (proxy), used on the client side. The + * {@link IORInterceptor_3_0} methods contain the code for remote invocaton. The + * stub is required by {@link IORInterceptor_3_0Helper} .read, .narrow and + * .unchecked_narrow methods. + * + * @specnote Being not specified in 1.5 API, this class is package private. + * From that happened to some other stubs, it will likely to appear in the 1.6 + * or later. Because of this, it is placed here. + * + * @specnote The stub and the helper support the existence of the interceptor + * on the remote side only. To support the corresponding support on the side + * where the ORB is registered with this interceptor, you also need + * _IORInfoStub, IORInfoHelper and either servants or implementation bases + * for both POA and IORInfo. These classes are not defined in the 1.5 API, + * hence they are not included. You may need to generate the manually from + * the IDL descriptions, available from + * http://www.omg.org/docs/formal/04-03-12.pdf. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +class _IORInterceptor_3_0Stub + extends ObjectImpl + implements IORInterceptor_3_0, Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1; + + /** + * Create the IORInterceptor_3_0 stub. To get the stub working, you must later + * set the delegate with {@link ObjectImpl#_set_delegate(Delegate)}. + */ + public _IORInterceptor_3_0Stub() + { + } + + /** + * Create the naming context stub with the given delegate. + */ + public _IORInterceptor_3_0Stub(Delegate delegate) + { + _set_delegate(delegate); + } + + /** + * Return the array of repository ids for this object. + */ + public String[] _ids() + { + return new String[] { IORInterceptor_3_0Helper.id() }; + } + + /** {@inheritDoc} */ + public void adapter_manager_state_changed(int adapterManagerId, + short adapterState) + { + InputStream input = null; + try + { + OutputStream output = _request("adapter_manager_state_changed", true); + output.write_long(adapterManagerId); + output.write_short(adapterState); + input = _invoke(output); + + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + adapter_manager_state_changed(adapterManagerId, adapterState); + } + finally + { + _releaseReply(input); + } + } + + /** {@inheritDoc} */ + public void adapter_state_changed(ObjectReferenceTemplate[] adapters, + short adaptersState) + { + InputStream input = null; + try + { + OutputStream output = _request("adapter_state_changed", true); + output.write_long(adapters.length); + for (int i0 = 0; i0 < adapters.length; i0++) + ObjectReferenceTemplateHelper.write(output, adapters[i0]); + output.write_short(adaptersState); + input = _invoke(output); + + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + adapter_state_changed(adapters, adaptersState); + } + finally + { + _releaseReply(input); + } + } + + /** {@inheritDoc} */ + public void components_established(IORInfo info) + { + InputStream input = null; + try + { + OutputStream output = _request("components_established", true); + output.write_Object(info); + input = _invoke(output); + + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + components_established(info); + } + finally + { + _releaseReply(input); + } + } + + /** {@inheritDoc} */ + public void establish_components(IORInfo info) + { + InputStream input = null; + try + { + OutputStream output = _request("establish_components", true); + output.write_Object(info); + input = _invoke(output); + + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + establish_components(info); + } + finally + { + _releaseReply(input); + } + } + + /** {@inheritDoc} */ + public String name() + { + InputStream input = null; + try + { + OutputStream output = _request("name", true); + input = _invoke(output); + String returns = input.read_string(); + + return returns; + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + return name(); + } + finally + { + _releaseReply(input); + } + } + + /** {@inheritDoc} */ + public void destroy() + { + InputStream input = null; + try + { + OutputStream output = _request("destroy", true); + input = _invoke(output); + + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + destroy(); + } + finally + { + _releaseReply(input); + } + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/package.html b/libjava/classpath/org/omg/PortableInterceptor/package.html new file mode 100644 index 000000000..b29c84fbf --- /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> |