From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001
From: upstream source tree
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * These property names are of the form
+ * org.omg.PortableInterceptor.ORBInitializerClass.<Service>String[]
) 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 (String[]
) 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 String[]
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 String[]
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 short
,
+ * 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 short
into the given Any.
+ */
+ public static void insert(Any any, short that)
+ {
+ any.insert_short(that);
+ }
+
+ /**
+ * Extract the short
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 short
(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 short
(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.
+ *
+ *
+ *
+ *
+ *
+ *
+ * {@linkplain ClientRequestInterceptorOperations#send_request send_request}
+ * {@linkplain ClientRequestInterceptorOperations#send_poll send_poll}
+ * {@linkplain ClientRequestInterceptorOperations#receive_reply receive_reply}
+ * {@linkplain ClientRequestInterceptorOperations#receive_exception receive_exception}
+ * {@linkplain ClientRequestInterceptorOperations#receive_other receive_other}
+ *
+ *
+ * Inherited from
+ * {@linkplain RequestInfoOperations}:
+ *
+ *
+ * {@linkplain RequestInfoOperations#arguments arguments}
+ * yes 1
+ * no
+ * yes
+ * no
+ * no
+ *
+ *
+ * {@linkplain RequestInfoOperations#exceptions exceptions}
+ * yes
+ * no
+ * yes
+ *
+ *
+ * {@linkplain RequestInfoOperations#contexts contexts}
+ * yes
+ * no
+ * yes
+ *
+ *
+ *
+ * {@linkplain RequestInfoOperations#operation_context operation_context}
+ * yes
+ * no
+ * yes
+ *
+ *
+ * {@linkplain RequestInfoOperations#result result}
+ * no
+ * no
+ * yes
+ * no
+ * no
+ *
+ *
+ *
+ * {@linkplain RequestInfoOperations#sync_scope sync_scope}
+ * yes
+ * no
+ * yes
+ *
+ *
+ * {@linkplain RequestInfoOperations#reply_status reply_status}
+ * no
+ * no
+ * yes
+ *
+ *
+ * {@linkplain RequestInfoOperations#forward_reference forward_reference}
+ * no
+ * no
+ * yes 2
+ *
+ *
+ * {@linkplain RequestInfoOperations#get_request_service_context get_request_service_context}
+ * yes
+ * no
+ * yes
+ *
+ *
+ *
+ * {@linkplain RequestInfoOperations#get_reply_service_context get_reply_service_context}
+ * no
+ * no
+ * yes
+ *
+ *
+ * {@linkplain RequestInfoOperations#request_id request_id}
+ * yes
+ *
+ *
+ * {@linkplain RequestInfoOperations#operation operation}
+ * yes
+ *
+ *
+ * {@linkplain RequestInfoOperations#response_expected response_expected}
+ * yes
+ *
+ *
+ * {@linkplain RequestInfoOperations#get_slot get_slot}
+ * yes
+ *
+ *
+ * ClientRequestInfo-specific:
+ *
+ *
+ * {@linkplain #target target}
+ * yes
+ *
+ *
+ * {@linkplain #effective_target effective_target}
+ * yes
+ *
+ *
+ * {@linkplain #effective_profile effective_profile}
+ * yes
+ *
+ *
+ * {@linkplain #received_exception received_exception}
+ * no
+ * yes
+ * no
+ *
+ *
+ * {@linkplain #received_exception_id received_exception_id}
+ * no
+ * yes
+ * no
+ *
+ *
+ * {@linkplain #get_effective_component get_effective_component}
+ * yes
+ * no
+ * yes
+ *
+ *
+ * {@linkplain #get_effective_components get_effective_components}
+ * yes
+ * no
+ * yes
+ *
+ *
+ * {@linkplain #get_request_policy get_request_policy}
+ * yes
+ * no
+ * yes
+ *
+ *
+ * {@linkplain #add_request_service_context add_request_service_context}
+ * yes
+ * no
+ *
+ *
+ *
+ * {@linkplain ClientRequestInterceptorOperations#send_request send_request}
+ * {@linkplain ClientRequestInterceptorOperations#send_poll send_poll}
+ * {@linkplain ClientRequestInterceptorOperations#receive_reply receive_reply}
+ * {@linkplain ClientRequestInterceptorOperations#receive_exception receive_exception}
+ * {@linkplain ClientRequestInterceptorOperations#receive_other receive_other}
+ *
+ *
+ *
+ * @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;
+
+/**
+ * null
value.
+ */
+ public IORInterceptor_3_0Holder()
+ {
+ }
+
+ /**
+ * Create the initialised instance.
+ *
+ * @param initialValue the value that will be assigned to the
+ * value
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;
+
+/**
+ * ORB.init(..)
, the properties
+ * begining with org.omg.PortableInterceptor.ORBInitializerClass are
+ * collected, the <Service> portion of each property is extracted,
+ * the initialiser is instantiated with the <Service> string as its
+ * class name and then pre_init
and post_init
+ * (defined in {@link ORBInitializerOperations}) are called on that initializer.
+ * The runtime exceptions, thrown by these two methods, are ignored.
+ *
+ *
+ * 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.
+ * }
+ * }
+ *
+ * + * Then, one of the used set of properties then must contain the property, named + * + * org.omg.PortableInterceptor.ORBInitializerClass.gnu.x.Logging.LoggingService + * . + * The value of the property is ignored and may empty string. The + * agreed locations, where this property will be searched for, are: + *
+ * 1. The properties parameter in the ORB.init(..), if any.
+ * 2. The System properties.
+ * 3. The orb.properties file located in the user.home directory (if any).
+ * 4. The orb.properties file located in the java.home/lib directory (if any).
+ *
+ * The applet parameters and command line arguments are not scanned + * for the possible initializers. + *
+ *+ * 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. + *
+ *+ * The registration code should not call directly any methods on the ORB being + * registered. + *
+ *+ * The new interceptors cannot be registered after the ORB.init(..) returns. + *
+ * + * @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 not 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 defaultnull
value.
+ */
+ public ObjectReferenceFactoryHolder()
+ {
+ }
+
+ /**
+ * Create the initialised instance.
+ * @param initialValue the value that will be assigned to
+ * the value
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 null
value.
+ */
+ public ObjectReferenceTemplateHolder()
+ {
+ }
+
+ /**
+ * Create the initialised instance.
+ * @param initialValue the value that will be assigned to
+ * the value
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 ObjectReferenceTemplate[]
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 ObjectReferenceTemplate[]
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 ObjectReferenceTemplate[]
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
+ * ObjectReferenceTemplate[]
. 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 ObjectReferenceTemplate[]
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
+ * null
value.
+ */
+ public ObjectReferenceTemplateSeqHolder()
+ {
+ }
+
+ /**
+ * Create the initialised instance.
+ *
+ * @param initialValue the value that will be assigned to the
+ * value
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.
+ *
+ * + * | {@link ServerRequestInterceptorOperations#receive_request_service_contexts receive_request_ service_contexts} |
+ * {@link ServerRequestInterceptorOperations#receive_request receive_request} | + *{@link ServerRequestInterceptorOperations#send_reply send_reply} | + *{@link ServerRequestInterceptorOperations#send_exception send_exception} | + *{@link ServerRequestInterceptorOperations#send_other send_other} | + *
---|---|---|---|---|---|
Inherited from + * {@link RequestInfoOperations}: | + *|||||
{@linkplain RequestInfoOperations#arguments arguments} | + *no | + *yes1 | + *yes | + *no2 | + *no2 | + *
{@linkplain RequestInfoOperations#exceptions exceptions} | + *no | + *yes | + *|||
{@linkplain RequestInfoOperations#contexts contexts} | + *no | + *yes | + *|||
{@linkplain RequestInfoOperations#operation_context operation_context} | + *no | + *yes | + *yes | + *no | + *no | + *
{@linkplain RequestInfoOperations#result result} | + *no | + *no | + *yes | + *no | + *no | + *
{@linkplain RequestInfoOperations#reply_status reply_status} | + *no | + *no | + *yes | *||
{@linkplain RequestInfoOperations#forward_reference forward_reference} | + *no | + *yes2 | + *|||
{@linkplain RequestInfoOperations#get_request_service_context get_request_service_context} | + *yes | + *no | + *yes | *||
{@linkplain RequestInfoOperations#get_reply_service_context get_reply_service_context} | + *no | + *no | + *yes | + *||
{@linkplain RequestInfoOperations#request_id request_id} | + *yes | + *||||
{@linkplain RequestInfoOperations#operation operation} | + *yes | + *||||
{@linkplain RequestInfoOperations#response_expected response_expected} | + *yes | + *||||
{@linkplain RequestInfoOperations#sync_scope sync_scope} | + *yes | + *||||
{@linkplain RequestInfoOperations#get_slot get_slot} | + *yes | + *||||
+ * ServerRequestInfo-specific: | + *|||||
{@linkplain #get_server_policy get_server_policy} | + *yes | + *||||
{@linkplain #add_reply_service_context add_reply_service_context} | + *yes | + *||||
{@linkplain #set_slot set_slot} | + *yes | + *||||
{@linkplain #sending_exception sending_exception} | + *no | + *yes | + *no | + *||
{@linkplain #object_id object_id} | + *no | + *yes | + *yes | + *yes3 | + *yes3 | + *
{@linkplain #adapter_id adapter_id} | + *no | + *yes | + *yes | + *yes3 | + *yes3 | + *
{@linkplain #target_most_derived_interface target_most_derived_interface} | + *no | + *yes | + *no | + *||
{@linkplain #target_is_a target_is_a} | + *no | + *yes | + *no | + *||
+ * | {@link ServerRequestInterceptorOperations#receive_request_service_contexts receive_request_ service_contexts } |
+ * {@link ServerRequestInterceptorOperations#receive_request receive_request} | + *{@link ServerRequestInterceptorOperations#send_reply send_reply} | + *{@link ServerRequestInterceptorOperations#send_exception send_exception} | + *{@link ServerRequestInterceptorOperations#send_other send_other} | + *