From 9b044d19517541c95681d35a92dbc81e6e21d94f Mon Sep 17 00:00:00 2001
From: Tom Tromey
+ * The DynAny interface provides possibility to access the components of the
+ * CORBA object, stored inside the {@link Any}. The DynAny and derived classes
+ * additionally allows to access the members of the sequence, structure, union
+ * and get the data about enumeration, value type and CORBA
+ * The DynAny's are usually produced by {@link DynAnyFactory}. This factory is
+ * obtained from the ORB:
+ * DynAny can also be returned by a method, invoked on another DynAny.
+ * Get the value of discriminator, defining which content variant
+ * (member) is active.
+ *
+ * In the current implementation, the later changes on the returned value
+ * alter the state of the union via implemented internal listener.
+ * Set the value of discriminator, activating the member variant that is
+ * consistent with the discriminator value. If the current member variant
+ * matches the discriminator being set, it is unchanged. Otherwise, it is
+ * replaced by the matching member variant with fields, initialised to default
+ * values. The current position is set to 0 if the discriminator value does
+ * not match any member variant. Otherwise, the current position is set to 1,
+ * index of the member variant.
+ * DynAny's allow to work with data structures, exact content of those is not
+known at the time of compilation. In this way, the conception of DynAny
+remebers the java reflection mechanism. DynAny usually obtain the value from
+the {@link org.omg.CORBA.Any} that, if needed, can carry highly nested data
+structures (like array of sequences of unions). DynAny's allow to see/modify
+all parts of such structures. This is especially helpful for writing generic
+servers (bridges, event channels supporting, filtering and so on). Similarly,
+DynAny's can create an Any at runtime, without having static knowledge of its
+type. This is helpful for writing generic clients like browsers, debuggers or
+ user interface tools.
+
+The API clearly states that DynAny and DynAnyFactory objects are local and
+cannot be transferred to remote server or client. While such methods are
+formally defined in the corresponding helpers, they simply always throw MARSHAL.
+
+DynAny's are created by {@link DynAnyFactory}. The factory is obtaines by
+{@link org.omg.CORBA.ORB#resolve_initial_references):
+
+The primitive types like string or char are wrapped into an ordinary DynAny. It
+has multiple methods for setting/getting the content like
+{@link DynAnyOperations#get_string()} or
+{@link DynAnyOperations#insert_string(String)}. The more complex types like
+sequences or structures are wrapped into specialised DynAny's, providing means
+to access the enclosed members. In this case, the DynAny has the
+"internal cursor", normally pointing at one of the members in the data
+structure. The "internal cursor" can be set to the needed position
+{@link DynAnyOperations#seek(int)} or advanced forward
+({@link DynAnyOperations#next()}. The member under cursor is returned by
+{@link DynAnyOperations#current_component()}. For composite DynAnys the
+methods like {@link DynAnyOperations#get_string()} or
+{@link DynAnyOperations#insert_string(String)} apply to the selected member,
+not to the complex DynAny in general.
+
+DynAnys are created and optimized for traversing values extracted from anys
+or constructing values of anys at runtime. OMG does not recommend to use them
+for other purposes.
+
+@author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+
+
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfo.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfo.java
new file mode 100644
index 0000000..dd3cd58
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfo.java
@@ -0,0 +1,54 @@
+/* ClientRequestInfo.java --
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package org.omg.PortableInterceptor;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Provides request information, accessible for the
+ * {@link ClientRequestInterceptor}.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface ClientRequestInfo extends ClientRequestInfoOperations,
+ org.omg.CORBA.Object,
+ IDLEntity,
+ RequestInfo
+{
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java
new file mode 100644
index 0000000..73efa12
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInfoOperations.java
@@ -0,0 +1,328 @@
+/* ClientRequestInfoOperations.java --
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package org.omg.PortableInterceptor;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.INV_POLICY;
+import org.omg.CORBA.Policy;
+import org.omg.IOP.ServiceContext;
+import org.omg.IOP.TaggedComponent;
+import org.omg.IOP.TaggedProfile;
+
+/**
+ * Provides request information, accessible for the
+ * {@linkplain ClientRequestInterceptor}. Some methods of this interface are
+ * not valid at all interception points. The following table shows the validity
+ * of each method. If it is not valid, BAD_INV_ORDER minor 14 will be thrown.
+ *
+ *
+ * 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>fixed
+ * without knowing the exact type at the run time. The returned members are also
+ * wrapped into DynAny objects, allowing them to be the nested structures.
+ *
+ *
+ * DynAnyFactory f = DynAnyFactoryHelper.narrow
+ * (orb.resolve_initial_references("DynAnyFactory"));
+ *
+ *
+ *
+ *
+ * @param type the type of the data being stored.
+ *
+ * @return the created DynAny, having the passed type.
+ *
+ * @throws InconsistentTypeCode if type.kind() is tk_Principal, tk_native or
+ * tk_abstract_interface. These types cannot be stored in DynAny.
+ */
+ DynAny create_dyn_any_from_type_code(TypeCode type)
+ throws InconsistentTypeCode;
+
+ /**
+ * Create DynAny using the given Any as template.
+ *
+ * @param value the Any, providing type and value for the DynAny being
+ * created.
+ *
+ * @return the created DynAny, having the same type and storing the same value
+ * as the passed Any.
+ *
+ * @throws InconsistentTypeCode if value.type().kind() is tk_Principal,
+ * tk_native or tk_abstract_interface. These types cannot be stored in DynAny.
+ */
+ DynAny create_dyn_any(Any value)
+ throws InconsistentTypeCode;
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java
new file mode 100644
index 0000000..ca48cd4
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java
@@ -0,0 +1,152 @@
+/* DynAnyHelper.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.DynamicAny;
+
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Any;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+ * The helper operations for {@link DynAny}. Following the 1.5 JDK
+ * specifications, DynAny is always a local object, so the two methods of this
+ * helper ({@link #read} and {@link #write} are not in use, always throwing
+ * {@link MARSHAL}.
+ *
+ * @specnote always throwing MARSHAL in read and write ensures compatibility
+ * with other popular implementations like Sun's.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class DynAnyHelper
+{
+ /**
+ * Cast the passed object into the DynAny. As DynAny is a local object, the
+ * method just uses java type cast.
+ *
+ * @param obj the object to narrow.
+ * @return narrowed instance.
+ * @throws BAD_PARAM if the passed object is not a DynAny.
+ */
+ public static DynAny narrow(org.omg.CORBA.Object obj)
+ {
+ try
+ {
+ return (DynAny) obj;
+ }
+ catch (ClassCastException cex)
+ {
+ throw new BAD_PARAM(obj.getClass().getName() + " is not a DynAny");
+ }
+ }
+
+ /**
+ * Get the type code of the {@link DynAny}.
+ */
+ public static TypeCode type()
+ {
+ return ORB.init().create_interface_tc(id(), "DynAny");
+ }
+
+ /**
+ * Insert the DynAny into the given Any.
+ *
+ * @param any the Any to insert into.
+ *
+ * @param that the DynAny to insert.
+ */
+ public static void insert(Any any, DynAny that)
+ {
+ any.insert_Object(that);
+ }
+
+ /**
+ * Extract the DynAny from given Any.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain DynAny.
+ */
+ public static DynAny extract(Any any)
+ {
+ return narrow(any.extract_Object());
+ }
+
+ /**
+ * Get the DynAny repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/DynAny:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/DynAny:1.0";
+ }
+
+ /**
+ * This should read DynAny from the CDR input stream, but (following the JDK
+ * 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static DynAny read(InputStream input)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+
+ /**
+ * This should read DynAny from the CDR input stream, but (following the JDK
+ * 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static void write(OutputStream output, DynAny value)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyOperations.java b/libjava/classpath/org/omg/DynamicAny/DynAnyOperations.java
new file mode 100644
index 0000000..0e74313
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynAnyOperations.java
@@ -0,0 +1,540 @@
+/* DynAnyOperations.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.DynamicAny;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.TypeCode;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+import java.io.Serializable;
+
+/**
+ * Defines the operations, applicable to {@link DynAny}.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynAnyOperations
+{
+ /**
+ * Initialises the value of this DynAny with the value, stored inside the
+ * passed DynAny, making a shallow copy.
+ *
+ * @param from the DynAny to copy from.
+ * @throws TypeMismatch if the source DynAny is invalid.
+ */
+ void assign(DynAny from)
+ throws TypeMismatch;
+
+ /**
+ * Fully clones the content of this Any, returning a deep copy.
+ */
+ DynAny copy();
+
+ /**
+ * Returns the focused component of this DynAny. The DynAny has the internal
+ * pointer (reference) that can point to one of its components. The returned
+ * DynAny can be used to get or set the value of the focused component. If the
+ * DynAny holds a primitive type with no components, this implementation
+ * returns
+ *
+ *
+ * Type
+ * Value
+ * Creates
+ *
+ *
+ * boolean
+ * false
+ * {@link DynAny}
+ *
+ *
+ * numeric types, octet, fixed
+ * 0
+ * {@link DynAny}
+ *
+ *
+ * char, wchar
+ * (char) 0
+ * {@link DynAny}
+ *
+ *
+ * string, wstring
+ * empty string ("", not
+ * null){@link DynAny}
+ *
+ *
+ * {@link Any}
+ * {@link Any} with no value and typecode of kind {@link TCKind.tk_null}
+ * {@link DynAny}
+ *
+ *
+ * Sequence
+ * Empty (zero size) sequence
+ * {@link DynSequence}
+ *
+ *
+ * Array
+ * All members of array are recursively initialised to default values.
+ * {@link DynArray}
+ *
+ *
+ * Structure, exception
+ * All fields of the structure (if any) are recursively initialised to
+ * default values.
+ * {@link DynStruct}
+ *
+ *
+ * Enumeration
+ * Default value, indicated by typecode.
+ * {@link DynEnum}
+ *
+ *
+ * Union
+ * Default variant (indicated by typecode), recursively initialised to
+ * its default value.
+ * {@link DynUnion}
+ *
+ *
+ * Value, ValueBox
+ * null
+ * {@link DynValue}, {@link DynValueBox}
+ *
+ *
+ *
+ * TypeCode
+ * Typecode of kind
+ * TCKind.tk_null{@link DynValue}, {@link DynValueBox}
+ * null.
+ *
+ * @throws TypeMismatch if called on DynAny that cannot have active
+ * components, like {@link DynEnum}.
+ */
+ DynAny current_component()
+ throws TypeMismatch;
+
+ /**
+ * Destroys this DynAny, freeing the used resources. In java, resources are
+ * freed by the garbage collectors, so this method typically returns without
+ * action.
+ */
+ void destroy();
+
+ /**
+ * Makes a DynAny from the {@link Any}. The passed {@link Any} becomes the
+ * enclosed instance of this DynAny, allowing to change/traverse the
+ * {@link Any} fields by the {@link DynAny} methods.
+ *
+ * @throws TypeMismatch if the type of this DynAny differs from the type of
+ * the passed Any. The DynAny cannot be reused with the enclosed type
+ * different from that it was initially created.
+ * @throws InvalidValue if the value, stored in the passed parameter, is
+ * otherwise invalid.
+ */
+ void from_any(Any an_any)
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * This method is used when the wrapped Any contains an instance of another
+ * Any itself. The method returns this second enclosed Any.
+ *
+ * @throws TypeMismatch if the typecode of the accessed Any is not the same as
+ * the typecode of this DynAny.
+ */
+ Any get_any()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the boolean value that is expected to be stored in this DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ boolean get_boolean()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the char value that is expected to be stored in this DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ char get_char()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the double value that is expected to be stored in
+ * this DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ double get_double()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the float value that is expected to be stored in
+ * this DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ float get_float()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the int (CORBA long) value that is expected to be stored in this
+ * DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ int get_long()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the long (CORBA long long) value that is expected to be stored in
+ * this DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ long get_longlong()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the byte (CORBA octet) value that is expected to be stored in this
+ * DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ byte get_octet()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the CORBA object reference that is expected to be stored in this
+ * DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ org.omg.CORBA.Object get_reference()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the short value that is expected to be stored in
+ * this DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ short get_short()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the string value that is expected to be stored in this DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ String get_string()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the {@link TypeCode} value that is expected to be stored in this
+ * DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ TypeCode get_typecode()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the unsigned int (CORBA ulong) value that is expected to be stored
+ * in this DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ int get_ulong()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the unsingel long (CORBA unsigned long long )value that is expected
+ * to be stored in this DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ long get_ulonglong()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the unsigned short value that is expected to be stored in this
+ * DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ short get_ushort()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the value that is expected to be stored in this DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ Serializable get_val()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the wide (usually UTF-16) character value that is expected to be
+ * stored in this DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ char get_wchar()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Extract the wide (usually UFT-16) string that is expected to be stored in
+ * this DynAny.
+ *
+ * @throws TypeMismatch if this DynAny holds the value of the different type.
+ */
+ String get_wstring()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Insert the {@link Any} value into the enclosed {@link Any} inside this
+ * DynAny.
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_any(Any an_any)
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Insert the boolean value into the enclosed {@link Any} inside this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_boolean(boolean a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the char value into the enclosed {@link Any} inside this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_char(char a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the double value into the enclosed {@link Any} inside this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_double(double a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the float value into the enclosed {@link Any} inside this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_float(float a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the int (CORBA long) value into the enclosed {@link Any} inside this
+ * DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_long(int a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the long (CORBA long long) value into the enclosed {@link Any}
+ * inside this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_longlong(long a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the byte (CORBA octet) value into the enclosed {@link Any} inside
+ * this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_octet(byte a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the object reference into the enclosed {@link Any} inside this
+ * DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_reference(org.omg.CORBA.Object a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the short value into the enclosed {@link Any} inside
+ * this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_short(short a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the string value into the enclosed {@link Any} inside this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_string(String a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the {@link TypeCode} value into the enclosed {@link Any} inside this
+ * DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_typecode(TypeCode a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the int (CORBA unsinged long) value into the enclosed {@link Any}
+ * inside this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_ulong(int a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the long (CORBA unsigned long long) value into the enclosed
+ * {@link Any} inside this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_ulonglong(long a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the short (CORBA unsigned short) value into the enclosed {@link Any}
+ * inside this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_ushort(short a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the value into the enclosed {@link Any} inside this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_val(Serializable a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the wide char (usually UTF-16) value into the enclosed {@link Any}
+ * inside this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_wchar(char a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Insert the wide string (usually UTF-16) into the enclosed {@link Any}
+ * inside this DynAny
+ *
+ * @param a_x the value being inserted.
+ * @throws InvalidValue if the value type does not match the typecode of the
+ * enclosed {@link Any}.
+ */
+ void insert_wstring(String a_x)
+ throws InvalidValue, TypeMismatch;
+
+ /**
+ * Advances the internal pointer, described in the {@link current_component},
+ * one position forward.
+ *
+ * @return true if the pointer now points to the new component, false if there
+ * are no more components of this DynAny holds a basic type that is not
+ * divided into components.
+ */
+ boolean next();
+
+ /**
+ * Moves the internal pointer, described in the {@link current_component}, to
+ * the first component.
+ */
+ void rewind();
+
+ /**
+ * Moves the internal pointer, described in the {@link current_component}, to
+ * the given position.
+ *
+ * @param p the number of the internal component on that the internal pointer
+ * must be focused.
+ * @return true on success or false if there is no component with the given
+ * number. If the DynAny holds the basic type, this method returs false p
+ * values other than 0.
+ */
+ boolean seek(int p);
+
+ /**
+ * Returns a shallow copy of the enclosed {@link Any},
+ *
+ * @return shallow copy of the enclosed {@link Any}.
+ */
+ Any to_any();
+
+ /**
+ * Returns the typecode of the object, inserted into this DynAny.
+ *
+ * @return the typecode of the inserted {@link Any} or null typecode if no
+ * {@link Any has been yet inserted}.
+ */
+ TypeCode type();
+
+ /**
+ * Insert a value at the current position.
+ *
+ * @param insert_it a value to insert.
+ * @throws TypeMismatch if the component at the current position has a
+ * different type.
+ * @throws InvalidValue if the current position points nowhere.
+ */
+ void insert_dyn_any(DynAny insert_it)
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Checks for equality with another Dynamic Any.
+ *
+ *
+ * @specnote This method is currently only implemented only for case when
+ * another DynAny was created by the factory of this implementation and is not
+ * an independent class, just implementing interface. Otherwise, a
+ * NO_IMPLEMENT minor 8148 will be thrown. General implementation is highly
+ * ineffective, but we will do if somebody would ever need it.
+ */
+ boolean equal(DynAny other);
+
+ /**
+ * Get the number number of fields in the enclosed structure or number of
+ * memebers in the enclosed array, sequence, enumeration, etc. This method
+ * only counts elements at the top level. For instance, if invoked on a
+ * DynStruct with a single member, it returns 1, irrespective of the type of
+ * the member.
+ *
+ * @return number of components or 0 if the enclosed Any is not divideable.
+ */
+ int component_count();
+
+ /**
+ * Return DynAny, wrapping the second (enclosed any) that is stored in the
+ * wrapped Any.
+ *
+ * @throws TypeMismatch if the wrapped Any does not store another Any.
+ * @throws InvalidValue if the current position points nowhere.
+ */
+ DynAny get_dyn_any()
+ throws TypeMismatch, InvalidValue;
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java
new file mode 100644
index 0000000..87e3445
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java
@@ -0,0 +1,152 @@
+/* DynAnySeq.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.DynamicAny;
+
+import gnu.CORBA.DynAnySeqHolder;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+ * A helper operations for the array of {@link DynAny} ({@link DynAnySeq}).
+ * Following the 1.5 JDK specifications, DynAny (and hence an sequence of
+ * DynAny's) is always a local object, so the two methods of this helper
+ * ({@link #read} and {@link #write} are not in use, always throwing
+ * {@link MARSHAL}.
+ *
+ * @specnote always throwing MARSHAL in read and write ensures compatibility
+ * with other popular implementations like Sun's.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class DynAnySeqHelper
+{
+ /**
+ * The cached typecode value, computed only once.
+ */
+ private static TypeCode typeCode;
+
+ public static TypeCode type()
+ {
+ if (typeCode == null)
+ {
+ ORB orb = ORB.init();
+ TypeCode t = orb.create_sequence_tc(0, DynAnyHelper.type());
+ typeCode = orb.create_alias_tc(id(), "DynAnySeq", t);
+ }
+ return typeCode;
+ }
+
+ /**
+ * Insert the DynAnySeq into the given Any.
+ * This method uses the DynAnySeqHolder.
+ *
+ * @param any the Any to insert into.
+ * @param those the DynAny[] to insert.
+ */
+ public static void insert(Any any, DynAny[] those)
+ {
+ any.insert_Streamable(new DynAnySeqHolder(those));
+ }
+
+ /**
+ * Extract the DynAnySeq from given Any.
+ * This method uses the DynAnySeqHolder.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain DynAnySeq.
+ */
+ public static DynAny[] extract(Any any)
+ {
+ try
+ {
+ return ((DynAnySeqHolder) any.extract_Streamable()).value;
+ }
+ catch (ClassCastException cex)
+ {
+ BAD_OPERATION bad = new BAD_OPERATION("DynAnySeq expected");
+ bad.initCause(cex);
+ throw bad;
+ }
+ }
+
+ /**
+ * Get the DynAnySeq repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/DynAnySeq:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/DynAnySeq:1.0";
+ }
+
+ /**
+ * The method should read this object from the CDR input stream, but
+ * (following the JDK 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static DynAny[] read(InputStream input)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+
+ /**
+ * The method should write this object to the CDR input stream, but
+ * (following the JDK 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static void write(OutputStream output, DynAny[] value)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/DynArray.java b/libjava/classpath/org/omg/DynamicAny/DynArray.java
new file mode 100644
index 0000000..30b556a
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynArray.java
@@ -0,0 +1,54 @@
+/* DynArray.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.DynamicAny;
+
+import java.io.Serializable;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Represents a fixed size array. All components in the array have the same
+ * type.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynArray
+ extends DynArrayOperations, DynAny, IDLEntity, org.omg.CORBA.Object,
+ Serializable
+{
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java b/libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java
new file mode 100644
index 0000000..0372b58
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java
@@ -0,0 +1,151 @@
+/* DynArrayHelper.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.DynamicAny;
+
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Any;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+ * The helper operations for {@link DynArray}. Following the 1.5 JDK
+ * specifications, DynArray is always a local object, so the two methods of this
+ * helper ({@link #read} and {@link #write} are not in use, always throwing
+ * {@link MARSHAL}.
+ *
+ * @specnote always throwing MARSHAL in read and write ensures compatibility
+ * with other popular implementations like Sun's.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class DynArrayHelper
+{
+ /**
+ * Cast the passed object into the DynArray. As DynArray is a local object,
+ * the method just uses java type cast.
+ *
+ * @param obj the object to narrow.
+ * @return narrowed instance.
+ * @throws BAD_PARAM if the passed object is not a DynArray.
+ */
+ public static DynArray narrow(org.omg.CORBA.Object obj)
+ {
+ try
+ {
+ return (DynArray) obj;
+ }
+ catch (ClassCastException cex)
+ {
+ throw new BAD_PARAM(obj.getClass().getName() + " is not a DynArray");
+ }
+ }
+
+ /**
+ * Get the type code of the {@link DynArray}.
+ */
+ public static TypeCode type()
+ {
+ return ORB.init().create_interface_tc(id(), "DynArray");
+ }
+
+ /**
+ * Insert the DynArray into the given Any.
+ *
+ * @param any the Any to insert into.
+ *
+ * @param that the DynArray to insert.
+ */
+ public static void insert(Any any, DynArray that)
+ {
+ any.insert_Object(that);
+ }
+
+ /**
+ * Extract the DynArray from given Any.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain DynArray.
+ */
+ public static DynArray extract(Any any)
+ {
+ return narrow(any.extract_Object());
+ }
+
+ /**
+ * Get the DynArray repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/DynArray:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/DynArray:1.0";
+ }
+
+ /**
+ * This should read DynArray from the CDR input stream, but (following the JDK
+ * 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static DynArray read(InputStream input)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+
+ /**
+ * This should read DynArray from the CDR input stream, but (following the JDK
+ * 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static void write(OutputStream output, DynArray value)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/DynArrayOperations.java b/libjava/classpath/org/omg/DynamicAny/DynArrayOperations.java
new file mode 100644
index 0000000..1869303
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynArrayOperations.java
@@ -0,0 +1,93 @@
+/* DynArrayOperations.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.DynamicAny;
+
+import org.omg.CORBA.Any;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+/**
+ * Defines operations, applicable for {@link DynArray}.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynArrayOperations
+ extends DynAnyOperations
+{
+ /**
+ * Returns the array.
+ *
+ * @return the array of elements as an array of DynAny's.
+ */
+ DynAny[] get_elements_as_dyn_any();
+
+ /**
+ * Returns the array.
+ *
+ * @return the array of elements as an array of Any's.
+ */
+ Any[] get_elements();
+
+ /**
+ * Sets the array.
+ *
+ * @param value the array of elements an DynAny's.
+ *
+ * @throws TypeMismatch if the members of the passed array does not match
+ * array component type.
+ *
+ * @throws InvalidValue if the number of elements in the passed array is not
+ * the same as the size of this DynArray.
+ */
+ void set_elements_as_dyn_any(DynAny[] value)
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Sets the array.
+ *
+ * @param value the array of elements as Any's.
+ *
+ * @throws TypeMismatch if the members of the passed array does not match
+ * array component type.
+ *
+ * @throws InvalidValue if the number of elements in the passed array is not
+ * the same as the size of this DynArray.
+ */
+ void set_elements(Any[] value)
+ throws TypeMismatch, InvalidValue;
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynEnum.java b/libjava/classpath/org/omg/DynamicAny/DynEnum.java
new file mode 100644
index 0000000..6f71bb8
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynEnum.java
@@ -0,0 +1,56 @@
+/* DynEnum.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.DynamicAny;
+
+import java.io.Serializable;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Defines the dynamic enumeration. The value of the dynamic enumeration can be
+ * set by name or by integer code. The valid string values and integer codes are
+ * taken from the typecode, from which the enumeration was constructed. The
+ * enumeration is an undividable type without traversable components.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynEnum
+ extends DynEnumOperations, DynAny, IDLEntity, org.omg.CORBA.Object,
+ Serializable
+{
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java b/libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java
new file mode 100644
index 0000000..944d4375
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java
@@ -0,0 +1,152 @@
+/* DynEnumHelper.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.DynamicAny;
+
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Any;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+ * The helper operations for {@link DynEnum}. Following the 1.5 JDK
+ * specifications, DynEnum is always a local object, so the two methods of this
+ * helper ({@link #read} and {@link #write} are not in use, always throwing
+ * {@link MARSHAL}.
+ *
+ * @specnote always throwing MARSHAL in read and write ensures compatibility
+ * with other popular implementations like Sun's.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class DynEnumHelper
+{
+ /**
+ * Cast the passed object into the DynEnum. As DynEnum is a local object, the
+ * method just uses java type cast.
+ *
+ * @param obj the object to narrow.
+ * @return narrowed instance.
+ * @throws BAD_PARAM if the passed object is not a DynEnum.
+ */
+ public static DynEnum narrow(org.omg.CORBA.Object obj)
+ {
+ try
+ {
+ return (DynEnum) obj;
+ }
+ catch (ClassCastException cex)
+ {
+ throw new BAD_PARAM(obj.getClass().getName() + " is not a DynEnum");
+ }
+ }
+
+ /**
+ * Get the type code of the {@link DynEnum}.
+ */
+ public static TypeCode type()
+ {
+ return ORB.init().create_interface_tc(id(), "DynEnum");
+ }
+
+ /**
+ * Insert the DynEnum into the given Any.
+ *
+ * @param any the Any to insert into.
+ *
+ * @param that the DynEnum to insert.
+ */
+ public static void insert(Any any, DynEnum that)
+ {
+ any.insert_Object(that);
+ }
+
+ /**
+ * Extract the DynEnum from given Any.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain DynEnum.
+ */
+ public static DynEnum extract(Any any)
+ {
+ return narrow(any.extract_Object());
+ }
+
+ /**
+ * Get the DynEnum repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/DynEnum:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/DynEnum:1.0";
+ }
+
+ /**
+ * This should read DynEnum from the CDR input stream, but (following the JDK
+ * 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static DynEnum read(InputStream input)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+
+ /**
+ * This should read DynEnum from the CDR input stream, but (following the JDK
+ * 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static void write(OutputStream output, DynEnum value)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/DynEnumOperations.java b/libjava/classpath/org/omg/DynamicAny/DynEnumOperations.java
new file mode 100644
index 0000000..3bc3ae2
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynEnumOperations.java
@@ -0,0 +1,82 @@
+/* DynEnumOperations.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.DynamicAny;
+
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+
+/**
+ * Defines operations, applicable to the dynamic enumeration. The value of the
+ * dynamic enumeration can be set by name or by integer code. The valid string
+ * values and integer codes are taken from the typecode, from which the
+ * enumeration was constructed. The enumeration is an undividable type without
+ * traversable components.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynEnumOperations
+ extends DynAnyOperations
+{
+ /**
+ * Get the current enumeration value, as string.
+ */
+ String get_as_string();
+
+ /**
+ * Get the current enumeration value, as int.
+ */
+ int get_as_ulong();
+
+ /**
+ * Set the current enumeration value, as string.
+ *
+ * @throws InvalidValue if the passed string is not one of the allowed values
+ * for this enumeration.
+ */
+ void set_as_string(String value)
+ throws InvalidValue;
+
+ /**
+ * Set the current enumeration value, as int.
+ *
+ * @throws InvalidValue if the passed string is not one of the allowed values
+ * for this enumeration.
+ */
+ void set_as_ulong(int value)
+ throws InvalidValue;
+
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynFixed.java b/libjava/classpath/org/omg/DynamicAny/DynFixed.java
new file mode 100644
index 0000000..65aa98f
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynFixed.java
@@ -0,0 +1,55 @@
+/* DynFixed.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.DynamicAny;
+
+import java.io.Serializable;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Defines dynamic any, holding CORBA fixed. The operations on
+ * fixed (defined in {@link DynFixedOperations}) take and return
+ * this data type in its string representation.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynFixed
+ extends DynFixedOperations, DynAny, IDLEntity, org.omg.CORBA.Object,
+ Serializable
+{
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java b/libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java
new file mode 100644
index 0000000..1d818d7
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java
@@ -0,0 +1,152 @@
+/* DynFixedHelper.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.DynamicAny;
+
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Any;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+ * The helper operations for {@link DynFixed}. Following the 1.5 JDK
+ * specifications, DynFixed is always a local object, so the two methods of this
+ * helper ({@link #read} and {@link #write} are not in use, always throwing
+ * {@link MARSHAL}.
+ *
+ * @specnote always throwing MARSHAL in read and write ensures compatibility
+ * with other popular implementations like Sun's.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class DynFixedHelper
+{
+ /**
+ * Cast the passed object into the DynFixed. As DynFixed is a local object,
+ * the method just uses java type cast.
+ *
+ * @param obj the object to narrow.
+ * @return narrowed instance.
+ * @throws BAD_PARAM if the passed object is not a DynFixed.
+ */
+ public static DynFixed narrow(org.omg.CORBA.Object obj)
+ {
+ try
+ {
+ return (DynFixed) obj;
+ }
+ catch (ClassCastException cex)
+ {
+ throw new BAD_PARAM(obj.getClass().getName() + " is not a DynFixed");
+ }
+ }
+
+ /**
+ * Get the type code of the {@link DynFixed}.
+ */
+ public static TypeCode type()
+ {
+ return ORB.init().create_interface_tc(id(), "DynFixed");
+ }
+
+ /**
+ * Insert the DynFixed into the given Any.
+ *
+ * @param any the Any to insert into.
+ *
+ * @param that the DynFixed to insert.
+ */
+ public static void insert(Any any, DynFixed that)
+ {
+ any.insert_Object(that);
+ }
+
+ /**
+ * Extract the DynFixed from given Any.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain DynFixed.
+ */
+ public static DynFixed extract(Any any)
+ {
+ return narrow(any.extract_Object());
+ }
+
+ /**
+ * Get the DynFixed repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/DynFixed:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/DynFixed:1.0";
+ }
+
+ /**
+ * This should read DynFixed from the CDR input stream, but (following the JDK
+ * 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static DynFixed read(InputStream input)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+
+ /**
+ * This should read DynFixed from the CDR input stream, but (following the JDK
+ * 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static void write(OutputStream output, DynFixed value)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/DynFixedOperations.java b/libjava/classpath/org/omg/DynamicAny/DynFixedOperations.java
new file mode 100644
index 0000000..e8c69a7
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynFixedOperations.java
@@ -0,0 +1,71 @@
+/* DynFixedOperations.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.DynamicAny;
+
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+/**
+ * Defines operations, applicable for DynAny, holding CORBA fixed.
+ * These operations take and return this data type in its string representation.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynFixedOperations
+ extends DynAnyOperations
+{
+ /**
+ * Get the value of the enclosed DynFixed, as string.
+ */
+ String get_value();
+
+ /**
+ * Set the value of the enclosed DynFixed, from string.
+ *
+ * @param fixed_value the value to set.
+ *
+ * @throws TypeMismatch if the passed string cannot be parsed into CORBA
+ * fixed. The valid string can only contain digits, decimal
+ * point and optional leading and trailing whitespace.
+ *
+ * @return true if the passed value can be represented without the loss of
+ * precision, false if some fractional digits were truncated.
+ */
+ boolean set_value(String fixed_value)
+ throws TypeMismatch, InvalidValue;
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynSequence.java b/libjava/classpath/org/omg/DynamicAny/DynSequence.java
new file mode 100644
index 0000000..08c7b52
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynSequence.java
@@ -0,0 +1,54 @@
+/* DynSequence.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.DynamicAny;
+
+import java.io.Serializable;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Defines a dynamic resizeable array with the optional upper size bound. All
+ * elements in this structure have the same type.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynSequence
+ extends DynSequenceOperations, DynAny, IDLEntity, org.omg.CORBA.Object,
+ Serializable
+{
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java b/libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java
new file mode 100644
index 0000000..c38a51f
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java
@@ -0,0 +1,151 @@
+/* DynSequenceHelper.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.DynamicAny;
+
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Any;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+ * The helper operations for {@link DynSequence}. Following the 1.5 JDK
+ * specifications, DynSequence is always a local object, so the two methods of
+ * this helper ({@link #read} and {@link #write} are not in use, always
+ * throwing {@link MARSHAL}.
+ *
+ * @specnote always throwing MARSHAL in read and write ensures compatibility
+ * with other popular implementations like Sun's.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class DynSequenceHelper
+{
+ /**
+ * Cast the passed object into the DynSequence. As DynSequence is a local
+ * object, the method just uses java type cast.
+ *
+ * @param obj the object to narrow.
+ * @return narrowed instance.
+ * @throws BAD_PARAM if the passed object is not a DynSequence.
+ */
+ public static DynSequence narrow(org.omg.CORBA.Object obj)
+ {
+ try
+ {
+ return (DynSequence) obj;
+ }
+ catch (ClassCastException cex)
+ {
+ throw new BAD_PARAM(obj.getClass().getName() + " is not a DynSequence");
+ }
+ }
+
+ /**
+ * Get the type code of the {@link DynSequence}.
+ */
+ public static TypeCode type()
+ {
+ return ORB.init().create_interface_tc(id(), "DynSequence");
+ }
+
+ /**
+ * Insert the DynSequence into the given Any.
+ *
+ * @param any the Any to insert into.
+ *
+ * @param that the DynSequence to insert.
+ */
+ public static void insert(Any any, DynSequence that)
+ {
+ any.insert_Object(that);
+ }
+
+ /**
+ * Extract the DynSequence from given Any.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain DynSequence.
+ */
+ public static DynSequence extract(Any any)
+ {
+ return narrow(any.extract_Object());
+ }
+
+ /**
+ * Get the DynSequence repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/DynSequence:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/DynSequence:1.0";
+ }
+
+ /**
+ * This should read DynSequence from the CDR input stream, but (following the
+ * JDK 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static DynSequence read(InputStream input)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+
+ /**
+ * This should read DynSequence from the CDR input stream, but (following the
+ * JDK 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static void write(OutputStream output, DynSequence value)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/DynSequenceOperations.java b/libjava/classpath/org/omg/DynamicAny/DynSequenceOperations.java
new file mode 100644
index 0000000..77cd283
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynSequenceOperations.java
@@ -0,0 +1,124 @@
+/* DynSequenceOperations.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.DynamicAny;
+
+import org.omg.CORBA.Any;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+/**
+ * Defines operations, applicable to DynSequence. These are basically the same
+ * operations as for {@link DynArrayOperations} with additional possibility to
+ * change the length of the sequence. If the
+ * {@link org.omg.CORBA.TypeCode#length()} method of the sequence typecode
+ * returns positive value, it is treated as a sequence bound. An attempt to
+ * extend the sequence above its bound raises {@link InvalidValue}.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynSequenceOperations
+ extends DynAnyOperations
+{
+ /**
+ * Get the length of the sequence.
+ *
+ * @return the current sequence length that was taken from typecode or changed
+ * with set_length.
+ */
+ int get_length();
+
+ /**
+ * Set the length of the sequence. If the sequence is shortened, the tailing
+ * members are discarded, but the remaining content is not affected. If the
+ * new length is larger than the previous one, the new members are added to
+ * the end of the sequence. These new members are initialised to they default
+ * values.
+ *
+ * @param length the new length of the sequence.
+ *
+ * @throws InvalidValue if this is a bounded sequence, and the size being set
+ * exceeds the sequence bound.
+ */
+ public void set_length(int length)
+ throws InvalidValue;
+
+ /**
+ * Returns the array, containing the sequence elements.
+ *
+ * @return the array of elements as an array of DynAny's.
+ */
+ DynAny[] get_elements_as_dyn_any();
+
+ /**
+ * Returns the array, containing the sequence elements.
+ *
+ * @return the array of elements as an array of Any's.
+ */
+ Any[] get_elements();
+
+ /**
+ * Sets the sequence elements from the array. The length of the sequence is
+ * set to the length of the passed array.
+ *
+ * @param value the array of elements an DynAny's.
+ *
+ * @throws TypeMismatch if the members of the passed array does not match
+ * sequence component type.
+ *
+ * @throws InvalidValue if this is a bounded sequence and the number of
+ * elements in the passed array exceeds the sequence bound.
+ */
+ void set_elements_as_dyn_any(DynAny[] value)
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Sets the sequence elements from the array. The length of the sequence is
+ * set to the length of the passed array.
+ *
+ * @param value the array of elements as Any's.
+ *
+ *
+ * @throws TypeMismatch if the members of the passed array does not match
+ * sequence component type.
+ *
+ * @throws InvalidValue if this is a bounded sequence and the number of
+ * elements in the passed array exceeds the sequence bound.
+ */
+ void set_elements(Any[] value)
+ throws TypeMismatch, InvalidValue;
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynStruct.java b/libjava/classpath/org/omg/DynamicAny/DynStruct.java
new file mode 100644
index 0000000..5405375
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynStruct.java
@@ -0,0 +1,54 @@
+/* DynStruct.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.DynamicAny;
+
+import java.io.Serializable;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Defines a fixed size structure with the named fields that may have different
+ * types.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynStruct
+ extends DynStructOperations, DynAny, IDLEntity, org.omg.CORBA.Object,
+ Serializable
+{
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynStructHelper.java b/libjava/classpath/org/omg/DynamicAny/DynStructHelper.java
new file mode 100644
index 0000000..e4790b4
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynStructHelper.java
@@ -0,0 +1,151 @@
+/* DynStructHelper.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.DynamicAny;
+
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Any;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+ * The helper operations for {@link DynStruct}. Following the 1.5 JDK
+ * specifications, DynStruct is always a local object, so the two methods of
+ * this helper ({@link #read} and {@link #write} are not in use, always
+ * throwing {@link MARSHAL}.
+ *
+ * @specnote always throwing MARSHAL in read and write ensures compatibility
+ * with other popular implementations like Sun's.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class DynStructHelper
+{
+ /**
+ * Cast the passed object into the DynStruct. As DynStruct is a local object,
+ * the method just uses java type cast.
+ *
+ * @param obj the object to narrow.
+ * @return narrowed instance.
+ * @throws BAD_PARAM if the passed object is not a DynStruct.
+ */
+ public static DynStruct narrow(org.omg.CORBA.Object obj)
+ {
+ try
+ {
+ return (DynStruct) obj;
+ }
+ catch (ClassCastException cex)
+ {
+ throw new BAD_PARAM(obj.getClass().getName() + " is not a DynStruct");
+ }
+ }
+
+ /**
+ * Get the type code of the {@link DynStruct}.
+ */
+ public static TypeCode type()
+ {
+ return ORB.init().create_interface_tc(id(), "DynStruct");
+ }
+
+ /**
+ * Insert the DynStruct into the given Any.
+ *
+ * @param any the Any to insert into.
+ *
+ * @param that the DynStruct to insert.
+ */
+ public static void insert(Any any, DynStruct that)
+ {
+ any.insert_Object(that);
+ }
+
+ /**
+ * Extract the DynStruct from given Any.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain DynStruct.
+ */
+ public static DynStruct extract(Any any)
+ {
+ return narrow(any.extract_Object());
+ }
+
+ /**
+ * Get the DynStruct repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/DynStruct:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/DynStruct:1.0";
+ }
+
+ /**
+ * This should read DynStruct from the CDR input stream, but (following the
+ * JDK 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static DynStruct read(InputStream input)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+
+ /**
+ * This should read DynStruct from the CDR input stream, but (following the
+ * JDK 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static void write(OutputStream output, DynStruct value)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/DynStructOperations.java b/libjava/classpath/org/omg/DynamicAny/DynStructOperations.java
new file mode 100644
index 0000000..3b5af17
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynStructOperations.java
@@ -0,0 +1,140 @@
+/* DynStructOperations.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.DynamicAny;
+
+import org.omg.CORBA.TCKind;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+/**
+ * Defines the operations, applicable to the DynStructure.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynStructOperations
+ extends DynAnyOperations
+{
+ /**
+ * Get the kind of the structure field at the current position.
+ *
+ * @return the kind of field.
+ *
+ * @throws TypeMismatch for an empty structure (normally exception).
+ * @throws InvalidValue if the current position does not indicate a memeber.
+ */
+ TCKind current_member_kind()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Get the name of the structure field at the current position.
+ *
+ * @return the name of the field.
+ *
+ * @throws TypeMismatch for an empty structure (normally exception).
+ * @throws InvalidValue if the current position does not indicate a memeber.
+ */
+ String current_member_name()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Return array, describing describing the name and the value of each member
+ * in the structure.
+ *
+ * @return an array of NameDynAnyPair's, each defining a single field in this
+ * structure.
+ */
+ NameDynAnyPair[] get_members_as_dyn_any();
+
+ /**
+ * Return array, describing describing the name and the value of each member
+ * in the structure.
+ *
+ * @return an array of NameValuePair's, each defining a single field in this
+ * structure.
+ */
+ NameValuePair[] get_members();
+
+ /**
+ * Set the structure contend from the array, where each member defines the
+ * name and value of the structure field. If the passed array is not empty,
+ * the current position is set to the first member.
+ *
+ * The members of array must follow in the same order as the structure fields,
+ * how they are defined in the typecode. The name-based value assignment is
+ * not supported.
+ *
+ * @specnote The name-based value assignment is not supported by Sun's jdk
+ * 1.4.
+ *
+ * @param an array of NameDynValuePair's, each defining a single field in the
+ * structure.
+ *
+ * @throws TypeMismatch if the member of the passed array has a different type
+ * than the corresponding structure field.
+ *
+ * @throws InvalidValue if the size of the passed array is not the same as the
+ * number of fields in this structure.
+ */
+ void set_members_as_dyn_any(NameDynAnyPair[] value)
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Set the structure contend from the array, where each member defines the
+ * name and value of the structure field. If the passed array is not empty,
+ * the current position is set to the first member.
+ *
+ * The members of array must follow in the same order as the structure fields,
+ * how they are defined in the typecode. The name-based value assignment is
+ * not supported.
+ *
+ * @specnote The name-based value assignment is not supported by Sun's jdk
+ * 1.4.
+ *
+ * @param an array of NameValuePair's, each defining a single field in the
+ * structure.
+ *
+ * @throws TypeMismatch if the member of the passed array has a different type
+ * than the corresponding structure field.
+ *
+ * @throws InvalidValue if the size of the passed array is not the same as the
+ * number of fields in this structure.
+ */
+ void set_members(NameValuePair[] value)
+ throws TypeMismatch, InvalidValue;
+
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynUnion.java b/libjava/classpath/org/omg/DynamicAny/DynUnion.java
new file mode 100644
index 0000000..8875d15
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynUnion.java
@@ -0,0 +1,54 @@
+/* DynUnion.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.DynamicAny;
+
+import java.io.Serializable;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Defines a fixed size structure with the named fields that may have different
+ * types.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynUnion
+ extends DynUnionOperations, DynAny, IDLEntity, org.omg.CORBA.Object,
+ Serializable
+{
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java b/libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java
new file mode 100644
index 0000000..7940983
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java
@@ -0,0 +1,151 @@
+/* DynUnionHelper.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.DynamicAny;
+
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Any;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+ * The helper operations for {@link DynUnion}. Following the 1.5 JDK
+ * specifications, DynUnion is always a local object, so the two methods of this
+ * helper ({@link #read} and {@link #write} are not in use, always throwing
+ * {@link MARSHAL}.
+ *
+ * @specnote always throwing MARSHAL in read and write ensures compatibility
+ * with other popular implementations like Sun's.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class DynUnionHelper
+{
+ /**
+ * Cast the passed object into the DynUnion. As DynUnion is a local object,
+ * the method just uses java type cast.
+ *
+ * @param obj the object to narrow.
+ * @return narrowed instance.
+ * @throws BAD_PARAM if the passed object is not a DynUnion.
+ */
+ public static DynUnion narrow(org.omg.CORBA.Object obj)
+ {
+ try
+ {
+ return (DynUnion) obj;
+ }
+ catch (ClassCastException cex)
+ {
+ throw new BAD_PARAM(obj.getClass().getName() + " is not a DynUnion");
+ }
+ }
+
+ /**
+ * Get the type code of the {@link DynUnion}.
+ */
+ public static TypeCode type()
+ {
+ return ORB.init().create_interface_tc(id(), "DynUnion");
+ }
+
+ /**
+ * Insert the DynUnion into the given Any.
+ *
+ * @param any the Any to insert into.
+ *
+ * @param that the DynUnion to insert.
+ */
+ public static void insert(Any any, DynUnion that)
+ {
+ any.insert_Object(that);
+ }
+
+ /**
+ * Extract the DynUnion from given Any.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain DynUnion.
+ */
+ public static DynUnion extract(Any any)
+ {
+ return narrow(any.extract_Object());
+ }
+
+ /**
+ * Get the DynUnion repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/DynUnion:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/DynUnion:1.0";
+ }
+
+ /**
+ * This should read DynUnion from the CDR input stream, but (following the JDK
+ * 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static DynUnion read(InputStream input)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+
+ /**
+ * This should read DynUnion from the CDR input stream, but (following the JDK
+ * 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static void write(OutputStream output, DynUnion value)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/DynUnionOperations.java b/libjava/classpath/org/omg/DynamicAny/DynUnionOperations.java
new file mode 100644
index 0000000..c046e69
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynUnionOperations.java
@@ -0,0 +1,149 @@
+/* DynUnionOperations.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.DynamicAny;
+
+import org.omg.CORBA.TCKind;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+/**
+ * Defines the operations, applicable to the DynUnion. The DynUnion has only two
+ * valid positions:
+ *
+ *
+ * The size of the union is normally 2. If the discriminator value defines no
+ * valid variant, the union consists of discriminator only, having the size 1.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynUnionOperations
+ extends DynAnyOperations
+{
+ /**
+ * case label). The current position is set to 0.
+ * The size of the union becomes 0.
+ *
+ * @throws TypeMismatch if the union has explicit default case.
+ */
+ void set_to_no_active_member()
+ throws TypeMismatch;
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/DynValue.java b/libjava/classpath/org/omg/DynamicAny/DynValue.java
new file mode 100644
index 0000000..831ce60
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynValue.java
@@ -0,0 +1,58 @@
+/* DynValue.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.DynamicAny;
+
+import java.io.Serializable;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Defines a non boxed value type. From the view point of DynAny, the Value is
+ * very much like structure. The access to fields of this structer are supported
+ * via {@link DynValueOperations} interface.Unlike structure, the value can also
+ * be equal to null that is supported via
+ * {@link DynValueCommonOperations} interface.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynValue
+ extends DynValueOperations, DynValueCommon, DynAny, IDLEntity,
+ org.omg.CORBA.Object, Serializable
+{
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynValueBox.java b/libjava/classpath/org/omg/DynamicAny/DynValueBox.java
new file mode 100644
index 0000000..bd758b5
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynValueBox.java
@@ -0,0 +1,55 @@
+/* DynValueBox.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.DynamicAny;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+import java.io.Serializable;
+
+/**
+ * A "ValueBox" is a Value type container, holding a single instance of the
+ * other CORBA type. This content can be set to null.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynValueBox
+ extends DynValueBoxOperations, DynValueCommon, DynAny, IDLEntity,
+ org.omg.CORBA.Object, Serializable
+{
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/DynValueBoxOperations.java b/libjava/classpath/org/omg/DynamicAny/DynValueBoxOperations.java
new file mode 100644
index 0000000..d32541b
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynValueBoxOperations.java
@@ -0,0 +1,91 @@
+/* DynValueBoxOperation.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.DynamicAny;
+
+import org.omg.CORBA.Any;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+/**
+ * Defines operations, applicable for the boxed value type.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynValueBoxOperations
+ extends DynValueCommonOperations, DynAnyOperations
+{
+ /**
+ * Get the return the content of the "box" as the DynAny.
+ *
+ * @throws InvalidValue if the object is holding null.
+ */
+ DynAny get_boxed_value_as_dyn_any()
+ throws InvalidValue;
+
+ /**
+ * Get the return the content of the "box" as the Any.
+ *
+ * @throws InvalidValue if the object is holding null.
+ */
+ Any get_boxed_value()
+ throws InvalidValue;
+
+ /**
+ * Set the value of the "box" from DynAny.
+ *
+ * @param boxIt a value to box.
+ *
+ * @throws TypeMismatch if the type is not matching the current boxed value
+ * type.
+ */
+ void set_boxed_value_as_dyn_any(DynAny boxIt)
+ throws TypeMismatch;
+
+ /**
+ * Set the value of the "box" as Any.
+ *
+ * @param boxIt a value to place into the box.
+ *
+ * @throws TypeMismatch if the type is not matching the current boxed value
+ * type.
+ */
+ void set_boxed_value(Any boxIt)
+ throws TypeMismatch;
+
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynValueCommon.java b/libjava/classpath/org/omg/DynamicAny/DynValueCommon.java
new file mode 100644
index 0000000..1b324aa
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynValueCommon.java
@@ -0,0 +1,76 @@
+/* DynValueCommon.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.DynamicAny;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+import java.io.Serializable;
+
+/**
+ * Defines DynAny that may hold CORBA null. The
+ * {@link DynValueCommonOperations} provides methods for setting the value to
+ * null or non-null and checking if the value is
+ * null.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynValueCommon
+ extends DynValueCommonOperations, DynAny, IDLEntity, org.omg.CORBA.Object,
+ Serializable
+{
+ /**
+ * Check if this {@link DynAny} is holding the null.
+ *
+ * @return true if this {@link DynAny} is holding the null,
+ * false otherwise.
+ */
+ boolean is_null();
+
+ /**
+ * Set the value of this {@link DynAny} to CORBA null.
+ */
+ void set_to_null();
+
+ /**
+ * Set the value of this {@link DynAny} to the default non-null value. The
+ * target {@link DynAny} creates a new data structure, intialised to the
+ * agreed default values, as defined in {@link DynAnyFactoryOperations}.
+ */
+ void set_to_value();
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynValueCommonOperations.java b/libjava/classpath/org/omg/DynamicAny/DynValueCommonOperations.java
new file mode 100644
index 0000000..31c3167
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynValueCommonOperations.java
@@ -0,0 +1,69 @@
+/* DynValueCommonOperations.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.DynamicAny;
+
+/**
+ * Provides operations, applicable to {@link DynAny}s that may hold CORBA
+ * null.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynValueCommonOperations
+ extends DynAnyOperations
+{
+ /**
+ * Check if this {@link DynAny} is holding the null.
+ *
+ * @return true if this {@link DynAny} is holding the null,
+ * false otherwise.
+ */
+ boolean is_null();
+
+ /**
+ * Set the value of this {@link DynAny} to CORBA null.
+ */
+ void set_to_null();
+
+ /**
+ * Set the value of this {@link DynAny} to the default non-null value. The
+ * target {@link DynAny} creates a new data structure, intialised to the
+ * agreed default values, as defined in {@link DynAnyFactoryOperations}.
+ */
+ void set_to_value();
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/DynValueHelper.java b/libjava/classpath/org/omg/DynamicAny/DynValueHelper.java
new file mode 100644
index 0000000..a6d7afa
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynValueHelper.java
@@ -0,0 +1,151 @@
+/* DynValueHelper.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.DynamicAny;
+
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Any;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+ * The helper operations for {@link DynValue}. Following the 1.5 JDK
+ * specifications, DynValue is always a local object, so the two methods of this
+ * helper ({@link #read} and {@link #write} are not in use, always throwing
+ * {@link MARSHAL}.
+ *
+ * @specnote always throwing MARSHAL in read and write ensures compatibility
+ * with other popular implementations like Sun's.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class DynValueHelper
+{
+ /**
+ * Cast the passed object into the DynValue. As DynValue is a local object,
+ * the method just uses java type cast.
+ *
+ * @param obj the object to narrow.
+ * @return narrowed instance.
+ * @throws BAD_PARAM if the passed object is not a DynValue.
+ */
+ public static DynValue narrow(org.omg.CORBA.Object obj)
+ {
+ try
+ {
+ return (DynValue) obj;
+ }
+ catch (ClassCastException cex)
+ {
+ throw new BAD_PARAM(obj.getClass().getName() + " is not a DynValue");
+ }
+ }
+
+ /**
+ * Get the type code of the {@link DynValue}.
+ */
+ public static TypeCode type()
+ {
+ return ORB.init().create_interface_tc(id(), "DynValue");
+ }
+
+ /**
+ * Insert the DynValue into the given Any.
+ *
+ * @param any the Any to insert into.
+ *
+ * @param that the DynValue to insert.
+ */
+ public static void insert(Any any, DynValue that)
+ {
+ any.insert_Object(that);
+ }
+
+ /**
+ * Extract the DynValue from given Any.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain DynValue.
+ */
+ public static DynValue extract(Any any)
+ {
+ return narrow(any.extract_Object());
+ }
+
+ /**
+ * Get the DynValue repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/DynValue:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/DynValue:1.0";
+ }
+
+ /**
+ * This should read DynValue from the CDR input stream, but (following the JDK
+ * 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static DynValue read(InputStream input)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+
+ /**
+ * This should read DynValue from the CDR input stream, but (following the JDK
+ * 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static void write(OutputStream output, DynValue value)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/DynValueOperations.java b/libjava/classpath/org/omg/DynamicAny/DynValueOperations.java
new file mode 100644
index 0000000..b986c24
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/DynValueOperations.java
@@ -0,0 +1,134 @@
+/* DynValueOperations.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.DynamicAny;
+
+import org.omg.CORBA.TCKind;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+/**
+ * Defines operations, applicable to DynValue. From the view point of DynAny,
+ * the Value is very much like structure. However, differently from the
+ * structure, the value type can also have private members. The private members
+ * of DynValue are also accessible via this interface, but this possibility
+ * should only be used in applications like in debuggers or inter-orb bridges.
+ * Unlike structure, the value can also be equal to null.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface DynValueOperations
+ extends DynAnyOperations, DynValueCommonOperations
+{
+ /**
+ * Get the kind of the current member.
+ *
+ * @return the kind of member at the current position.
+ *
+ * @throws TypeMismatch if this DynValue is holding null.
+ * @thorws InvalidValue if the current position does not indicate the member.
+ */
+ TCKind current_member_kind()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Get the name of the current member.
+ *
+ * @return the name of the current member as defined by the typecode. May be
+ * an empty string.
+ *
+ * @throws TypeMismatch if this DynValue is holding null.
+ * @thorws InvalidValue if the current position does not indicate the member.
+ */
+ String current_member_name()
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Get all members as an array of the named DynAny's. The returned names are
+ * set as they are defined by typecode.
+ *
+ * @return the array, representing the members of this instance of value.
+ *
+ * @throws InvalidValue if this DynValue is holding null.
+ */
+ NameDynAnyPair[] get_members_as_dyn_any()
+ throws InvalidValue;
+
+ /**
+ * Get all members as an array of the named Any's. The returned names are set
+ * as they are defined by typecode.
+ *
+ * @return the array, representing the members of this instance of value.
+ *
+ * @throws InvalidValue if this DynValue is holding null.
+ */
+ NameValuePair[] get_members()
+ throws InvalidValue;
+
+ /**
+ * Set all members from the array of the named Any's.
+ *
+ * @param value the array, where the data for fields of the structure must
+ * occur exactly in the same order, as defined by typecode.
+ *
+ * @throws TypeMismatch if the type or name of the array member does not match
+ * the name and type of the corresponding field in the DynValue data
+ * structure. The empty string is assumed matching any name.
+ *
+ * @throws InvalidValue if the size of the array does not match the number of
+ * fields.
+ */
+ void set_members_as_dyn_any(NameDynAnyPair[] value)
+ throws TypeMismatch, InvalidValue;
+
+ /**
+ * Set all members from the array of the named Any's.
+ *
+ * @param value the array, where the data for fields of the structure must
+ * occur exactly in the same order, as defined by typecode.
+ *
+ * @throws TypeMismatch if the type or name of the array member does not match
+ * the name and type of the corresponding field in the DynValue data
+ * structure. The empty string is assumed matching any name.
+ *
+ * @throws InvalidValue if the size of the array does not match the number of
+ * fields.
+ */
+ void set_members(NameValuePair[] value)
+ throws TypeMismatch, InvalidValue;
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/FieldNameHelper.java b/libjava/classpath/org/omg/DynamicAny/FieldNameHelper.java
new file mode 100644
index 0000000..7c4cdbf
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/FieldNameHelper.java
@@ -0,0 +1,120 @@
+/* FieldNameHelper.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.DynamicAny;
+
+import gnu.CORBA.Restricted_ORB;
+
+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;
+
+/**
+ * A helper for the FieldName. The fields {@link NameValuePair#id},
+ * {@link NameDynAnyPair#id} and return values of methods
+ * current_member_name(), member_name() in several
+ * interfaces officially have the "FieldName" type. This type is directly
+ * mapped into java String and needs no helper. The helper
+ * is included only as a part of the formal standard.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class FieldNameHelper
+{
+ /**
+ * Insert the FieldName 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 FieldName 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 = Restricted_ORB.Singleton;
+ return orb.create_alias_tc(id(), "FieldName", orb.create_string_tc(0));
+ }
+
+ /**
+ * Return the FieldName repository id.
+ * @return "IDL:omg.org/DynamicAny/FieldName:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/FieldName:1.0";
+ }
+
+ /**
+ * Calls {@link InputStream#read_string()}.
+ *
+ * @param instream the stream to read from.
+ */
+ public static String read(InputStream istream)
+ {
+ return istream.read_string();
+ }
+
+ /**
+ * Calls {@link OutputStream#write_string()}.
+ *
+ * @param ostream the stream to write into.
+ * @param value the string (FieldName) value to write.
+ */
+ public static void write(OutputStream ostream, String value)
+ {
+ ostream.write_string(value);
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/NameDynAnyPair.java b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPair.java
new file mode 100644
index 0000000..5fe438b
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPair.java
@@ -0,0 +1,87 @@
+/* NameDynAnyPair.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.DynamicAny;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+import java.io.Serializable;
+
+/**
+ * Stores the named value, representing the name by string and the value by
+ * {@link DynAny}.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public final class NameDynAnyPair
+ implements IDLEntity, Serializable
+{
+ /**
+ * Use serialVersionUID (v1.4) for interoperability.
+ */
+ private static final long serialVersionUID = -1992533286932908564L;
+
+ /**
+ * The name of the named value.
+ */
+ public String id;
+
+ /**
+ * The value of the named value.
+ */
+ public DynAny value;
+
+ /**
+ * Create unitialised instance with both fields left with default
+ * null value.
+ */
+ public NameDynAnyPair()
+ {
+ }
+
+ /**
+ * Create an instance with the given initial values.
+ *
+ * @param aName the name of the named value.
+ * @param aValue the value of the named value.
+ */
+ public NameDynAnyPair(String aName, DynAny aValue)
+ {
+ id = aName;
+ value = aValue;
+ }
+}
diff --git a/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairHelper.java b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairHelper.java
new file mode 100644
index 0000000..d649800
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairHelper.java
@@ -0,0 +1,170 @@
+/* NameDynAnyPairHelper.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.DynamicAny;
+
+import gnu.CORBA.NameDynAnyPairHolder;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.MARSHAL;
+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;
+
+/**
+ * A helper operations for the structure {@link NameDynAnyPair}.
+ *
+ * Following the 1.5 JDK specifications, DynAny (and hence any structure,
+ * containing DynAny) is always a local object, so the two methods of this
+ * helper ({@link #read} and {@link #write} are not in use, always throwing
+ * {@link MARSHAL}.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class NameDynAnyPairHelper
+{
+ /**
+ * The cached typecode value, computed only once.
+ */
+ private static TypeCode typeCode;
+
+ /**
+ * Extract the NameDynAnyPair from given Any.
+ * This method uses the NameDynAnyPairHolder.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain NameDynAnyPair.
+ */
+ public static NameDynAnyPair extract(Any any)
+ {
+ try
+ {
+ return ((NameDynAnyPairHolder) any.extract_Streamable()).value;
+ }
+ catch (ClassCastException cex)
+ {
+ BAD_OPERATION bad = new BAD_OPERATION("NameDynAnyPair expected");
+ bad.initCause(cex);
+ throw bad;
+ }
+ }
+
+ /**
+ * Get the NameDynAnyPair repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/NameDynAnyPair:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/NameDynAnyPair:1.0";
+ }
+
+ /**
+ * Create the NameDynAnyPair typecode (structure,
+ * named "NameDynAnyPair").
+ * The typecode states that the structure contains the
+ * following fields: id, value.
+ */
+ public static TypeCode type()
+ {
+ if (typeCode == null)
+ {
+ ORB orb = ORB.init();
+ StructMember[] members = new StructMember[ 2 ];
+
+ TypeCode field;
+
+ field =
+ orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
+ "FieldName",
+ orb.get_primitive_tc(TCKind.tk_string)
+ );
+ members [ 0 ] = new StructMember("id", field, null);
+
+ field = DynAnyHelper.type();
+ members [ 1 ] = new StructMember("value", field, null);
+ typeCode = orb.create_struct_tc(id(), "NameDynAnyPair", members);
+ }
+ return typeCode;
+ }
+
+ /**
+ * Insert the NameDynAnyPair into the given Any.
+ * This method uses the NameDynAnyPairHolder.
+ *
+ * @param any the Any to insert into.
+ * @param that the NameDynAnyPair to insert.
+ */
+ public static void insert(Any any, NameDynAnyPair that)
+ {
+ any.insert_Streamable(new NameDynAnyPairHolder(that));
+ }
+
+ /**
+ * The method should read this object from the CDR input stream, but
+ * (following the JDK 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static NameDynAnyPair read(InputStream input)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+
+ /**
+ * The method should write this object to the CDR input stream, but
+ * (following the JDK 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static void write(OutputStream output, NameDynAnyPair value)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java
new file mode 100644
index 0000000..f110926
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java
@@ -0,0 +1,151 @@
+/* NameDynAnyPairSeq.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.DynamicAny;
+
+import gnu.CORBA.NameDynAnyPairSeqHolder;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+ * A helper operations for the array of {@link NameDynAnyPair}
+ * ({@link NameDynAnyPairSeq}).
+ *
+ * Following the 1.5 JDK specifications, DynAny (and hence the sequence
+ * of structures, containing DynAny) is always a local object.
+ * Hence the two methods of this helper ({@link #read} and {@link #write} are
+ * not in use, always throwing {@link MARSHAL}.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class NameDynAnyPairSeqHelper
+{
+ /**
+ * The cached typecode value, computed only once.
+ */
+ private static TypeCode typeCode;
+
+ public static TypeCode type()
+ {
+ if (typeCode == null)
+ {
+ ORB orb = ORB.init();
+ TypeCode t = orb.create_sequence_tc(0, NameDynAnyPairHelper.type());
+ typeCode = orb.create_alias_tc(id(), "NameDynAnyPairSeq", t);
+ }
+ return typeCode;
+ }
+
+ /**
+ * Insert the NameDynAnyPairSeq into the given Any.
+ * This method uses the NameDynAnyPairSeqHolder.
+ *
+ * @param any the Any to insert into.
+ * @param those the NameDynAnyPair[] to insert.
+ */
+ public static void insert(Any any, NameDynAnyPair[] those)
+ {
+ any.insert_Streamable(new NameDynAnyPairSeqHolder(those));
+ }
+
+ /**
+ * Extract the NameDynAnyPairSeq from given Any.
+ * This method uses the NameDynAnyPairSeqHolder.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain NameDynAnyPairSeq.
+ */
+ public static NameDynAnyPair[] extract(Any any)
+ {
+ try
+ {
+ return ((NameDynAnyPairSeqHolder) any.extract_Streamable()).value;
+ }
+ catch (ClassCastException cex)
+ {
+ BAD_OPERATION bad = new BAD_OPERATION("NameDynAnyPairSeq expected");
+ bad.initCause(cex);
+ throw bad;
+ }
+ }
+
+ /**
+ * Get the NameDynAnyPairSeq repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/NameDynAnyPairSeq:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/NameDynAnyPairSeq:1.0";
+ }
+
+ /**
+ * The method should read this object from the CDR input stream, but
+ * (following the JDK 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static NameDynAnyPair[] read(InputStream input)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+
+ /**
+ * The method should write this object to the CDR input stream, but
+ * (following the JDK 1.5 API) it does not.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ *
+ * @specenote Sun throws the same exception.
+ *
+ * @throws MARSHAL always.
+ */
+ public static void write(OutputStream output, NameDynAnyPair[] value)
+ {
+ throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id()));
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/NameValuePair.java b/libjava/classpath/org/omg/DynamicAny/NameValuePair.java
new file mode 100644
index 0000000..e0ce752
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/NameValuePair.java
@@ -0,0 +1,90 @@
+/* NameValuePair.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.DynamicAny;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.DynStruct;
+import org.omg.CORBA.portable.IDLEntity;
+
+import java.io.Serializable;
+
+/**
+ * Holds the value, having the given name(id). This class is used by with
+ * {@link DynStruct} to name the fields of the record (structure).
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public final class NameValuePair
+ implements Serializable, IDLEntity
+{
+ /**
+ * Use serialVersionUID (v1.4) for interoperability.
+ */
+ private static final long serialVersionUID = -1289460542874201736L;
+
+ /**
+ * The value of the structure record.
+ */
+ public Any value;
+
+ /**
+ * The name of the structure record.
+ */
+ public String id;
+
+ /**
+ * Cretes an unitialised instance of the name-value pair.
+ */
+ public NameValuePair()
+ {
+ }
+
+ /**
+ * Creates the name-value pair, initialising the fields to the passed values.
+ *
+ * @param aName the name (also called id) of the name-value pair, normally the
+ * name of the structure field.
+ *
+ * @param aValue the value of the name-value pair.
+ */
+ public NameValuePair(String aName, Any aValue)
+ {
+ id = aName;
+ value = aValue;
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/NameValuePairHelper.java b/libjava/classpath/org/omg/DynamicAny/NameValuePairHelper.java
new file mode 100644
index 0000000..a3d5bff
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/NameValuePairHelper.java
@@ -0,0 +1,159 @@
+/* NameValuePairHelper.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.DynamicAny;
+
+import gnu.CORBA.NameValuePairHolder;
+
+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;
+
+/**
+ * A helper operations for the structure {@link NameValuePair}.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class NameValuePairHelper
+{
+ /**
+ * The cached typecode value, computed only once.
+ */
+ private static TypeCode typeCode;
+
+ /**
+ * Create the NameValuePair typecode (structure,
+ * named "NameValuePair").
+ * The typecode states that the structure contains the
+ * following fields: id, value.
+ */
+ public static TypeCode type()
+ {
+ if (typeCode == null)
+ {
+ ORB orb = ORB.init();
+ StructMember[] members = new StructMember[ 2 ];
+
+ TypeCode field;
+
+ field =
+ orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
+ "FieldName",
+ orb.get_primitive_tc(TCKind.tk_string)
+ );
+ members [ 0 ] = new StructMember("id", field, null);
+
+ field = orb.get_primitive_tc(TCKind.tk_any);
+ members [ 1 ] = new StructMember("value", field, null);
+ typeCode = orb.create_struct_tc(id(), "NameValuePair", members);
+ }
+ return typeCode;
+ }
+
+ /**
+ * Insert the NameValuePair into the given Any.
+ * This method uses the NameValuePairHolder.
+ *
+ * @param any the Any to insert into.
+ * @param that the NameValuePair to insert.
+ */
+ public static void insert(Any any, NameValuePair that)
+ {
+ any.insert_Streamable(new NameValuePairHolder(that));
+ }
+
+ /**
+ * Extract the NameValuePair from given Any.
+ * This method uses the NameValuePairHolder.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain NameValuePair.
+ */
+ public static NameValuePair extract(Any any)
+ {
+ try
+ {
+ return ((NameValuePairHolder) any.extract_Streamable()).value;
+ }
+ catch (ClassCastException cex)
+ {
+ BAD_OPERATION bad = new BAD_OPERATION("NameValuePair expected");
+ bad.initCause(cex);
+ throw bad;
+ }
+ }
+
+ /**
+ * Get the NameValuePair repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/NameValuePair:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/NameValuePair:1.0";
+ }
+
+ /**
+ * Read the structure from the CDR intput stream.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ */
+ public static NameValuePair read(InputStream input)
+ {
+ NameValuePair value = new NameValuePair();
+ value.id = input.read_string();
+ value.value = input.read_any();
+ return value;
+ }
+
+ /**
+ * Write the structure 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, NameValuePair value)
+ {
+ output.write_string(value.id);
+ output.write_any(value.value);
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/NameValuePairSeqHelper.java b/libjava/classpath/org/omg/DynamicAny/NameValuePairSeqHelper.java
new file mode 100644
index 0000000..400708e
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/NameValuePairSeqHelper.java
@@ -0,0 +1,147 @@
+/* NameValuePairSeq.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.DynamicAny;
+
+import gnu.CORBA.NameValuePairSeqHolder;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+ * A helper operations for the array of {@link NameValuePair}.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class NameValuePairSeqHelper
+{
+ /**
+ * The cached typecode value, computed only once.
+ */
+ private static TypeCode typeCode;
+
+ public static TypeCode type()
+ {
+ if (typeCode == null)
+ {
+ ORB orb = ORB.init();
+ TypeCode t = orb.create_sequence_tc(0, NameValuePairHelper.type());
+ typeCode = orb.create_alias_tc(id(), "NameValuePairSeq", t);
+ }
+ return typeCode;
+ }
+
+ /**
+ * Insert the NameValuePairSeq into the given Any.
+ * This method uses the NameValuePairSeqHolder.
+ *
+ * @param any the Any to insert into.
+ * @param those the NameValuePair[] to insert.
+ */
+ public static void insert(Any any, NameValuePair[] those)
+ {
+ any.insert_Streamable(new NameValuePairSeqHolder(those));
+ }
+
+ /**
+ * Extract the NameValuePairSeq from given Any.
+ * This method uses the NameValuePairSeqHolder.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain NameValuePairSeq.
+ */
+ public static NameValuePair[] extract(Any any)
+ {
+ try
+ {
+ return ((NameValuePairSeqHolder) any.extract_Streamable()).value;
+ }
+ catch (ClassCastException cex)
+ {
+ BAD_OPERATION bad = new BAD_OPERATION("NameValuePairSeq expected");
+ bad.initCause(cex);
+ throw bad;
+ }
+ }
+
+ /**
+ * Get the NameValuePairSeq repository id.
+ *
+ * @return "IDL:omg.org/DynamicAny/NameValuePairSeq:1.0", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/DynamicAny/NameValuePairSeq:1.0";
+ }
+
+ /**
+ * Read the sequence from the CDR intput stream.
+ * Expects the array size (as CORBA long), followed by
+ * the array members (if any).
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ */
+ public static NameValuePair[] read(InputStream input)
+ {
+ NameValuePair[] value;
+ value = new NameValuePair[ input.read_long() ];
+ for (int i = 0; i < value.length; i++)
+ value [ i ] = NameValuePairHelper.read(input);
+ return value;
+ }
+
+ /**
+ * Write the structure to the CDR output stream.
+ * Writes the array size (as CORBA long), followed by
+ * the array members (if any).
+ *
+ * @param output a org.omg.CORBA.portable stream stream to write into.
+ * @param value an array to write.
+ */
+ public static void write(OutputStream output, NameValuePair[] value)
+ {
+ output.write_long(value.length);
+ for (int i0 = 0; i0 < value.length; i0++)
+ {
+ NameValuePairHelper.write(output, value [ i0 ]);
+ }
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/_DynAnyFactoryStub.java b/libjava/classpath/org/omg/DynamicAny/_DynAnyFactoryStub.java
new file mode 100644
index 0000000..b0f6d60
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/_DynAnyFactoryStub.java
@@ -0,0 +1,122 @@
+/* _DynAnyFactoryStub.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.DynamicAny;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.CORBA.portable.ObjectImpl;
+import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode;
+
+import java.io.Serializable;
+
+/**
+ * Should provide support for remote invocation of methods on
+ * DynAnyFactory. As DynAny can never be remote at least till 1.5 inclusive,
+ * this class is not in use. DynAnyFactory should be obtained from the
+ * {@link ORB#resolve_initial_references}.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class _DynAnyFactoryStub
+ extends ObjectImpl
+ implements DynAnyFactory, Serializable
+{
+ /**
+ * Use serialVersionUID (v1.4) for interoperability.
+ */
+ private static final long serialVersionUID = -6575269659020082310L;
+
+ /**
+ * The purpose and value of this field are not documented.
+ */
+ public static final Class _opsClass = DynAnyFactoryOperations.class;
+
+ /**
+ * Create the DynAnyFactory stub.
+ */
+ public _DynAnyFactoryStub()
+ {
+ }
+
+ /**
+ * Create the naming context stub with the given delegate.
+ */
+ public _DynAnyFactoryStub(Delegate delegate)
+ {
+ _set_delegate(delegate);
+ }
+
+ /**
+ * Return the array of repository ids for this object.
+ */
+ public String[] _ids()
+ {
+ return new String[] { DynAnyFactoryHelper.id() };
+ }
+
+ /**
+ * The remote call of this DynAnyFactory method is not possible
+ * (the created DynAny would not be transferred to client).
+ *
+ * @throws MARSHAL, always.
+ */
+ public DynAny create_dyn_any(Any _0)
+ throws InconsistentTypeCode
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of this DynAnyFactory method is not possible
+ * (the created DynAny would not be transferred to client).
+ *
+ * @throws MARSHAL, always.
+ */
+ public DynAny create_dyn_any_from_type_code(TypeCode _0)
+ throws InconsistentTypeCode
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ static String NOT_APPLICABLE =
+ "DynAnyFactory is always local objects. " +
+ "It is never accessed on remote side via stub.";
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/_DynAnyStub.java b/libjava/classpath/org/omg/DynamicAny/_DynAnyStub.java
new file mode 100644
index 0000000..af8d4e5
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/_DynAnyStub.java
@@ -0,0 +1,636 @@
+/* _DynAnyStub.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.DynamicAny;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.CORBA.portable.ObjectImpl;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+import java.io.Serializable;
+
+/**
+ * Should provide support for remote invocation of methods on DynAny. As
+ * DynAny can never be remote at least till 1.5 inclusive, this class is
+ * not in use.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class _DynAnyStub
+ extends ObjectImpl
+ implements DynAny, Serializable
+{
+ /**
+ * Use serialVersionUID (v1.4) for interoperability.
+ */
+ private static final long serialVersionUID = -6521892777941121597L;
+
+ /**
+ * The purpose and value of this field are not documented.
+ */
+ public static final Class _opsClass = DynAnyOperations.class;
+
+ /**
+ * Create the DynAny stub.
+ */
+ public _DynAnyStub()
+ {
+ }
+
+ /**
+ * Create the naming context stub with the given delegate.
+ */
+ public _DynAnyStub(Delegate delegate)
+ {
+ _set_delegate(delegate);
+ }
+
+ /**
+ * Return the array of repository ids for this object.
+ */
+ public String[] _ids()
+ {
+ return new String[] { DynAnyHelper.id() };
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public TypeCode type()
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public boolean next()
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void destroy()
+ {
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public DynAny copy()
+ {
+ return this;
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void rewind()
+ {
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void assign(DynAny _0)
+ throws TypeMismatch
+ {
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public int component_count()
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public DynAny current_component()
+ throws TypeMismatch
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public boolean equal(DynAny _0)
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void from_any(Any _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public Any get_any()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public boolean get_boolean()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public char get_char()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public double get_double()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public DynAny get_dyn_any()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public float get_float()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public int get_long()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public long get_longlong()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public byte get_octet()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public org.omg.CORBA.Object get_reference()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public short get_short()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public String get_string()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public TypeCode get_typecode()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public int get_ulong()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public long get_ulonglong()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public short get_ushort()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public Serializable get_val()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public char get_wchar()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public String get_wstring()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_any(Any _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_boolean(boolean _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_char(char _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_double(double _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_dyn_any(DynAny _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_float(float _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_long(int _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_longlong(long _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_octet(byte _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_reference(org.omg.CORBA.Object _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_short(short _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_string(String _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_typecode(TypeCode _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_ulong(int _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_ulonglong(long _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_ushort(short _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_val(Serializable _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_wchar(char _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void insert_wstring(String _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public boolean seek(int _0)
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public Any to_any()
+ {
+ throw new MARSHAL(NOT_APPLICABLE);
+ }
+
+ static String NOT_APPLICABLE =
+ "DynAnys are always local objects. " +
+ "They and are never accessed on remote side via stubs.";
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/_DynArrayStub.java b/libjava/classpath/org/omg/DynamicAny/_DynArrayStub.java
new file mode 100644
index 0000000..4484f16
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/_DynArrayStub.java
@@ -0,0 +1,134 @@
+/* _DynArrayStub.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.DynamicAny;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+import java.io.Serializable;
+
+/**
+ * Should provide support for remote invocation of methods on DynArray. As
+ * DynArray can never be remote at least till 1.5 inclusive, this class is
+ * not in use.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class _DynArrayStub
+ extends _DynAnyStub
+ implements DynArray, Serializable
+{
+ /**
+ * Use serialVersionUID for interoperability.
+ */
+ private static final long serialVersionUID = -6302474930370950228L;
+
+ /**
+ * The purpose and value of this field are not documented.
+ */
+ public static final Class _opsClass = DynArrayOperations.class;
+
+ /**
+ * Create the DynArray stub.
+ */
+ public _DynArrayStub()
+ {
+ }
+
+ /**
+ * Create the naming context stub with the given delegate.
+ */
+ public _DynArrayStub(Delegate delegate)
+ {
+ _set_delegate(delegate);
+ }
+
+ /**
+ * Return the array of repository ids for this object.
+ */
+ public String[] _ids()
+ {
+ return new String[] { DynArrayHelper.id() };
+ }
+
+ /**
+ * The remote call of DynArray methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public Any[] get_elements()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynArray methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public DynAny[] get_elements_as_dyn_any()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynArray methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_elements(Any[] _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynArray methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_elements_as_dyn_any(DynAny[] _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/_DynEnumStub.java b/libjava/classpath/org/omg/DynamicAny/_DynEnumStub.java
new file mode 100644
index 0000000..ea7879b
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/_DynEnumStub.java
@@ -0,0 +1,132 @@
+/* _DynEnumStub.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.DynamicAny;
+
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+
+import java.io.Serializable;
+
+/**
+ * Should provide support for remote invocation of methods on DynEnum. As
+ * DynEnum can never be remote at least till 1.5 inclusive, this class is
+ * not in use.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class _DynEnumStub
+ extends _DynAnyStub
+ implements DynEnum, Serializable
+{
+ /**
+ * Use serialVersionUID (v1.4) for interoperability.
+ */
+ private static final long serialVersionUID = 696844314172031949L;
+
+ /**
+ * The purpose and value of this field are not documented.
+ */
+ public static final Class _opsClass = DynEnumOperations.class;
+
+ /**
+ * Create the DynEnum stub.
+ */
+ public _DynEnumStub()
+ {
+ }
+
+ /**
+ * Create the naming context stub with the given delegate.
+ */
+ public _DynEnumStub(Delegate delegate)
+ {
+ _set_delegate(delegate);
+ }
+
+ /**
+ * Return the array of repository ids for this object.
+ */
+ public String[] _ids()
+ {
+ return new String[] { DynEnumHelper.id() };
+ }
+
+ /**
+ * The remote call of DynEnum methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public String get_as_string()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynEnum methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public int get_as_ulong()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynEnum methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_as_string(String _0)
+ throws InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynEnum methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_as_ulong(int _0)
+ throws InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/_DynFixedStub.java b/libjava/classpath/org/omg/DynamicAny/_DynFixedStub.java
new file mode 100644
index 0000000..8e2747e
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/_DynFixedStub.java
@@ -0,0 +1,112 @@
+/* _DynFixedStub.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.DynamicAny;
+
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+import java.io.Serializable;
+
+/**
+ * Should provide support for remote invocation of methods on DynFixed. As
+ * DynFixed can never be remote at least till 1.5 inclusive, this class is
+ * not in use.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class _DynFixedStub
+ extends _DynAnyStub
+ implements DynFixed, Serializable
+{
+ /**
+ * Use serialVersionUID (v1.4) for interoperability.
+ */
+ private static final long serialVersionUID = -1932029532964417188L;
+
+ /**
+ * The purpose and value of this field are not documented.
+ */
+ public static final Class _opsClass = DynFixedOperations.class;
+
+ /**
+ * Create the DynFixed stub.
+ */
+ public _DynFixedStub()
+ {
+ }
+
+ /**
+ * Create the naming context stub with the given delegate.
+ */
+ public _DynFixedStub(Delegate delegate)
+ {
+ _set_delegate(delegate);
+ }
+
+ /**
+ * Return the array of repository ids for this object.
+ */
+ public String[] _ids()
+ {
+ return new String[] { DynFixedHelper.id() };
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public String get_value()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public boolean set_value(String _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/_DynSequenceStub.java b/libjava/classpath/org/omg/DynamicAny/_DynSequenceStub.java
new file mode 100644
index 0000000..5f1f038
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/_DynSequenceStub.java
@@ -0,0 +1,157 @@
+/* _DynSequenceStub.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.DynamicAny;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+import java.io.Serializable;
+
+/**
+ * Should provide support for remote invocation of methods on DynSequence. As
+ * DynSequence can never be remote at least till 1.5 inclusive, this class is
+ * not in use.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class _DynSequenceStub
+ extends _DynAnyStub
+ implements DynSequence, Serializable
+{
+ /**
+ * Use serialVersionUID (v1.4) for interoperability.
+ */
+ private static final long serialVersionUID = 7191437435669107554L;
+
+ /**
+ * The purpose and value of this field are not documented.
+ */
+ public static final Class _opsClass = DynSequenceOperations.class;
+
+ /**
+ * Create the DynSequence stub. To get the stub working,
+ * you must later set the delegate with
+ * {@link ObjectImpl#_set_delegate(Delegate)}.
+ */
+ public _DynSequenceStub()
+ {
+ }
+
+ /**
+ * Create the naming context stub with the given delegate.
+ */
+ public _DynSequenceStub(Delegate delegate)
+ {
+ _set_delegate(delegate);
+ }
+
+ /**
+ * Return the array of repository ids for this object.
+ */
+ public String[] _ids()
+ {
+ return new String[] { DynSequenceHelper.id() };
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public Any[] get_elements()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public DynAny[] get_elements_as_dyn_any()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_elements(Any[] _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_elements_as_dyn_any(DynAny[] _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public int get_length()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_length(int _0)
+ throws InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/_DynStructStub.java b/libjava/classpath/org/omg/DynamicAny/_DynStructStub.java
new file mode 100644
index 0000000..0b8231b
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/_DynStructStub.java
@@ -0,0 +1,158 @@
+/* _DynStructStub.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.DynamicAny;
+
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.TCKind;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+import java.io.Serializable;
+
+/**
+ * Should provide support for remote invocation of methods on DynStruct. As
+ * DynStruct can never be remote at least till 1.5 inclusive, this class is
+ * not in use.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class _DynStructStub
+ extends _DynAnyStub
+ implements DynStruct, Serializable
+{
+ /**
+ * Use serialVersionUID (v1.4) for interoperability.
+ */
+ private static final long serialVersionUID = -8415786200783826656L;
+
+ /**
+ * The purpose and value of this field are not documented.
+ */
+ public static final Class _opsClass = DynStructOperations.class;
+
+ /**
+ * Create the DynStruct stub. To get the stub working,
+ * you must later set the delegate with
+ * {@link ObjectImpl#_set_delegate(Delegate)}.
+ */
+ public _DynStructStub()
+ {
+ }
+
+ /**
+ * Create the naming context stub with the given delegate.
+ */
+ public _DynStructStub(Delegate delegate)
+ {
+ _set_delegate(delegate);
+ }
+
+ /**
+ * Return the array of repository ids for this object.
+ */
+ public String[] _ids()
+ {
+ return new String[] { DynStructHelper.id() };
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public TCKind current_member_kind()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public String current_member_name()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public NameValuePair[] get_members()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public NameDynAnyPair[] get_members_as_dyn_any()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_members(NameValuePair[] _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_members_as_dyn_any(NameDynAnyPair[] _0)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/_DynUnionStub.java b/libjava/classpath/org/omg/DynamicAny/_DynUnionStub.java
new file mode 100644
index 0000000..7f8eba7
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/_DynUnionStub.java
@@ -0,0 +1,190 @@
+/* _DynUnionStub.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.DynamicAny;
+
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.TCKind;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+import java.io.Serializable;
+
+/**
+ * Should provide support for remote invocation of methods on DynUnion. As
+ * DynUnion can never be remote at least till 1.5 inclusive, this class is
+ * not in use.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class _DynUnionStub
+ extends _DynAnyStub
+ implements DynUnion, Serializable
+{
+ /**
+ * Use serialVersionUID for interoperability.
+ */
+ private static final long serialVersionUID = -8921031953572009897L;
+
+ /**
+ * The purpose and value of this field are not documented.
+ */
+ public static final Class _opsClass = DynUnionOperations.class;
+
+ /**
+ * Create the DynUnion stub. To get the stub working,
+ * you must later set the delegate with
+ * {@link ObjectImpl#_set_delegate(Delegate)}.
+ */
+ public _DynUnionStub()
+ {
+ }
+
+ /**
+ * Create the naming context stub with the given delegate.
+ */
+ public _DynUnionStub(Delegate delegate)
+ {
+ _set_delegate(delegate);
+ }
+
+ /**
+ * Return the array of repository ids for this object.
+ */
+ public String[] _ids()
+ {
+ return new String[] { DynUnionHelper.id() };
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public DynAny member()
+ throws InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public TCKind discriminator_kind()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public DynAny get_discriminator()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public boolean has_no_active_member()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public TCKind member_kind()
+ throws InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public String member_name()
+ throws InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_discriminator(DynAny _0)
+ throws TypeMismatch
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_to_default_member()
+ throws TypeMismatch
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_to_no_active_member()
+ throws TypeMismatch
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/_DynValueStub.java b/libjava/classpath/org/omg/DynamicAny/_DynValueStub.java
new file mode 100644
index 0000000..5319a7b
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/_DynValueStub.java
@@ -0,0 +1,190 @@
+/* _DynValueStub.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.DynamicAny;
+
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.TCKind;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
+import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
+
+import java.io.Serializable;
+
+/**
+ * Should provide support for remote invocation of methods on DynValue. As
+ * DynValue can never be remote at least till 1.5 inclusive, this class is
+ * not in use.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public class _DynValueStub
+ extends _DynAnyStub
+ implements DynValue, Serializable
+{
+ /**
+ * Use serialVersionUID (v1.4) for interoperability.
+ */
+ private static final long serialVersionUID = 5815313794012360824L;
+
+ /**
+ * The purpose and value of this field are not documented.
+ */
+ public static final Class _opsClass = DynValueOperations.class;
+
+ /**
+ * Create the DynValue stub. To get the stub working,
+ * you must later set the delegate with
+ * {@link ObjectImpl#_set_delegate(Delegate)}.
+ */
+ public _DynValueStub()
+ {
+ }
+
+ /**
+ * Create the naming context stub with the given delegate.
+ */
+ public _DynValueStub(Delegate delegate)
+ {
+ _set_delegate(delegate);
+ }
+
+ /**
+ * Return the array of repository ids for this object.
+ */
+ public String[] _ids()
+ {
+ return new String[] { DynValueHelper.id() };
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public TCKind current_member_kind()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public String current_member_name()
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public NameValuePair[] get_members()
+ throws InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public NameDynAnyPair[] get_members_as_dyn_any()
+ throws InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_members(NameValuePair[] a_members)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_members_as_dyn_any(NameDynAnyPair[] a_members)
+ throws TypeMismatch, InvalidValue
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public boolean is_null()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_to_null()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+
+ /**
+ * The remote call of DynAny methods is not possible.
+ *
+ * @throws MARSHAL, always.
+ */
+ public void set_to_value()
+ {
+ throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/DynamicAny/package.html b/libjava/classpath/org/omg/DynamicAny/package.html
new file mode 100644
index 0000000..997006d
--- /dev/null
+++ b/libjava/classpath/org/omg/DynamicAny/package.html
@@ -0,0 +1,87 @@
+
+
+
+
+
+ORB orb = ORB.init(new String[0], null);
+DynAnyFactory f = DynAnyFactoryHelper.narrow(orb.resolve_initial_references("DynAnyFactory"));
+
+DynAny's are also returned by some methods, invoked on another DynAny.
+
+ *
+ *
+ *
+ *
+ * {@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.
+ *
+ * @throws NO_IMPLEMENT always.
+ */
+ Policy get_request_policy(int type) throws INV_POLICY;
+
+ /**
+ * Returns the repository id of the remote exception that was thrown on the
+ * server side.
+ *
+ * @return the exception repository id.
+ *
+ * @see #received_exception()
+ */
+ String received_exception_id();
+
+ /**
+ * Returns the remote exception that was thrown on the server side.
+ *
+ * @return the Any, holding this exception.
+ *
+ * @see #received_exception_id()
+ */
+ Any received_exception();
+
+ /**
+ * Allows the interceptor to add the service contexts to the request. Such
+ * added contexts can carry arbitrary data and can be later accessed on the
+ * server side by the server request interceptor, using
+ * {@link RequestInfoOperations#get_request_service_context}.
+ *
+ * @param service_context the context to add.
+ * @param replace if true, the existing context with the same Id will be
+ * replaced. If false, the BAD_INV_ORDER will be thrown in that case.
+ *
+ * @throws BAD_INV_ORDER minor 15 if the context with the same Id already
+ * exists and replace=false.
+ */
+ void add_request_service_context(ServiceContext service_context,
+ boolean replace
+ );
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptor.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptor.java
new file mode 100644
index 0000000..9fdf2f1
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptor.java
@@ -0,0 +1,54 @@
+/* ClientRequestInterceptor.java --
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package org.omg.PortableInterceptor;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * A client side request interceptor that is notified on various request
+ * processing steps on a client side.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface ClientRequestInterceptor extends Interceptor,
+ ClientRequestInterceptorOperations,
+ org.omg.CORBA.Object,
+ IDLEntity
+{
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java
new file mode 100644
index 0000000..4a60b77
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java
@@ -0,0 +1,128 @@
+/* ClientRequestInterceptorOperations.java --
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package org.omg.PortableInterceptor;
+
+
+/**
+ * Defines operations, applicable to the client side request interceptor. The
+ * operations are called by ORB at the appropriate interception points.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface ClientRequestInterceptorOperations
+ extends InterceptorOperations
+{
+ /**
+ * ORB calls this method before sending the request to the server.
+ *
+ * @param info the object for accessing and manipulating the request
+ * information.
+ *
+ * @throws SystemException if it does, the send_request is not called for the
+ * subsequent interceptors, calling receive_exception instead. The completion
+ * status of this exception must be COMPLETED_NO.
+ *
+ * @throws ForwardRequest to forward the invocation to another target. The
+ * send_request is not called for the subsequent interceptors, calling
+ * receive_other instead.
+ */
+ void send_request(ClientRequestInfo info) throws ForwardRequest;
+
+ /**
+ * ORB calls this method after the normal reply is received from the server
+ * and before the control is returned to the calling client code.
+ *
+ * @param info the object for accessing and manipulating the request
+ * information.
+ *
+ * @throws SystemException if it does, the receive_reply is not called for the
+ * subsequent interceptors, calling receive_exception instead. The completion
+ * status of this exception must be COMPLETED_YES.
+ */
+ void receive_reply(ClientRequestInfo info);
+
+ /**
+ * ORB calls this method after the receiving the message that a remote
+ * exception has been thrown on a server side and before raising this
+ * exception in the client side.
+ *
+ * @param info the object for accessing and manipulating the request
+ * information.
+ *
+ * @throws SystemException has the effect of changing the exception that
+ * successive interceptors receive on their calls to receive_other. If the
+ * original exception is a system exception, the completion_status of the new
+ * exception must match the exception being replaced. If the original
+ * exception is a user exception, then the completion_status of the new
+ * exception must be COMPLETED_YES.
+ *
+ * @throws ForwardRequest to forward the invocation to another target. The
+ * receive_exception is not called for the subsequent interceptors, calling
+ * receive_other instead. If the completion_status of the original exception
+ * is not a COMPLETED_NO, the ForwardRequest must not be raised.
+ */
+ void receive_exception(ClientRequestInfo info) throws ForwardRequest;
+
+ /**
+ * /** ORB normally calls this method after receiving the forwarding message.
+ *
+ * @param info the object for accessing and manipulating the request
+ * information.
+ *
+ * @throws SystemException if it does, the receive_other is not called for the
+ * subsequent interceptors, calling receive_exception instead.
+ *
+ * @throws ForwardRequest has the effect of changing the redirection that
+ * successive interceptors receive on their calls to receive_other.
+ */
+ void receive_other(ClientRequestInfo info) throws ForwardRequest;
+
+ /**
+ * This method is called by if ORB uses the Time- Independent Invocation (TII)
+ * polling.
+ *
+ * @param info the object for accessing and manipulating the request
+ * information.
+ *
+ * @throws SystemException if it does, the send_poll is not called for the
+ * subsequent interceptors, calling receive_exception instead. The completion
+ * status of this exception must be COMPLETED_NO.
+ */
+ void send_poll(ClientRequestInfo info);
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableInterceptor/Current.java b/libjava/classpath/org/omg/PortableInterceptor/Current.java
new file mode 100644
index 0000000..d53d5c3
--- /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;
+
+/**
+ * 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 +{ +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java new file mode 100644 index 0000000..90c2325 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitializerOperations.java @@ -0,0 +1,73 @@ +/* ORBInitializerOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + + +/** + * Defines operations, applicable to the ORBInitializer. These operations are + * invoked on initializer from the ORB.init. + * + * @see ORBInitializer + */ +public interface ORBInitializerOperations +{ + /** + * This method is called during the first step of initialization. It must + * register all initial references that are expected to be used by other + * interceptors. + * + * @param info the object describing ORB being created and containing methods + * to register the interceptor. + * + * @see ORBInitInfoOperations#register_initial_reference + */ + void pre_init(ORBInitInfo info); + + /** + * This method called during the subsequent step of initialization. In this + * method it can be assumed that all required initial references are already + * registered. + * + * @param info the object describing ORB being created and containing methods + * to register the interceptor. + * + * @see ORBInitInfoOperations#register_initial_references + */ + void post_init(ORBInitInfo info); +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/PolicyFactory.java b/libjava/classpath/org/omg/PortableInterceptor/PolicyFactory.java new file mode 100644 index 0000000..6478e40 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/PolicyFactory.java @@ -0,0 +1,57 @@ +/* PolicyFactory.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * The {@link ORBInitializer} may register the PolicyFactory to create the + * service specific policies later. The factory will be later used by + * {@link org.omg.CORBA.ORB#create_policy}. + * + * @see org.omg.PortableInterceptor.ORBInitInfoOperations#register_policy_factory + * @see org.omg.CORBA.ORB#create_policy + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface PolicyFactory extends PolicyFactoryOperations, + org.omg.CORBA.Object, + IDLEntity +{ +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/PolicyFactoryOperations.java b/libjava/classpath/org/omg/PortableInterceptor/PolicyFactoryOperations.java new file mode 100644 index 0000000..4e5a54e --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/PolicyFactoryOperations.java @@ -0,0 +1,69 @@ +/* PolicyFactoryOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; + +/** + * A service implementation can register policy factory during ORB initialization + * for creating the service-specific policies. This factory then will be + * invoked form {@link org.omg.CORBA.ORB#create_policy(int, Any)}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + * + * @see org.omg.CORBA.ORB#create_policy + * @see ORBInitInfoOperations#register_policy_factory + */ +public interface PolicyFactoryOperations +{ + /** + * Create and return the policy of the given type, having the given value. + * + * @param policy_type the type of the policy being created + * @param policy_value the value of the policy, wrapped in {@link Any}. + * Depending from the policy, the Any can hold various values, + * including complex data structures. + * + * @return the created policy. + */ + Policy create_policy(int policy_type, Any policy_value) + throws PolicyError; +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/RequestInfo.java b/libjava/classpath/org/omg/PortableInterceptor/RequestInfo.java new file mode 100644 index 0000000..0285a80 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/RequestInfo.java @@ -0,0 +1,55 @@ +/* RequestInfo.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * Provides access to request information, available to the + * {@link ClientRequestInterceptor} or {@link ServerRequestInterceptor}. The + * additional operations, specific to the server and client are defined in the + * derived interfaces {@link ServerRequestInfo} and {@link ClientRequestInfo}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface RequestInfo extends RequestInfoOperations, + org.omg.CORBA.Object, + IDLEntity +{ +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java new file mode 100644 index 0000000..f865a14 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/RequestInfoOperations.java @@ -0,0 +1,190 @@ +/* RequestInfoOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +import org.omg.Dynamic.Parameter; +import org.omg.IOP.ServiceContext; + +/** + * Defines operations that are applicable for both server and client request. + * The additional operations, specific to the server and client request are + * defined in the derived interfaces {@link ServerRequestInfoOperations} and + * {@link ClientRequestInfoOperations}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface RequestInfoOperations +{ + /** + * Return the parameters of the operation being invoked. + * + * @return the array, containing parameters of the operations or an empty + * array for the operations with no parameters. + * + * @throws NO_RESOURCES if the parameters are not available. The parameters + * are only available for DII (via {@link org.omg.CORBA.Request} or DSI calls. + * They are not available for calls via IDL - generated stubs. + */ + Parameter[] arguments(); + + /** + * Returns the names of all contexts of the operation being invoked. + * + * @return the array of strings, defining contexts. + * + * @throws NO_RESOURCES if the contexts are not available. The contexts are + * only available for DII (via {@link org.omg.CORBA.Request} or DSI calls. + * They are not available for calls via IDL - generated stubs. + */ + String[] contexts(); + + /** + * Returns the typecodes, defining all exceptions that the operation may + * throw. + * + * @return the array of exception typecodes, empty array if the operation + * should not throw any exceptions. + * + * @throws NO_RESOURCES if the exception list is not available. This list is + * only available for DII (via {@link org.omg.CORBA.Request} or DSI calls and + * only on the client side. It is not available for calls via IDL - generated + * stubs or on the server side. + */ + TypeCode[] exceptions(); + + /** + * If the request contains forwarding information (the reply_status attribute + * being LOCATION_FORWARD), return the forwarding target. + * + * @return the object where the request should be forwarded. + */ + org.omg.CORBA.Object forward_reference(); + + /** + * Get the service context with the given ctx_name that is associated with the + * reply. + * + * @param ctx_name the name of the service context + * + * @return the copy of the corresponding context. + * + * @throws BAD_PARAM minor 26, if the context with the give ctx_name does not + * exist. + */ + ServiceContext get_reply_service_context(int ctx_name) + throws BAD_PARAM; + + /** + * Get the service context with the given ctx_name that is associated with the + * request. + * + * @param ctx_name the name of the service context + * + * @return the copy of the corresponding context. + * + * @throws BAD_PARAM minor 26, if the context with the give ctx_name does not + * exist. + */ + ServiceContext get_request_service_context(int ctx_name) + throws BAD_PARAM; + + /** + * Get the data from the given slot of the PortableInterceptor.Current that is + * in the scope of the request. + */ + Any get_slot(int id) throws InvalidSlot; + + /** + * Get the names of the service contexts being sent on the request. + * + * @return array of strings, naming the contexts. + */ + String[] operation_context(); + + /** + * Get the name of the operation being invoked. + * + * @return the name of the operation, usually the name of method being called. + */ + String operation(); + + /** + * Get the reoly state as result of the operation invocation. + * + * @return the value field of one of the following: {@link SUCCESSFUL}, + * {@link SYSTEM_EXCEPTION}, {@link USER_EXCEPTION}, + * {@link LOCATION_FORWARD} or {@link TRANSPORT_RETRY}. + */ + short reply_status(); + + /** + * Get the request id. + * + * @return an id that uniquely identifies the current request/reply sequence. + */ + int request_id(); + + /** + * Indicates whether request sender expected any response. + * + * @return true if the response was expected, false otherwise. + */ + boolean response_expected(); + + /** + * Get the result of the operation invocation. + * + * @return an Any, containing the value, returned by the performed operation. + */ + Any result(); + + /** + * Determines how far the request shall progress before control is returned to + * the client. However up till JDK 1.5 inclusive this method always returns + * SYNC_WITH_TRANSPORT. + * + * @return {@link org.omg.Messaging.SYNC_WITH_TRANSPORT.value (1), always. + * + * @specnote as defined in the Suns 1.5 JDK API. + */ + short sync_scope(); +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfo.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfo.java new file mode 100644 index 0000000..2aeba2b --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfo.java @@ -0,0 +1,54 @@ +/* ServerRequestInfo.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * Provides request information, accessible for the + * {@link ServerRequestInterceptor}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServerRequestInfo extends ServerRequestInfoOperations, + org.omg.CORBA.Object, + IDLEntity, + RequestInfo +{ +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java new file mode 100644 index 0000000..7646253 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java @@ -0,0 +1,302 @@ +/* ServerRequestInfoOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.INV_POLICY; +import org.omg.CORBA.Policy; +import org.omg.IOP.ServiceContext; + +/** + * Provides request information, accessible for the + * {@link ClientRequestInterceptor}. Some methods of this interface are not + * valid at all interception points. The following table shows the validity of + * each method. If it is not valid, BAD_INV_ORDER minor 14 will be thrown. + * + *| + * | {@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} | + *
name refers a non existing POA.
+ * Provides the Id of the object currently being served and POA + * to that this object is connected. Both Id and POA can be + * simpler obtained from the servant by {@link Servant#_object_id() } + * and {@link Servant#_poa()} that use POA Current indirectly. + * The operations on Current for obtaining + * these data are defined in {@link CurrentOperations}. + *
+ * As long as the ORB reference is still available, the current information + * is available via {@link Current} that is returned by + * ORB.resolve_initial_references("POACurrent"). To support this call, + * the ORB maintains the thread to invocation data map for all calls that + * are currently being processed. + *
+ * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface Current + extends CurrentOperations, org.omg.CORBA.Current, IDLEntity +{ +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/CurrentHelper.java b/libjava/classpath/org/omg/PortableServer/CurrentHelper.java new file mode 100644 index 0000000..281cefa --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/CurrentHelper.java @@ -0,0 +1,142 @@ +/* CurrentHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the +* CORBA object {@link Current}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class CurrentHelper +{ + /** + * Get the type code of the POA Current. + * + * @return a type code of the object with POA Current id, named "Current". + */ + public static TypeCode type() + { + return ORB.init().create_interface_tc(id(), "Current"); + } + + /** + * Insert the POA Current into the given Any. + * + * @param any the Any to insert into. + * @param that the POA Current to insert. + */ + public static void insert(Any any, Current that) + { + any.insert_Object(that); + } + + /** + * Extract the POA Current from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain a POA Current. + */ + public static Current extract(Any any) + { + return narrow(any.extract_Object()); + } + + /** + * Get the POA Current repository id. + * + * @return "IDL:omg.org/PortableServer/Current:2.3", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/Current:2.3"; + } + + /** + * Cast the passed object into the POA Current. + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a Current. + */ + public static Current narrow(org.omg.CORBA.Object obj) + { + try + { + return (Current) obj; + } + catch (ClassCastException ex) + { + BAD_PARAM bad = new BAD_PARAM("Not a POA Current"); + bad.initCause(ex); + throw bad; + } + } + + /** + * Not supported for compatibility reasons. + * + * @specnote Not supported by Sun at least till jdk 1.4 inclusive. + * + * @throws NO_IMPLEMENT always. + */ + public static Current read(InputStream input) + { + throw new NO_IMPLEMENT(); + } + + /** + * Not supported for compatibility reasons. + * + * @specnote Not supported by Sun at least till jdk 1.4 inclusive. + * + * @throws NO_IMPLEMENT always. + */ + public static void write(OutputStream output, Current value) + { + throw new NO_IMPLEMENT(); + } +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/CurrentOperations.java b/libjava/classpath/org/omg/PortableServer/CurrentOperations.java new file mode 100644 index 0000000..b2f23f2 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/CurrentOperations.java @@ -0,0 +1,81 @@ +/* CurrentOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.PortableServer.CurrentPackage.NoContext; + +/** + * Provides the Id of the object currently being served and POA + * to that this object is connected. Both Id and POA can be much + * simpler obtained from the servant by {@link Servant#_object_id() } + * and {@link Servant#_poa()} that use the CurrentOperations indirectly. + * + * As long as the ORB reference is still available, the current information + * is available via {@link Current} that is returned by + * ORB.resolve_initial_references("POACurrent"). To support this call, + * the ORB maintains the thread to invocation data map for all calls that + * are currently being processed. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface CurrentOperations + extends org.omg.CORBA.CurrentOperations +{ + /** + * Returns the Id of the object currently being served. The returned + * value is also correct if the calling code is running is several + * paralled threads. + * + * @return the Id of the object that is currently being served by this + * thread. + */ + byte[] get_object_id() + throws NoContext; + + /** + * Returns POA to that the object currently being served is connected. + * The returned value is also correct if the calling code is running is several + * paralled threads. + * + * @return the Id of the object that is currently being served by this + * thread. + */ + POA get_POA() + throws NoContext; +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/DynamicImplementation.java b/libjava/classpath/org/omg/PortableServer/DynamicImplementation.java new file mode 100644 index 0000000..6a333e1 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/DynamicImplementation.java @@ -0,0 +1,58 @@ +/* DynamicImplementation.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.PortableServer; + +import org.omg.CORBA.ServerRequest; + +/** + * This class is used for servants that support calling via server request. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class DynamicImplementation + extends Servant +{ + /** + * Handle the invocation via passed request. + * + * @param request the data structure, used both to pass parameters + * and return results of the invocation. + */ + public abstract void invoke(ServerRequest request); +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ForwardRequest.java b/libjava/classpath/org/omg/PortableServer/ForwardRequest.java new file mode 100644 index 0000000..f0588f4 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ForwardRequest.java @@ -0,0 +1,108 @@ +/* ForwardRequest.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +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.PortableServer; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + *+ * This exception is raised by {@link ServantManager} to indicate that the + * invocation target has moved to another known location. In this case, + * the client will receive a redirection (LOCATION_FORWARD) message and should + * resend the request to the new target. The exception contains the object + * reference, indicating the new location. + *
+ * The exception can be thrown both by servant locators and servant activators. + * If the exception is raised anywhere else than in the ServantManager + * methods, it is handled as an ordinary user excepton. + *
+ * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public class ForwardRequest + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -4159318367582473975L; + + /** + * The object reference, indicating the new location of the invocation target. + */ + public org.omg.CORBA.Object forward_reference; + + /** + * Create ForwardRequest with no explaining message and stating the + * new location isnull.
+ */
+ public ForwardRequest()
+ {
+ }
+
+ /**
+ * Create the ForwardRequest with explaining message and
+ * initialising the object reference to the given value.
+ *
+ * @param why a string, explaining, why this exception has been thrown.
+ * @param a_forward_reference a value for forward_reference.
+ */
+ public ForwardRequest(String why, org.omg.CORBA.Object a_forward_reference)
+ {
+ super(why);
+ this.forward_reference = a_forward_reference;
+ }
+
+ /**
+ * Create the ForwardRequest without explaining
+ * message and initialising the object reference to the given value.
+ *
+ * @param a_forward_reference a value for forward_reference.
+ */
+ public ForwardRequest(org.omg.CORBA.Object a_forward_reference)
+ {
+ this.forward_reference = a_forward_reference;
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java b/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java
new file mode 100644
index 0000000..6f8d5ea
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java
@@ -0,0 +1,159 @@
+/* ForwardRequestHelper.java --
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package org.omg.PortableServer;
+
+import gnu.CORBA.Poa.ForwardRequestHolder;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.ObjectHelper;
+import org.omg.CORBA.StructMember;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+ * The helper operations for the exception {@link ForwardRequest}.
+ *
+ * @specnote The helper must be here and not in POA subpackage as it must
+ * be discovered by the {@link ObjectCreator} when reading this remote
+ * exception.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public abstract class ForwardRequestHelper
+{
+ /**
+ * The cached typecode value, computed only once.
+ */
+ private static TypeCode typeCode;
+
+ /**
+ * Extract the ForwardRequest from given Any.
+ * This method uses the ForwardRequestHolder.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain ForwardRequest.
+ */
+ public static ForwardRequest extract(Any any)
+ {
+ try
+ {
+ return ((ForwardRequestHolder) any.extract_Streamable()).value;
+ }
+ catch (ClassCastException cex)
+ {
+ BAD_OPERATION bad = new BAD_OPERATION("ForwardRequest expected");
+ bad.initCause(cex);
+ throw bad;
+ }
+ }
+
+ /**
+ * Get the ForwardRequest repository id.
+ *
+ * @return "ForwardRequest", always.
+ */
+ public static String id()
+ {
+ return "ForwardRequest";
+ }
+
+ /**
+ * Insert the ForwardRequest into the given Any.
+ * This method uses the ForwardRequestHolder.
+ *
+ * @param any the Any to insert into.
+ * @param that the ForwardRequest to insert.
+ */
+ public static void insert(Any any, ForwardRequest that)
+ {
+ any.insert_Streamable(new ForwardRequestHolder(that));
+ }
+
+ /**
+ * Read the exception from the CDR intput stream.
+ *
+ * @param input a org.omg.CORBA.portable stream to read from.
+ */
+ public static ForwardRequest read(InputStream input)
+ {
+ // Read the exception repository id.
+ String id = input.read_string();
+ ForwardRequest value = new ForwardRequest();
+
+ value.forward_reference = input.read_Object();
+ return value;
+ }
+
+ /**
+ * Create the ForwardRequest typecode (structure,
+ * named "ForwardRequest").
+ * The typecode states that the structure contains the
+ * following fields: forward_reference.
+ */
+ public static TypeCode type()
+ {
+ if (typeCode == null)
+ {
+ ORB orb = ORB.init();
+ StructMember[] members = new StructMember[ 1 ];
+
+ TypeCode field;
+
+ field = ObjectHelper.type();
+ members [ 0 ] = new StructMember("forward_reference", field, null);
+ typeCode = orb.create_exception_tc(id(), "ForwardRequest", members);
+ }
+ return typeCode;
+ }
+
+ /**
+ * Write the exception to the CDR output stream.
+ *
+ * @param output a org.omg.CORBA.portable stream stream to write into.
+ * @param value a value to write.
+ */
+ public static void write(OutputStream output, ForwardRequest value)
+ {
+ // Write the exception repository id.
+ output.write_string(id());
+ output.write_Object(value.forward_reference);
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicy.java b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicy.java
new file mode 100644
index 0000000..cde9e11
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicy.java
@@ -0,0 +1,58 @@
+/* IdAssignmentPolicy.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.PortableServer;
+
+import org.omg.CORBA.Policy;
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Specifies the Object Id assignment policy.
+ *
+ * The policy can return its current value, as defined.
+ * in {@link IdAssignmentPolicyOperations}.
+ *
+ * @see IdAssignmentPolicyValue for the possible values of this policy.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface IdAssignmentPolicy
+ extends Policy, IdAssignmentPolicyOperations, IDLEntity
+{
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyOperations.java
new file mode 100644
index 0000000..993a780
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyOperations.java
@@ -0,0 +1,55 @@
+/* IdAssignmentPolicyOperations.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.PortableServer;
+
+import org.omg.CORBA.PolicyOperations;
+
+/**
+ * Defines the operations, applicable to the IdAssignmentPolicy.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface IdAssignmentPolicyOperations
+ extends PolicyOperations
+{
+ /**
+ * Return the value of this policy type, stated by the current instance.
+ */
+ IdAssignmentPolicyValue value();
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicy.java b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicy.java
new file mode 100644
index 0000000..f78e87e
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicy.java
@@ -0,0 +1,57 @@
+/* IdUniquenessPolicy.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.PortableServer;
+
+import org.omg.CORBA.Policy;
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Specfies the Id uniqueness policy.
+ *
+ * The policy can return its current value, as defined.
+ * in {@link IdUniquenessPolicyOperations}.
+ *
+ * @see IdUniquenessPolicyValue for the possible values of this policy.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface IdUniquenessPolicy
+ extends Policy, IdUniquenessPolicyOperations, IDLEntity
+{
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyOperations.java
new file mode 100644
index 0000000..3019396
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyOperations.java
@@ -0,0 +1,55 @@
+/* IdUniquenessPolicyOperations.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.PortableServer;
+
+import org.omg.CORBA.PolicyOperations;
+
+/**
+ * Defines the operations, applicable to the IdUniquenessPolicy.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface IdUniquenessPolicyOperations
+ extends PolicyOperations
+{
+ /**
+ * Return the value of this policy type, stated by the current instance.
+ */
+ IdUniquenessPolicyValue value();
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicy.java b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicy.java
new file mode 100644
index 0000000..c3859d2
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicy.java
@@ -0,0 +1,57 @@
+/* ImplicitActivationPolicy.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.PortableServer;
+
+import org.omg.CORBA.Policy;
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Specifies the implicit activation policy.
+ *
+ * The policy can return its current value, as defined.
+ * in {@link ImplicitActivationPolicyOperations}.
+ *
+ * @see ImplicitActivationPolicyValue for the possible values of this policy.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface ImplicitActivationPolicy
+ extends Policy, ImplicitActivationPolicyOperations, IDLEntity
+{
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyOperations.java
new file mode 100644
index 0000000..d855ec8
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyOperations.java
@@ -0,0 +1,55 @@
+/* ImplicitActivationPolicyOperations.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.PortableServer;
+
+import org.omg.CORBA.PolicyOperations;
+
+/**
+ * Defines the operations, applicable to the ImplicitActivationPolicy.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface ImplicitActivationPolicyOperations
+ extends PolicyOperations
+{
+ /**
+ * Return the value of this policy type, stated by the current instance.
+ */
+ ImplicitActivationPolicyValue value();
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/LifespanPolicy.java b/libjava/classpath/org/omg/PortableServer/LifespanPolicy.java
new file mode 100644
index 0000000..2e77bbe
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/LifespanPolicy.java
@@ -0,0 +1,58 @@
+/* LifespanPolicy.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.PortableServer;
+
+import org.omg.CORBA.Policy;
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Specifies the object life span policy, if they can outlive the POA
+ * with that they were first created.
+ *
+ * The policy can return its current value, as defined.
+ * in {@link LifespanPolicyOperations}.
+ *
+ * @see LifespanPolicyValue for the possible values of this policy.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface LifespanPolicy
+ extends Policy, LifespanPolicyOperations, IDLEntity
+{
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/LifespanPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/LifespanPolicyOperations.java
new file mode 100644
index 0000000..20eda70
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/LifespanPolicyOperations.java
@@ -0,0 +1,55 @@
+/* LifespanPolicyOperations.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.PortableServer;
+
+import org.omg.CORBA.PolicyOperations;
+
+/**
+ * Defines the operations, applicable to the LifespanPolicy.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface LifespanPolicyOperations
+ extends PolicyOperations
+{
+ /**
+ * Return the value of this policy type, stated by the current instance.
+ */
+ LifespanPolicyValue value();
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/POA.java b/libjava/classpath/org/omg/PortableServer/POA.java
new file mode 100644
index 0000000..863a12b
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/POA.java
@@ -0,0 +1,66 @@
+/* POA.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.PortableServer;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ *
+ * The Portable Object Adapter (POA) provides more control on the request
+ * processing than it is possible when connecting objects directly to the
+ * ORB. For details, see the general description of the
+ * org.omg.PortableServer package.
+ *
+ * The operations, supported by POA are defined + * separately in {@link POAOperations}. In the simpliest case, the servant + * implementation is connected to POA by + * {@link POAOperations#servant_to_reference}, the returned object being a + * target of remote and local invocations, despite the numerous other + * strategies are possible. + *
+ * + * @see org.omg.CORBA.ORB.resolve_initial_references + * @see POAOperations.servant_to_reference + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface POA + extends POAOperations, IDLEntity, org.omg.CORBA.Object +{ +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/POAHelper.java b/libjava/classpath/org/omg/PortableServer/POAHelper.java new file mode 100644 index 0000000..2928d9f --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAHelper.java @@ -0,0 +1,147 @@ +/* POAHelper.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.PortableServer; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.ORB; +import org.omg.CORBA.Any; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the CORBA object {@link POA}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class POAHelper +{ + /** + * Cast the passed object into the POA. As POA is a local object, the method + * just uses java type cast. + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a POA. + */ + public static POA narrow(org.omg.CORBA.Object obj) + { + try + { + return (POA) obj; + } + catch (ClassCastException cex) + { + throw new BAD_PARAM(obj.getClass().getName() + " is not a POA"); + } + } + + /** + * Get the type code of the {@link POA}. + */ + public static TypeCode type() + { + return ORB.init().create_interface_tc(id(), "POA"); + } + + /** + * Insert the POA into the given Any. + * + * @param any the Any to insert into. + * + * @param that the POA to insert. + */ + public static void insert(Any any, POA that) + { + any.insert_Object(that); + } + + /** + * Extract the POA from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain POA. + */ + public static POA extract(Any any) + { + return narrow(any.extract_Object()); + } + + /** + * Get the POA repository id. + * + * @return "IDL:omg.org/PortableServer/POA:2.3", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POA:2.3"; + } + + /** + * This should read POA from the CDR input stream, but, following the specs, + * it doesnot. The jdk 1.5 API specification defines that POA cannot be + * exported. + * + * @param input a org.omg.CORBA.portable stream to read from. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL, always. + */ + public static POA read(InputStream input) + { + throw new MARSHAL("Not applicable"); + } + + /** + * This should read POA from the CDR input stream, but, following the specs, + * it doesnot. The jdk 1.5 API specification defines that POA cannot be + * exported. + * + * @param input a org.omg.CORBA.portable stream to read from. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL, always. + */ + public static void write(OutputStream output, POA value) + { + throw new MARSHAL("Not applicable"); + } +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/POAManager.java b/libjava/classpath/org/omg/PortableServer/POAManager.java new file mode 100644 index 0000000..6d93eb3 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAManager.java @@ -0,0 +1,63 @@ +/* POAManager.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.PortableServer; + +import org.omg.CORBA.portable.IDLEntity; + +/** + *+ * A POA manager is associated with one or more POAs and provides means + * to regulate they activity. Using manage, it is possible to force + * requests for those POAs to be queued or discarded or have those POAs + * deactivated. The manager can turn POAs to and from holding, + * active and discarding states, but the incative state is irreversible. + *
+ *+ * The manager of the ORBs root POA can be obtained by resolving initial + * reference "RootPOAManager". + *
+ * + * @see POAManagerOperations + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface POAManager + extends POAManagerOperations, IDLEntity, org.omg.CORBA.Object +{ +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/POAManagerOperations.java b/libjava/classpath/org/omg/PortableServer/POAManagerOperations.java new file mode 100644 index 0000000..90206d4 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAManagerOperations.java @@ -0,0 +1,141 @@ +/* POAManagerOperations.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.PortableServer; + +import org.omg.PortableServer.POAManagerPackage.AdapterInactive; +import org.omg.PortableServer.POAManagerPackage.State; + +/** + * Defines the operations, applicable to the {@link POAManager}. + * These operations can turn the associated POAs to and from holding, + * active and discarding states, but the incative state is irreversible. + * The inactivated POAs can only be recreated after they were destroyed. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface POAManagerOperations +{ + /** + * Turns the associated POAs into active state, allowing them to receive + * and process requests. + * + * @throws AdapterInactive if the POAs are in the inactive state. If + * once inactivated, the POA cannot be activated again. + * This method can only be called to leave the holding or discarding state. + */ + void activate() + throws AdapterInactive; + + /** + *+ * Turns the asociated POAs into inactive state. The POAs in the incative + * state will reject new requests. A cliet, trying to invoke an + * object, belonging to the inactivated POA, will receive the remote exception + * ({@link org.omg.CORBA.OBJ_ADAPTER}, minor code 0x535503ea, incomplete). + *
+ * If the POA is once inactivated, it cannot be activated again. + * The operation is used when the associated POAs are to be shut down. + *
+ *+ * Some independent implementations may set the minor code of the + * OBJ_ADAPTER to 1, as recommended by OMG (formal/04-03-12). + * The interoperable systems should expect any of these two values. + *
+ * + * @param etherealize_objects if true, the servant managers of the + * associated POAs, having RETAIN and USE_SERVANT_MANAGER policies, + * will receive a call of {@link ServantActivatorOperations#etherealize}. + * + * @param wait_for_completion if true, the method call suspends the current + * thread till POAs complete the requests they are currently processing. If + * false, the method returns immediately. + *+ * + * @specnote The 0x535503ea is a Sun specific minor exception code 1002, + * used for interoperability reasons. + * + * @throws AdapterInactive if the POAs are already in the inactive state. + * + * @see POAOperations#destroy + */ + void deactivate(boolean etherealize_objects, boolean wait_for_completion) + throws AdapterInactive; + + /** + *
+ * Turns the associated POAs into discaring state. In this state, the POAs + * discard the incoming requests. This mode is used in situations when + * the server is flooded with requests. The client receives remote exception + * ({@link org.omg.CORBA.TRANSIENT}, minor code 0x535503e9, incomplete). + *
+ * Some independent implementations may set the minor code of the + * TRANSIENT to 1, as recommended by OMG (formal/04-03-12). + * The interoperable systems should expect any of these two values. + *
+ * + * @param wait_for_completion if true, the method call suspends the current + * thread till POAs complete the requests they are currently processing. If + * false, the method returns immediately. + * + * @specnote The 0x535503e9 is a Sun specific minor exception code 1001, + * used for interoperability reasons. + * + * @throws AdapterInactive if the POAs are in the inactive state. + */ + void discard_requests(boolean wait_for_completion) + throws AdapterInactive; + + /** + * Get the state of the POA manager. + */ + State get_state(); + + /** + * Turns the associated POAs into holding state. In this state, the POAs + * queue incoming requests but do not process them. + * + * @param wait_for_completion if true, the method call suspends the current + * thread till POAs complete the requests they are currently processing. If + * false, the method returns immediately. + + * @throws AdapterInactive if the POAs are in the inactive state. + */ + void hold_requests(boolean wait_for_completion) + throws AdapterInactive; +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/POAOperations.java b/libjava/classpath/org/omg/PortableServer/POAOperations.java new file mode 100644 index 0000000..1c22cee --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAOperations.java @@ -0,0 +1,525 @@ +/* POAOperations.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.PortableServer; + +import org.omg.CORBA.Policy; +import org.omg.PortableServer.POAPackage.AdapterAlreadyExists; +import org.omg.PortableServer.POAPackage.AdapterNonExistent; +import org.omg.PortableServer.POAPackage.InvalidPolicy; +import org.omg.PortableServer.POAPackage.NoServant; +import org.omg.PortableServer.POAPackage.ObjectAlreadyActive; +import org.omg.PortableServer.POAPackage.ObjectNotActive; +import org.omg.PortableServer.POAPackage.ServantAlreadyActive; +import org.omg.PortableServer.POAPackage.ServantNotActive; +import org.omg.PortableServer.POAPackage.WrongAdapter; +import org.omg.PortableServer.POAPackage.WrongPolicy; + +/** + * Defines the operations, applicable to the POA. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface POAOperations +{ + /** + * Creates a new POA as a child of the target POA. + * + * @param child_name the name of the child POA being created. + * @param manager the manager that will control the new POA. If this parameter + * is null, a new POA manager is created and associated with the new POA. + * + * @param policies the policies, applicable for the parent POA. Policies + * are not inherited from the parent POA. If some policy type + * is missing in the array (or the zero size array is passed), the missing + * policies obtain the default values from the table, specified + * in the {@link POA} documentation header. + * + * @return an newly created POA. The POA will be intially in the holding + * state and must be activated to start processing requests. + * + * @throws AdapterAlreadyExists if the child with the given child_name + * already exists for the current POA. + * @throws InvalidPolicy if the policies conflict with each other or are + * otherwise inappropriate. + * + * @see POA for the list of required policies. + * @see #the_children() + */ + POA create_POA(String child_name, POAManager manager, Policy[] policies) + throws AdapterAlreadyExists, InvalidPolicy; + + /** + * Find and optionally activate the child POA with the given name. + * + * @param poa_name the name of the POA to find. + * @param activate_it if the child with the specified name is not found + * or inactive and this parameter is true, the target POA activator is + * invoked to activate that child. If this succeeds, that child POA + * is returned. + * + * @throws AdapterNonExistent if no active child with the given name + * is found and one of the following is true: + * a) the target POA has no associated + * {@link AdapterActivator}. b) that activator fails to activate the + * child POA. c)activate_id = false.
+ */
+ POA find_POA(String poa_name, boolean activate_it)
+ throws AdapterNonExistent;
+
+ /**
+ * Generate the Object Id for the given servant and add the servant to
+ * the Active Object Map using this Id a a key. If the servant
+ * activator is set, its incarnate method will be called. In this case,
+ * the passed servant in this method can be null; in this case, the servant,
+ * returned by {@link ServantLocatorOperations#incarnate} will
+ * be used.
+ *
+ * @param a_servant a servant that would serve the object with the
+ * returned Object Id.
+ *
+ * @return the generated objert Id for the given servant.
+ *
+ * @throws ServantAlreadyActive if this servant is already in the
+ * Active Object Map and the UNIQUE_ID policy applies.
+ *
+ * @throws WrongPolicy if the required policies SYSTEM_ID and RETAIN
+ * do not apply to this POA.
+ */
+ byte[] activate_object(Servant a_servant)
+ throws ServantAlreadyActive, WrongPolicy;
+
+ /**
+ * Add the given servant to the Active Object Map as a servant for the
+ * object with the provided Object Id. If the servant activator is
+ * set, its incarnate method will be called. In this case,
+ * the passed servant in this method can be null; in this case, the servant,
+ * returned by {@link ServantLocatorOperations#incarnate} will
+ * be used.
+ *
+ * @param an_Object_Id an object id for the given object.
+ * @param a_servant a servant that will serve the object with the given
+ * Object Id.
+ *
+ * @throws ObjectAlreadyActive if the given object id is already in the
+ * Active Object Map.
+ * @throws WrongPolicy if the required RETAIN policy does not apply to
+ * this POA.
+ * @throws BAD_PARAM if the passed object id is invalid due any reason.
+ */
+ void activate_object_with_id(byte[] an_Object_Id, Servant a_servant)
+ throws ServantAlreadyActive, ObjectAlreadyActive,
+ WrongPolicy;
+
+ /**
+ * Deactivate object with the given id. Client, trying to call + * method on the deactivated object will either receive the remote + * exception ({@link org.omg.CORBA.OBJECT_NOT_EXIST}, minor 0x535503ec), + * incomplete) or the object will be reactivated and serve the request. + * The object can be reactivated only if the implicit activation + * policy applies and the servant activator is set.
+ * The deactivated object will continue to process requests that arrived + * before decativation. + * If this POA has the associated servant manager, a + * {@link ServantActivatorOperations#etherealize} is immediately + * invoked on the passed id. The deactivated object can be reactivated + * by {@link #activate_object_with_id}.
+ *The deactivation will not release thread, port or memory resources, + * taken by that object. This is due requirement to make the + * object reactivation possible at any time. To release the resources, + * you must destroy the POA. + *
+ * + * @throws WrongPolicy if the required RETAIN policy does not apply to + * this POA. + */ + void deactivate_object(byte[] the_Object_Id) + throws ObjectNotActive, WrongPolicy; + + /** + * Create the object reference, encapsulating the given repository Id and + * the Object Id, generated by this POA. The returned object will not be + * activated by default and may be activated on the first invocation by + * the servant manager (if it is set and if policies are applicable). + * The returned object can also be narrowed by helper and used locally. + * In this case, the servant will be activated on the first local call of + * any method. The methods on returned object can also be invoked by + * name, using {@link org.omg.CORBA.Request}. + * + * @param a_repository_id the repository id for the given object. When + * narrowing the returned object with some helper, it will be checked for + * equality with value, returned by the the helper id(). + * + * @throws WrongPolicy if the required SYSTEM_ID policy does not apply to + * this POA. + */ + org.omg.CORBA.Object create_reference(String a_repository_id) + throws WrongPolicy; + + /** + *Create the object reference, encapsulating the given repository Id and + * the given Object Id. The returned object will not be + * activated by default and may be activated on the first invocation by + * the servant manager (if it is set and if policies are applicable). + *
+ * The returned object can also be narrowed by helper and used locally. + * In this case, the servant will be activated on the first local call of + * any method. The methods on returned object can also be invoked by + * name, using {@link org.omg.CORBA.Request}. + *
+ * + * @param an_object_id the object id for the object being created. + * If the POA uses the SYSTEM_ID policy, the portable application + * must only supply ids, generated by that POA. + * + * @param a_repository_id the repository id for the given object. When + * narrowing the returned object with some helper, it will be checked for + * equality with value, returned by the the helper id(). + */ + org.omg.CORBA.Object create_reference_with_id(byte[] an_object_id, + String a_repository_id + ); + + /** + * Returns a default servant for this POA. + * + * @return a servant that will be used for requests for + * which no servant is found in the Active Object Map. + * + * @throws NoServant if there is no default servant associated with this POA. + * @throws WrongPolicy if the USE_DEFAULT_SERVANT policy is not active. + */ + Servant get_servant() + throws NoServant, WrongPolicy; + + /** + * Sets the default servant for this POA. + * + * @param a_servant a servant that will be used for requests for + * which no servant is found in the Active Object Map. + * + * @throws WrongPolicy if the USE_DEFAULT_SERVANT policy is not active. + */ + void set_servant(Servant a_servant) + throws WrongPolicy; + + /** + * Set a servant manager for this POA. + * + * @param a servant manager being set. If the RETAIN policy applies, the + * manager must implement a {@link ServantActivator}. If the NON_RETAIN + * policy applies, the manager must implement a {@link ServantLocator}. + * + * @throws WrongPolicy if the required USE_SERVANT_MANAGER policy does not + * apply to this POA. + * + * @throws OBJ_ADAPTER minor code 4 if the passed manager does not + * implement the required interface ({@link ServantActivator}, + * {@link ServantLocator}). + * + * @throws BAD_INV_ORDER minor code 6 if the method is called more than once + * on the same POA. The manager can be set only once. + */ + void set_servant_manager(ServantManager a_manager) + throws WrongPolicy; + + /** + * Get the servant manager, associated with this POA. + * + * @return the associated servant manager or null if it has + * been previously set. + * + * @throws WrongPolicy if the required USE_SERVANT_MANAGER policy does not + * apply to this POA. + */ + ServantManager get_servant_manager() + throws WrongPolicy; + + /** + * Get the unique Id of the POA in the process in which it is created. + * This Id is needed by portable interceptors. The id is unique + * for the life span of the POA in the process. For persistent + * POAs, if a POA is created in the same path with the same name as + * another POA, these POAs are identical have the same id. All transient + * POAs are assumed unique. + */ + byte[] id(); + + /** + * Returns the reference to the active object with the given Id. + * + * @param the_Object_Id the object id. + * + * @throws ObjectNotActive if there is no active object with such Id. + * @throws WrongPolicy if the required RETAIN policy does not apply to + * this POA. + */ + org.omg.CORBA.Object id_to_reference(byte[] the_Object_Id) + throws ObjectNotActive, WrongPolicy; + + /** + * Returns the servant that serves the active object with the given Id. + * + * @param the_Object_Id the object id. + * + * @throws ObjectNotActive if there is no active object with such Id. + * @throws WrongPolicy. This method requires either RETAIN or + * USE_DEFAULT_SERVANT policies and reaises the WrongPolicy if none of them + * apply to this POA. + */ + Servant id_to_servant(byte[] the_Object_Id) + throws ObjectNotActive, WrongPolicy; + + /** + * Returns the Object Id, encapsulated in the given object reference. + * + * @param the_Object the object that has been previously created with this + * POA. It need not be active. + * + * @throws WrongAdapter if the passed object has not been previously created + * with this POA. + * @throws WrongPolicy never (declared for the future extensions only). + */ + byte[] reference_to_id(org.omg.CORBA.Object the_Object) + throws WrongAdapter, WrongPolicy; + + /** + * Returns the servant that is serving this object. + * + * @return if the RETAIN policy applies and the object is in the Active + * Object Map, the method returns the servant, associated with this object. + * Otherwise, if the USE_DEFAULT_SERVANT policy applies, the method returns + * the default servant (if one was set). + * + * @throws ObjectNotActive if none of the conditions above are satisfied. + * @throws WrongAdapter if the object reference was not created with this POA. + * @throws WrongPolicy. This method requires either RETAIN or + * USE_DEFAULT_SERVANT policies and reaises the WrongPolicy if none of them + * apply to this POA. + */ + Servant reference_to_servant(org.omg.CORBA.Object the_Object) + throws ObjectNotActive, WrongPolicy, WrongAdapter; + + /** + * Returns the id of the object, served by the given servant. The id is found + * in one of the following ways. + *Converts the given servant to the object reference. + * The servant will serve all methods, invoked on the returned object. + * The returned object reference can be passed to the remote client, + * enabling remote invocations. + *
+ * If the specified servant already serves some active object, that + * object is returned. Otherwise, + * if the POA has the IMPLICIT_ACTIVATION policy the method activates + * the servant, creating an new object with the POA-generated Object Id. + * In this case, if the servant activator is set, the + * {@link ServantActivatorOperations#incarnate} method will be called. + *
+ * + * @throws ServantNotActive if the servant is inactive and no + * IMPLICIT_ACTIVATION policy applies. + * @throws WrongPolicy This method needs the RETAIN policy and either the + * UNIQUE_ID or IMPLICIT_ACTIVATION policies. + * + * @return the object, exposing the given servant in the context of this POA. + */ + org.omg.CORBA.Object servant_to_reference(Servant the_Servant) + throws ServantNotActive, WrongPolicy; + + /** + * Return the POA manager, associated with this POA. + * + * @return the associated POA manager (always available). + */ + POAManager the_POAManager(); + + /** + * Returns the adapter activator, associated with this POA. + * The newly created POA has no activator (null would be + * returned). The ORB root POA also initially has no activator. + * + * @return tha adapter activator or null if this POA has no + * associated adapter activator. + */ + AdapterActivator the_activator(); + + /** + * Set the adapter activator for this POA. + * + * @param the activator being set. + */ + void the_activator(AdapterActivator activator); + + /** + * The children of this POA. + * + * @return the array of all childs for this POA. + */ + POA[] the_children(); + + /** + * Return the name of this POA. + * + * @return the name of POA, relative to its parent. + */ + String the_name(); + + /** + * Return the parent of this POA. + * + * @return the parent POA ornull if this is a root POA.
+ */
+ POA the_parent();
+
+ /**
+ * Destroy this POA and all descendant POAs. The destroyed POAs can be + * later re-created via {@link AdapterActivator} or by invoking + * {@link #create_POA}. + * This differs from {@link PoaManagerOperations#deactivate} that does + * not allow recreation of the deactivated POAs. After deactivation, + * recreation is only possible if the POAs were later destroyed. + *
+ * The remote invocation on the target, belonging to the POA that is + * currently destroyed return the remote exception ({@link TRANSIENT}, + * minor code 4). + *
+ * @param etherealize_objects if true, and POA has RETAIN policy, and the + * servant manager is available, the servant manager method + * {@link ServantActivatorOperations#etherealize} is called for each + * active object in the Active Object Map. This method should not + * try to access POA being destroyed. Ifdestroy is called
+ * multiple times before the destruction completes,
+ * the etherialization should be invoked only once.
+ *
+ * @param wait_for_completion if true, the method waits till the POA being
+ * destroyed completes all current requests and etherialization. If false,
+ * the method returns immediately.
+ */
+ void destroy(boolean etherealize_objects, boolean wait_for_completion);
+
+ /**
+ * Create the IdUniquenessPolicy policy.
+ *
+ * @param value states which one Id uniqueness policy will apply.
+ *
+ * @return the created policy.
+ */
+ IdUniquenessPolicy create_id_uniqueness_policy(IdUniquenessPolicyValue a_value);
+
+ /**
+ * Create the ImplicitActivationPolicy policy.
+ *
+ * @param value states which one activation policy will apply.
+ *
+ * @return the created policy.
+ */
+ ImplicitActivationPolicy create_implicit_activation_policy(ImplicitActivationPolicyValue a_value);
+
+ /**
+ * Create the LifespanPolicy policy.
+ *
+ * @param value states which one object lifespan policy will apply.
+ *
+ * @return the created policy.
+ */
+ LifespanPolicy create_lifespan_policy(LifespanPolicyValue a_value);
+
+ /**
+ * Create the RequestProcessingPolicy policy.
+ *
+ * @param value states which one request processing policy will apply.
+ *
+ * @return the created policy.
+ */
+ RequestProcessingPolicy create_request_processing_policy(RequestProcessingPolicyValue a_value);
+
+ /**
+ * Create the ServantRetentionPolicy policy.
+ *
+ * @param value states which one servant retention policy will apply.
+ *
+ * @return the created policy.
+ */
+ ServantRetentionPolicy create_servant_retention_policy(ServantRetentionPolicyValue a_value);
+
+ /**
+ * Create the ThreadPolicy policy.
+ *
+ * @param value states which one thread policy will apply.
+ *
+ * @return the created policy.
+ */
+ ThreadPolicy create_thread_policy(ThreadPolicyValue a_value);
+
+ /**
+ * Create the ID assignment policy with the given value.
+ *
+ * @param value states which one ID assignment policy will apply.
+ *
+ * @return the created policy.
+ */
+ IdAssignmentPolicy create_id_assignment_policy(IdAssignmentPolicyValue value);
+
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicy.java b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicy.java
new file mode 100644
index 0000000..1b37d9f
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicy.java
@@ -0,0 +1,59 @@
+/* RequestProcessingPolicy.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.PortableServer;
+
+import org.omg.CORBA.Policy;
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * Specifies the behaviour in the case when the
+ * requested object is not found in the Active Object Map or that map
+ * is not in use.
+ *
+ * The policy can return its current value, as defined.
+ * in {@link RequestProcessingPolicyOperations}.
+ *
+ * @see RequestProcessingPolicyValue for the possible values of this policy.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface RequestProcessingPolicy
+ extends Policy, RequestProcessingPolicyOperations, IDLEntity
+{
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyOperations.java
new file mode 100644
index 0000000..672ba18
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyOperations.java
@@ -0,0 +1,55 @@
+/* RequestProcessingPolicyOperations.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.PortableServer;
+
+import org.omg.CORBA.PolicyOperations;
+
+/**
+ * Defines the operations, applicable to the RequestProcessingPolicy.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface RequestProcessingPolicyOperations
+ extends PolicyOperations
+{
+ /**
+ * Return the value of this policy type, stated by the current instance.
+ */
+ RequestProcessingPolicyValue value();
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/Servant.java b/libjava/classpath/org/omg/PortableServer/Servant.java
new file mode 100644
index 0000000..745fc8a
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/Servant.java
@@ -0,0 +1,288 @@
+/* Servant.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.PortableServer;
+
+import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.NO_IMPLEMENT;
+import org.omg.CORBA.OBJECT_NOT_EXIST;
+import org.omg.CORBA.ORB;
+import org.omg.PortableServer.POAPackage.ServantNotActive;
+import org.omg.PortableServer.POAPackage.WrongPolicy;
+import org.omg.PortableServer.portable.Delegate;
+import gnu.CORBA.Poa.ORB_1_4;
+import gnu.CORBA.Poa.gnuPOA;
+
+/**
+ * + * The servant is responsible for handling the method invocation on the + * target object. It can be one servant per object, or the same servant can + * support several (possibly all) objects, associated with the given POA. + *
+ * Till JDK 1.3 inclusive, a typical IDL to java compiler generates an + * implementation base (name pattern _*ImplBase.java) that is derived from the + * {@link org.omg.CORBA.portable.ObjectImpl}. Since JDK 1.4 the implementation + * base is derived from the Servant, also having a different name pattern + * (*POA.java). This suffix may be confusing, as the servant itself is + * not POA nor it is derived from it. + *
+ * In both cases, the implementation base also inherits an interface, containing + * definitions of the application specific methods. The application programmer + * writes a child of the implementation base, implementing these methods + * for the application-specific functionality. The ObjectImpl is connected + * directly to the ORB. The Servant is connected to POA that can be obtained + * from the ORB. + *
+ * If the servant is connected to more than one object, the exact object + * being currently served can be identified with {@link #_object_id}. + *
+ * The derivativ of Servant, being directly connected to serve requests, + * must inherit either from {@link org.omg.CORBA.portable.InvokeHandler} + * or from {@link org.omg.PortableServer.DynamicImplementation}). + *
+ * The Servant type is a CORBA native type.
+ *
InterfaceDef for this
+ * Object. By default, forwards request to the delegate.
+ *
+ * @specnote The interface repository is officially not implemented up till
+ * JDK 1.5 inclusive. The delegate throws NO_IMPLEMENT, always.
+ */
+ public org.omg.CORBA.Object _get_interface_def()
+ {
+ throw new NO_IMPLEMENT();
+ }
+
+ /**
+ * Checks if the passed servant is an instance of the given CORBA IDL type.
+ * By default, forwards the requet to the delegate.
+ *
+ * @param a_servant a servant to check.
+ * @param an_id a repository ID, representing an IDL type for that the
+ * servant must be checked.
+ *
+ * @return true if the servant is an instance of the given type, false
+ * otherwise.
+ */
+ public boolean _is_a(String repository_id)
+ {
+ return delegate.is_a(this, repository_id);
+ }
+
+ /**
+ * Determines if the server object for this reference has already
+ * been destroyed. By default, forwards request to the delegate.
+ *
+ * @return true if the object has been destroyed, false otherwise.
+ */
+ public boolean _non_existent()
+ {
+ return delegate.non_existent(this);
+ }
+
+ /**
+ * Returns the ORB that is directly associated with the given servant.
+ * In this implementation, the method is overridden to return
+ */
+ public final ORB _orb()
+ {
+ return delegate.orb(this);
+ }
+
+ /**
+ * Returns the root POA of the ORB instance, associated with this servant.
+ * It is the same POA that would be returned by resolving the initial
+ * reference "RootPOA" for that orb. By default, forwards request to the
+ * delegate.
+ *
+ * @see ORB.resolve_initial_references
+ */
+ public POA _default_POA()
+ {
+ return delegate == null ? null : delegate.default_POA(this);
+ }
+
+ /**
+ * Return the invocation target object identifier as a byte array.
+ * This is typically used when the same servant serves multiple objects,
+ * and the object id can encapsulated the whole description of the
+ * object.
+ *
+ * This method returns correct values even when the same
+ * servant serves several objects in parallel threads. The ORB maintains the
+ * thread to invocation data map for all calls that are currently being
+ * processed.
+ */
+ public final byte[] _object_id()
+ {
+ if (delegate != null)
+ return delegate.object_id(this);
+ else
+ throw new OBJECT_NOT_EXIST();
+ }
+
+ /**
+ * Get POA that is directly associated with the given servant.
+ * By default, forwards request to the delegate.
+ */
+ public final POA _poa()
+ {
+ return delegate.poa(this);
+ }
+
+ /**
+ * Set the delegate for this servant.
+ */
+ public final void _set_delegate(Delegate a_delegate)
+ {
+ delegate = a_delegate;
+ }
+
+ /**
+ * Obtains the CORBA object reference that is a current invocation target for
+ * the given servant. This is important when the same servant serves
+ * multiple objects. If the servant is not yet connected to the passed
+ * orb, the method will try to connect it to that orb on POA, returned
+ * by the method {@link _default_POA}. That method can be overridden to
+ * get poa where the object must be automatically connected when
+ * calling this method.
+ *
+ * @param an_orb the ORB with relate to that the object is requested.
+ */
+ public final org.omg.CORBA.Object _this_object(ORB an_orb)
+ {
+ if (delegate != null)
+ return delegate.this_object(this);
+ else
+ {
+ if (an_orb instanceof ORB_1_4)
+ {
+ ORB_1_4 m_orb = (ORB_1_4) an_orb;
+
+ gnuPOA dp = (gnuPOA) _default_POA();
+ if (dp == null)
+ dp = m_orb.rootPOA;
+
+ try
+ {
+ return dp.servant_to_reference(this);
+ }
+ catch (WrongPolicy unexp)
+ {
+ BAD_OPERATION bad = new BAD_OPERATION();
+ bad.initCause(unexp);
+ throw bad;
+ }
+ catch (ServantNotActive ex)
+ {
+ try
+ {
+ return dp.id_to_reference(dp.activate_object(this));
+ }
+ catch (Exception unexp)
+ {
+ unexp.initCause(ex);
+
+ BAD_OPERATION bad = new BAD_OPERATION();
+ bad.initCause(unexp);
+ throw bad;
+ }
+ }
+ }
+ }
+ throw new OBJECT_NOT_EXIST();
+ }
+
+ /**
+ * Obtains the CORBA object reference that is a current invocation target for
+ * the given servant. This is important when the same servant serves
+ * multiple objects. This method required the servant to be connected
+ * to a single orb, and a delegate set.
+ *
+ * This method returns correct values even when the same
+ * servant serves several objects in parallel threads. The ORB maintains the
+ * thread to invocation data map for all calls that are currently being
+ * processed.
+ */
+ public final org.omg.CORBA.Object _this_object()
+ {
+ if (delegate != null)
+ return _this_object(_orb());
+ else
+ {
+ POA def = _default_POA();
+ if (def instanceof gnuPOA)
+ return _this_object(((gnuPOA) def).orb());
+ }
+ throw new OBJECT_NOT_EXIST();
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/ServantActivator.java b/libjava/classpath/org/omg/PortableServer/ServantActivator.java
new file mode 100644
index 0000000..244fedf
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/ServantActivator.java
@@ -0,0 +1,59 @@
+/* ServantActivator.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.PortableServer;
+
+import org.omg.CORBA.portable.IDLEntity;
+
+/**
+ * The POA, that has the RETAIN policy uses servant managers that are
+ * ServantActivators. The operations, that must be supported by these
+ * managers, are defined separately in {@link ServantActivatorOperations}.
+ *
+ * @see ServantLocator
+ * @see ServantRetentionPolicyValue
+ * @see ServantManager
+ * @see POAOperations#set_servant_manager
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface ServantActivator
+ extends ServantManager, ServantActivatorOperations, IDLEntity,
+ org.omg.CORBA.Object
+{
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java b/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java
new file mode 100644
index 0000000..1aab99c
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java
@@ -0,0 +1,145 @@
+/* ServantActivatorHelper.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.PortableServer;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.MARSHAL;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.OutputStream;
+
+/**
+* The helper operations for the CORBA object {@link ServantActivator}.
+*
+* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+*/
+public abstract class ServantActivatorHelper
+{
+ /**
+ * Get the type code of the {@link ServantActivator}.
+ */
+ public static TypeCode type()
+ {
+ return ORB.init().create_interface_tc(id(), "ServantActivator");
+ }
+
+ /**
+ * Insert the ServantActivator into the given Any.
+ *
+ * @param any the Any to insert into.
+ * @param that the ServantActivator to insert.
+ */
+ public static void insert(Any any, ServantActivator that)
+ {
+ any.insert_Object(that);
+ }
+
+ /**
+ * Extract the ServantActivator from given Any.
+ *
+ * @throws BAD_OPERATION if the passed Any does not contain ServantActivator.
+ */
+ public static ServantActivator extract(Any any)
+ {
+ return narrow(any.extract_Object());
+ }
+
+ /**
+ * Get the ServantActivator repository id.
+ *
+ * @return "IDL:omg.org/PortableServer/ServantActivator:2.3", always.
+ */
+ public static String id()
+ {
+ return "IDL:omg.org/PortableServer/ServantActivator:2.3";
+ }
+
+ /**
+ * Casts the passed object into the ServantActivator.
+ *
+ * @param obj the object to cast.
+ * @return casted instance.
+ * @throws BAD_PARAM if the passed object is not a ServantActivator.
+ */
+ public static ServantActivator narrow(org.omg.CORBA.Object obj)
+ {
+ try
+ {
+ return (ServantActivator) obj;
+ }
+ catch (ClassCastException ex)
+ {
+ BAD_PARAM bad = new BAD_PARAM();
+ bad.initCause(ex);
+ throw bad;
+ }
+ }
+
+ /**
+ * This should read the servant activator, but it cannot be transferred
+ * this way as its operations cannot be remote. The operations cannot
+ * be remote because one of the method parameters, POA, is required to be
+ * always a local object (both by 1.5 API and 3.0.3 OMG).
+ *
+ * @throws MARSHAL, always.
+ *
+ * @specnote Same as Sun.
+ */
+ public static ServantActivator read(InputStream input)
+ {
+ throw new MARSHAL();
+ }
+
+ /**
+ * This should write the servant activator, but it cannot be transferred
+ * this way as its operations cannot be remote. The operations cannot
+ * be remote because one of the method parameters, POA, is required to be
+ * always a local object (both by 1.5 API and 3.0.3 OMG).
+ *
+ * @throws MARSHAL, always.
+ *
+ * @specnote Same as Sun.
+ */
+ public static void write(OutputStream output, ServantActivator value)
+ {
+ throw new MARSHAL();
+ }
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/ServantActivatorOperations.java b/libjava/classpath/org/omg/PortableServer/ServantActivatorOperations.java
new file mode 100644
index 0000000..6437f35
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/ServantActivatorOperations.java
@@ -0,0 +1,94 @@
+/* ServantActivatorOperations.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.PortableServer;
+
+
+/**
+ * Defines the operations, applicable to the {@link ServantActivator}.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface ServantActivatorOperations
+ extends ServantManagerOperations
+{
+ /**
+ * This method is invoked whenever a servant for an object is deactivated,
+ * assuming the POA has the USE_SERVANT_MANAGER and RETAIN policies.
+ *
+ * @param Object_Id the Id of the object being deactivated.
+ *
+ * @param poa the POA in those scope the object was active.
+ *
+ * @param servant the servant, serving the object being deactivated.
+ *
+ * @param cleanup_in_progress if true, this method was called from due
+ * deactivation or destruction operation. False indicates that the method
+ * was called due other reasons.
+ *
+ * @param remaining_activations if true, at the invocation moment the
+ * passed servant is also associated with other objects in the active
+ * object map of the given POA.
+ */
+ void etherealize(byte[] Object_Id, POA poa, Servant servant,
+ boolean cleanup_in_progress, boolean remaining_activations
+ );
+
+ /**
+ * This method is invoked whenever the POA receives a request for an
+ * object that is not currently active, assuming the POA has the
+ * USE_SERVANT_MANAGER and RETAIN policies. The user-supplied servant
+ * manager is responsible for locating or creating an appropriate servant
+ * that corresponds to the ObjectId value. The subsequent requests with
+ * the same ObjectId value will be delivered directly to that servant
+ * without invoking the servant manager.
+ *
+ * @param Object_Id the ObjectId value associated with the incoming request.
+ * @param poa the POA in which the object is being activated.
+ *
+ * @return a servant that will be used to process the incoming request.
+ *
+ * @throws ForwardRequest if the activator decides to forward the request
+ * to another object. The exception contains the object that should
+ * handle this request. This object is usually remote, but can also
+ * be local. The throws exception will forward all subsequent requests
+ * till the new activation.
+ */
+ Servant incarnate(byte[] Object_Id, POA poa)
+ throws ForwardRequest;
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/ServantActivatorPOA.java b/libjava/classpath/org/omg/PortableServer/ServantActivatorPOA.java
new file mode 100644
index 0000000..5ea0be4
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/ServantActivatorPOA.java
@@ -0,0 +1,173 @@
+/* ServantActivatorPOA.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.PortableServer;
+
+import gnu.CORBA.Poa.gnuServantObject;
+
+import org.omg.CORBA.NO_IMPLEMENT;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.SystemException;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.InvokeHandler;
+import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.ResponseHandler;
+
+/**
+ * This ServantActivator stub is an optional base for the + * servant activators. This stub cannot serve remote invocations, as + * methods in {@link ServantActivatorOperations} take POA as one of parameters. + * Both JDK 1.5 API and OMG specifies that POA is a local object that must not + * be transferred to the remote invocation target. + *
+ * You do not need to derive your servant activator from this stub, + * it is enough to implement the {@link ServantActivator} interface. + * But you may choose to do this if you need the functional + * {@link #_all_interfaces()} method or want to keep default behavior during + * the incarnation or etherialization. + *
+ */ +public class ServantActivatorPOA + extends Servant + implements InvokeHandler, ServantActivatorOperations +{ + /** + * Used to access the outer class in the nested delegator class. + */ + final ServantActivatorPOA THIS = this; + + /** + * This class is used to support _this. + */ + class delegator + extends gnuServantObject + implements ServantActivator + { + delegator(Servant s) + { + super(s, new byte[ 0 ], null, null); + } + + public Servant incarnate(byte[] key, POA poa) + throws org.omg.PortableServer.ForwardRequest + { + return THIS.incarnate(key, poa); + } + + public void etherealize(byte[] key, POA poa, Servant servant, + boolean cleanup, boolean remains + ) + { + THIS.etherealize(key, poa, servant, cleanup, remains); + } + } + + /** + * It is your responsibility to handle the incarnation event and + * supply the servant. + * The default method instructs POA that the servant cannot be + * provided by activator. The OBJ_ADAPTER exception will be + * thrown by POA, unless the servant is provided as one of the + * parameters in the activation method, or the default servant is set. + * + * @see ServantActivatorOperations#incarnate + * + * @specnote in GNU Classpath, returning null means that the + * activator does not supply the servant. The servant can still be supplied + * as one of parameters in some POA activation methods or as a default + * servant. + * + * @throws ForwardRequest + */ + public Servant incarnate(byte[] Object_Id, POA poa) + throws ForwardRequest + { + return null; + } + + /** + * It is your responsibility to handle the etherialization event. + * Override this method if using the class. The default method + * does nothing. + * + * @see ServantActivatorOperations#incarnate + */ + public void etherealize(byte[] Object_Id, POA poa, Servant servant, + boolean cleanup, boolean remains + ) + { + } + + /** + * Our implementation will not call this method. After setting your + * manager to POA, it will call incarnate and etherialize directly. + */ + public OutputStream _invoke(String method, InputStream input, + ResponseHandler handler + ) + throws SystemException + { + throw new NO_IMPLEMENT(); + } + + /** + * Returns an array of interfaces, supported by the servant activator. + */ + public String[] _all_interfaces(POA poa, byte[] Object_Id) + { + return new _ServantActivatorStub()._ids(); + } + + /** + * Return the complete instance of the servant activator, based on + * the current class (ServantActivatorPOA or derived). + */ + public ServantActivator _this() + { + return new delegator(this); + } + + /** + * Return the complete instance of the servant activator, based on + * the current class (ServantActivatorPOA or derived). + */ + public ServantActivator _this(ORB orb) + { + return new delegator(this); + } +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocator.java b/libjava/classpath/org/omg/PortableServer/ServantLocator.java new file mode 100644 index 0000000..9989fd4 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantLocator.java @@ -0,0 +1,59 @@ +/* ServantLocator.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.PortableServer; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * When the POA has the NON_RETAIN policy it uses servant managers that are + * ServantLoacators. The operations, that must be supported by these managers, + * are defined separately in {@link ServantLocatorOperations}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + * + * @see ServantActivator + * @see ServantRetentionPolicyValue + * @see ServantManager + * @see POAOperations#set_servant_manager + */ +public interface ServantLocator + extends ServantManager, ServantLocatorOperations, IDLEntity, + org.omg.CORBA.Object +{ +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java b/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java new file mode 100644 index 0000000..984abdf --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java @@ -0,0 +1,145 @@ +/* ServantLocatorHelper.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.PortableServer; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the CORBA object {@link ServantLocator}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class ServantLocatorHelper +{ + /** + * Get the type code of the {@link ServantLocator}. + */ + public static TypeCode type() + { + return ORB.init().create_interface_tc(id(), "ServantLocator"); + } + + /** + * Insert the ServantLocator into the given Any. + * + * @param any the Any to insert into. + * @param that the ServantLocator to insert. + */ + public static void insert(Any any, ServantLocator that) + { + any.insert_Object(that); + } + + /** + * Extract the ServantLocator from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain ServantLocator. + */ + public static ServantLocator extract(Any any) + { + return narrow(any.extract_Object()); + } + + /** + * Get the ServantLocator repository id. + * + * @return "org.omg.PortableServer.ServantLocatorOperations", always. + */ + public static String id() + { + return "org.omg.PortableServer.ServantLocatorOperations"; + } + + /** + * Cast the passed object into the ServantLocator. + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a ServantLocator. + */ + public static ServantLocator narrow(org.omg.CORBA.Object obj) + { + try + { + return (ServantLocator) obj; + } + catch (ClassCastException ex) + { + BAD_OPERATION bad = new BAD_OPERATION(); + bad.initCause(ex); + throw bad; + } + } + + /** + * This should read the servant locator, but it cannot be transferred + * this way as its operations cannot be remote. The operations cannot + * be remote because one of the method parameters, POA, is required to be + * always a local object (both by 1.5 API and 3.0.3 OMG). + * + * @throws MARSHAL, always. + * + * @specnote Same as Sun. + */ + public static ServantLocator read(InputStream input) + { + throw new MARSHAL(); + } + + /** + * This should write the servant activator, but it cannot be transferred + * this way as its operations cannot be remote. The operations cannot + * be remote because one of the method parameters, POA, is required to be + * always a local object (both by 1.5 API and 3.0.3 OMG). + * + * @throws MARSHAL, always. + * + * @specnote Same as Sun. + */ + public static void write(OutputStream output, ServantLocator value) + { + throw new MARSHAL(); + } +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocatorOperations.java b/libjava/classpath/org/omg/PortableServer/ServantLocatorOperations.java new file mode 100644 index 0000000..6ed214e --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantLocatorOperations.java @@ -0,0 +1,96 @@ +/* ServantLocatorOperations.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.PortableServer; + +import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; + +/** + * Defines the operations, applicable to the {@link ServantLocator}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServantLocatorOperations + extends ServantManagerOperations +{ + /** + * If the POA has the USE_SERVANT_MANAGER and NON_RETAIN policies, it + * invokes this method whenever the object being requested that is not + * inactive. This method has access to all details of the received + * request and can use them to choose between servaral alternative servants. + * It can also forward the request to another server. + * + * @param Object_Id the id of the object, on which the request was called. + * @param poa the POA in those scope the object is active. + * @param operation the name of the method or operation being invoked. + * @param cookie_holder the holder where the servant manager can store + * an arbitrary java.lang.Object. This object will be later passed as a + *cookie parameter for {@link postinvoke}, to create tie
+ * between preinvoke and postinvoke. The application should not
+ * suppose that each call of preinvoke is followed by the subsequent
+ * postinvoke for the same invocation; under multi threaded policy these
+ * calls may be intermixed.
+ *
+ * @return a servant that will serve the incoming request.
+ *
+ * @throws ForwardRequest if the locator decides to forward the request
+ * to another object. The exception contains the object that should
+ * handle this request. This object is usually remote, but can also
+ * be local. As preinvoke is called on each method
+ * invocation, the thrown exception will forward only this current request.
+ */
+ Servant preinvoke(byte[] Object_Id, POA poa, String operation,
+ CookieHolder cookie_holder
+ )
+ throws ForwardRequest;
+
+ /**
+ * If the POA has the USE_SERVANT_MANAGER and NON_RETAIN policies, it
+ * invokes this method whenever a servant completes a request.
+ *
+ * @param Object_Id the id of the object, on which the request was called.
+ * @param poa the POA in those scope the object is active.
+ * @param operation the name of the method or operation that was invoked.
+ * @param cookie the object that has been previously set by preinvoke in
+ * the cookie_holder parameter.
+ * @param servant the servant, associated with the object.
+ */
+ void postinvoke(byte[] Object_Id, POA poa, String operation,
+ java.lang.Object cookie, Servant servant
+ );
+}
\ No newline at end of file
diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocatorPOA.java b/libjava/classpath/org/omg/PortableServer/ServantLocatorPOA.java
new file mode 100644
index 0000000..0a0f996
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/ServantLocatorPOA.java
@@ -0,0 +1,180 @@
+/* ServantLocatorPOA.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.PortableServer;
+
+import gnu.CORBA.Poa.gnuServantObject;
+
+import org.omg.CORBA.NO_IMPLEMENT;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.SystemException;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.InvokeHandler;
+import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.ResponseHandler;
+import org.omg.PortableServer.ServantLocatorPackage.CookieHolder;
+
+/**
+ * The ServantLocator stub is an optional base for the + * servant locators. It cannot serve remote invocations, as + * methods in {@link ServantLocatorOperations} take POA as one of parameters. + * Both JDK 1.5 API and OMG specifies that POA is a local object that must not + * be transferred to the remote invocation target. + *
+ * You do not need to derive your servant locator from this stub, + * it is enough to implement the {@link ServantLocator} interface. + * But you may choose to do this if you need its functional + * {@link #_ids()} method or want to keep default behavior during per- + * or post- invokcations. + *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class ServantLocatorPOA + extends Servant + implements ServantLocatorOperations, InvokeHandler +{ + /** + * Used to access the outer class in the nested classes. + */ + final ServantLocatorPOA THIS = this; + + /** + * It is your responsibility to take the preinvoke actions, if any, + * and also supply an appropriate servant for the current invocation. + * + * The default method instructs POA that the servant cannot be + * provided by locator. The OBJ_ADAPTER exception will be + * thrown by POA, unless it uses the available default servant for all + * invocations. + * + * @specnote in GNU Classpath, returning null means that the + * locator does not supply the servant. + * + * @see ServantLocatorOperations#preinvoke + */ + public Servant preinvoke(byte[] Object_Id, POA poa, String method, + CookieHolder cookie_holder + ) + throws org.omg.PortableServer.ForwardRequest + { + return null; + } + + /** + * It is your responsibility to take the postinvoke actions, if any, + * by overriding this method. The default method does nothing. + * + * @see ServantLocatorOperations#postinvoke + */ + public void postinvoke(byte[] Object_Id, POA poa, String method, + java.lang.Object cookie, Servant servant + ) + { + } + + /** + * Our implementation will not call this method. After setting your + * manager to POA, it will call incarnate and etherialize directly. + */ + public OutputStream _invoke(String method, InputStream input, + ResponseHandler handler + ) + throws SystemException + { + throw new NO_IMPLEMENT(); + } + + /** + * Returns an array of interfaces, supported by the servant locator. + */ + public String[] _all_interfaces(POA poa, byte[] Object_Id) + { + return new _ServantLocatorStub()._ids(); + } + + /** + * Return the complete instance of the servant activator, based on + * the current class (ServantActivatorPOA or derived). + */ + public ServantLocator _this() + { + return new delegator(this); + } + + /** + * Return the complete instance of the servant activator, based on + * the current class (ServantActivatorPOA or derived). + */ + public ServantLocator _this(ORB orb) + { + return new delegator(this); + } + + /** + * This class is used to support _this. + */ + class delegator + extends gnuServantObject + implements ServantLocator + { + delegator(Servant s) + { + super(s, new byte[ 0 ], null, null); + } + + public Servant preinvoke(byte[] Object_Id, POA poa, String method, + CookieHolder cookie_holder + ) + throws org.omg.PortableServer.ForwardRequest + { + return THIS.preinvoke(Object_Id, poa, method, cookie_holder); + } + + public void postinvoke(byte[] Object_Id, POA poa, String method, + java.lang.Object cookie, Servant servant + ) + { + THIS.postinvoke(Object_Id, poa, method, cookie, servant); + } + + public String[] _ids() + { + return THIS._all_interfaces(null, null); + } + } +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ServantManager.java b/libjava/classpath/org/omg/PortableServer/ServantManager.java new file mode 100644 index 0000000..082aea3 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantManager.java @@ -0,0 +1,56 @@ +/* ServantManager.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.PortableServer; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * A servant manager is associated with POA and provide possibility + * to activate objects on demand. A servant manager interface itself + * is empty, but it is inherited by other two interfaces, + * {@link ServantActivator} and {@link ServantLocator}. + * + * @see POAOperations#set_servant_manager + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServantManager + extends ServantManagerOperations, IDLEntity, org.omg.CORBA.Object +{ +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ServantManagerOperations.java b/libjava/classpath/org/omg/PortableServer/ServantManagerOperations.java new file mode 100644 index 0000000..b7c3b75 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantManagerOperations.java @@ -0,0 +1,54 @@ +/* ServantManagerOperations.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.PortableServer; + +/** + * This interface would define the operations, applicable to + * the ServantManager. A servant manager interface itself + * is empty, but it is inherited by other two interfaces, + * {@link ServantActivator} and {@link ServantLocator}. + * + * @see ServantActivatorOperations + * @see ServantLocatorOperations + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServantManagerOperations +{ +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicy.java b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicy.java new file mode 100644 index 0000000..ee47af5 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicy.java @@ -0,0 +1,58 @@ +/* ServantRetentionPolicy.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.PortableServer; + +import org.omg.CORBA.Policy; +import org.omg.CORBA.portable.IDLEntity; + +/** + * Specifies if the active servants should be retained in the + * Active Object Map. + * + * The policy can return its current value, as defined. + * in {@link ServantRetentionPolicyOperations}. + * + * @see ServantRetentionPolicyValue for the possible values of this policy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServantRetentionPolicy + extends Policy, ServantRetentionPolicyOperations, IDLEntity +{ +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyOperations.java new file mode 100644 index 0000000..2ef0ab5 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyOperations.java @@ -0,0 +1,55 @@ +/* ServantRetentionPolicyOperations.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.PortableServer; + +import org.omg.CORBA.PolicyOperations; + +/** + * Defines the operations, applicable to the ServantRetentionPolicy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServantRetentionPolicyOperations + extends PolicyOperations +{ + /** + * Return the value of this policy type, stated by the current instance. + */ + ServantRetentionPolicyValue value(); +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ThreadPolicy.java b/libjava/classpath/org/omg/PortableServer/ThreadPolicy.java new file mode 100644 index 0000000..b16ac17 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ThreadPolicy.java @@ -0,0 +1,57 @@ +/* ThreadPolicy.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.PortableServer; + +import org.omg.CORBA.Policy; +import org.omg.CORBA.portable.IDLEntity; + +/** + * Defines the POA thread policy. + * + * The policy can return its current value, as defined. + * in {@link ThreadPolicyOperations}. + * + * @see ThreadPolicyValue for the possible values of this policy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ThreadPolicy + extends Policy, ThreadPolicyOperations, IDLEntity +{ +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ThreadPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/ThreadPolicyOperations.java new file mode 100644 index 0000000..b366288 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ThreadPolicyOperations.java @@ -0,0 +1,55 @@ +/* ThreadPolicyOperations.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.PortableServer; + +import org.omg.CORBA.PolicyOperations; + +/** + * Defines the operations, applicable to the ThreadPolicy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ThreadPolicyOperations + extends PolicyOperations +{ + /** + * Return the value of this policy type, stated by the current instance. + */ + ThreadPolicyValue value(); +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java b/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java new file mode 100644 index 0000000..c7d4d63 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java @@ -0,0 +1,163 @@ +/* ThreadPolicyValue.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.PortableServer; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Defines the possible values for the POA thread policy. + * + * This enumeration can obtain the following values: + *This ServantActivator stub is an optional base for the + * servant activators. This stub cannot accept remote invocations, as + * methods in {@link ServantActivatorOperations} take POA as one of parameters. + * Both JDK 1.5 API and OMG specifies that POA is a local object that must not + * be transferred to the remote invocation target. + *
+ * You do not need to derive your servant activator from this stub, + * it is enough to implement the {@link ServantActivator} interface. + * But you may choose to do this if you need the functional + * {@link #_ids()} method or want to keep default behavior during + * the incarnation or etherialization. + *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class _ServantActivatorStub + extends ObjectImpl + implements ServantActivator, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -685959979577281419L; + + /** + * This the purpose of this field is undocumented up till 1.5 java API + * inclusive. + */ + public static final Class _opsClass = ServantActivatorOperations.class; + + /** + * Return the array of repository ids for this object. + * + * @return { "IDL:omg.org/PortableServer/ServantActivator:2.3", + * "IDL:omg.org/PortableServer/ServantManager:1.0" }, always. + */ + public String[] _ids() + { + return new String[] + { + "IDL:omg.org/PortableServer/ServantActivator:2.3", + "IDL:omg.org/PortableServer/ServantManager:1.0" + }; + } + + /** + * It is your responsibility to handle the incarnation event and + * supply the servant. Override this method if using the class. + * The default method instructs POA that the servant cannot be + * provided by activator. The OBJ_ADAPTER exception will be + * thrown by POA, unless the servant is provided as one of the + * parameters in the activation method. + * + * @see ServantActivatorOperations#incarnate + * + * @specnote in GNU Classpath, returning null means that the + * activator does not supply the servant. + * + * @throws ForwardRequest + */ + public Servant incarnate(byte[] Object_id, POA poa) + throws ForwardRequest + { + return null; + } + + /** + * It is your responsibility to handle the etherialization event. + * Override this method if using the class. The default method + * does nothing. + * + * @see ServantActivatorOperations#incarnate + */ + public void etherealize(byte[] Object_id, POA poa, Servant servant, + boolean cleanup, boolean remaining + ) + { + } +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/_ServantLocatorStub.java b/libjava/classpath/org/omg/PortableServer/_ServantLocatorStub.java new file mode 100644 index 0000000..8234ba2 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/_ServantLocatorStub.java @@ -0,0 +1,132 @@ +/* _ServantLocatorStub.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.PortableServer; + +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; + +import java.io.Serializable; + +/** + *The ServantLocator stub is an optional base for the + * servant locators. This stub cannot accept remote invocations, as + * methods in {@link ServantLocatorOperations} take POA as one of parameters. + * Both JDK 1.5 API and OMG specifies that POA is a local object that must not + * be transferred to the remote invocation target. + *
+ * You do not need to derive your servant locator from this stub, + * it is enough to implement the {@link ServantLocator} interface. + * But you may choose to do this if you need its functional + * {@link #_ids()} method or want to keep default behavior during per- + * or post- invokcations. + *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class _ServantLocatorStub + extends ObjectImpl + implements ServantLocator, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -2374963516905770111L; + + /** + * This the purpose of this field is undocumented up till 1.5 java API + * inclusive. + */ + public static final Class _opsClass = ServantLocatorOperations.class; + + /** + * The package private string, used as a parameter for + * the throws NullPointerExceptions in both servant locator and activator + * stubs. + */ + static final String OVERRIDE = "Override this method to get functionality."; + + /** + * Return the array of repository ids for this object, stating that it is + * both Servant locator and Servant manager. + * + * @return { "IDL:omg.org/PortableServer/ServantLocator:1.0", + * "IDL:omg.org/PortableServer/ServantManager:1.0" }, always. + */ + public String[] _ids() + { + return new String[] + { + "IDL:omg.org/PortableServer/ServantLocator:1.0", + "IDL:omg.org/PortableServer/ServantManager:1.0" + }; + } + + /** + * It is your responsibility to take the preinvoke actions, if any, + * and also supply an appropriate servant for the current invocation. + * + * The default method instructs POA that the servant cannot be + * provided by locator. The OBJ_ADAPTER exception will be + * thrown by POA, unless it uses the available default servant for all + * invocations. + * + * @specnote in GNU Classpath, returning null means that the + * locator does not supply the servant. + * + * @see ServantLocatorOperations#preinvoke + */ + public Servant preinvoke(byte[] Object_id, POA poa, String method, + CookieHolder cookie + ) + throws ForwardRequest + { + return null; + } + + /** + * It is your responsibility to take the postinvoke actions, if any, + * by overriding this method. The default method does nothing. + * + * @see ServantLocatorOperations#postinvoke + */ + public void postinvoke(byte[] Object_id, POA poa, String method, + Object cookie, Servant servant + ) + { + } +} \ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/package.html b/libjava/classpath/org/omg/PortableServer/package.html new file mode 100644 index 0000000..e4a74ef --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/package.html @@ -0,0 +1,231 @@ + + + + ++The Portable Object Adapter (POA) provides more control on the request +processing than it is possible when connecting objects directly to the +ORB. The POA model defines a tree structure of POAs, the root POA being +connected directly to the ORB. Any branch of this tree can be temporary or +permanently inactivated using {@link org.omg.PortableServer.POAManager}. +The same manager can control several branches in the POA tree. Also, +any branch in this tree can have different processing options (policies). +
+The newly created POA is in holding state, just queuing requests. To start +processing requests, it must be turned into the active state by its +{@link org.omg.PortableServer.POAManagerOperations#activate}. +
+The previously monolite object implementation is now divided into object +(that implements {@link org.omg.CORBA.Object}) +and servant (that implements either {@link org.omg.CORBA.portable.InvokeHandler} +or {@link org.omg.PortableServer.DynamicImplementation}). +Frequently each object has its own servant, but it can also be a single servant +per multiple objects and also default servant for POA +(see {@link org.omg.PortableServer.POAOperations#set_servant}). Each object +has its own Object Id, unique in the scope of the POA, where the object is +connected. These Ids need not be different for objects belonging +to different POAs, even if these POAs are connected to the same ORB. +Under the USER_ID is assignment policy this Id can be a specified by user in +{@link org.omg.PortableServer.POAOperations#activate_object_with_id}, +encapsulating some meaningful information about the object. The Id of the +object being currently served can be identified with +{@link org.omg.PortableServer.Servant#_object_id}. This approach is used in cases +when it is possible to encapsulate all object-related data into the +Object Id. Such system only needs one servant, one server socket and one +socket port per POA that can handle thounsands of objects. +
+Instead of being connected directly to the ORB, objects are now connected
+to one of the ORBs POAs. Since JDK 1.4 the application specific implementation
+base is derived from the {@link org.omg.PortableServer.Servant}, having a
+different name pattern (*POA.java instead of the previous
+_*ImplBase.java). This *POA suffix does not
+mean that these servants implement or are derived from POA. They are different
+classes that can be connected to one of the POAs, by instance, using
+{@link org.omg.PortableServer.POAOperations#servant_to_reference}.
+The implementation base also inherits an *Operations interface, containing
+definitions of the application specific methods. The application programmer
+writes a descendent of the implementation base, implementing these methods
+for the application - specific functionality.
+
+The POA objects support the method invocation by name, using +{@link org.omg.CORBA.Request}. This alternative method works without the +service-specific classes that may not be available at run time. +
+The objects in POA can also be activated and inactivated independently. It +is possible to set a listener ({@link org.omg.PortableServer.ServantActivator}) +that would register the object activations ("incarnations") and deactivations +("etherializations"). The servant need not be specifyed when creating an +object. Under the IMPLICIT_ACTIVATION +{@link org.omg.PortableServer.ImplicitActivationPolicy} +the {@link org.omg.PortableServer.ServantActivator} can provide the servant +in response to the first (local or remote) call of any method on the +previously incative object. +
+The root POA is obtained by resolving the initial reference "RootPOA" +for the orb. In the simpliest case the objects can be connected directly +to that root POA without creating the POA tree. The policies, used by +the root POA, are defined by OMG as following: +
| Policy type | Accepted policy |
|---|---|
| {@link org.omg.PortableServer.IdAssignmentPolicy} | SYSTEM_ID +(Ids are created by POA) |
| {@link org.omg.PortableServer.IdUniquenessPolicy} | UNIQUE_ID + (single object (and Id) per servant) + |
| {@link org.omg.PortableServer.ImplicitActivationPolicy} | +IMPLICIT_ACTIVATION (if inactive, activate) |
| {@link org.omg.PortableServer.LifespanPolicy} | TRANSIENT +(the POA objects cannot outlive POA) |
| {@link org.omg.PortableServer.RequestProcessingPolicy} | +USE_ACTIVE_OBJECT_MAP_ONLY (the servant is provided during activation) |
| {@link org.omg.PortableServer.ServantRetentionPolicy} | +RETAIN (retain servants for subsequent invocations) |
| {@link org.omg.PortableServer.ThreadPolicy} | ORB_CTRL_MODEL +(single thread per request and single server socket per object) |
+This set of policies means that each object will have a separate serving +thread, separate network socket port and usually a separate servant. It +is appropriate when the expected number of objects is not too large. +If the expected number of objects is larger than the supportable number +of threads and socket ports, the SINGLE_THREAD_MODEL +{@link org.omg.PortableServer.ThreadPolicy} is +used. Then all objects in POA with this policy are served in a single +thread, using the same server socket, connected to a single port. If the +request processing policy is additionally set to USE_DEFAULT_SERVANT, +all objects of this POA share the same (default) servant. +
+The operations, supported by POA are defined +separately in {@link org.omg.PortableServer.POAOperations}. +
+
_this(ORB) metod for servants for getting the object reference
+that is already narrowed to the exact object type.
+preinvoke
+will be followed by the call of the postinvoke; in
+multithreaded environment these calls are not serialized in this way. If
+the preinvoke has to tell something this-call-specific to
+the postinvoke, it must use the provided cookie holder.
+The preinvoke/postinoke are also called to provide a servant
+during each local invocation on the objects, belonging to the described POA.
+
+All these scenarios must work with the current GNU Classpath release.
+
+@author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+
+
diff --git a/libjava/classpath/org/omg/PortableServer/portable/Delegate.java b/libjava/classpath/org/omg/PortableServer/portable/Delegate.java
new file mode 100644
index 0000000..70e05e7
--- /dev/null
+++ b/libjava/classpath/org/omg/PortableServer/portable/Delegate.java
@@ -0,0 +1,112 @@
+/* DelegateOperations.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.PortableServer.portable;
+
+import org.omg.CORBA.ORB;
+import org.omg.PortableServer.POA;
+import org.omg.PortableServer.Servant;
+
+/**
+ * Each {@link Servant} has an associated delegate, where the most of the calls
+ * are forwarded. The delegate is responsible for providing the actual
+ * functionality. This class is required to supports a conceptions of
+ * the CORBA 2.3.1 Servant.
+ *
+ * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
+ */
+public interface Delegate
+{
+ /**
+ * Returns the root POA of the ORB instance, associated with this servant.
+ * It is the same POA that would be returned by resolving the initial
+ * reference "RootPOA" for that orb. The default {@link Servant#default_POA}
+ * method forwards call to the delegate can be overridden to
+ * obtain the alternative default POA.
+ *
+ * @see ORB.resolve_initial_references
+ */
+ POA default_POA(Servant a_servant);
+
+ /**
+ * Get the interface repository defintion
+ * InterfaceDef for this Object.
+ */
+ org.omg.CORBA.Object get_interface_def(Servant a_servant);
+
+ /**
+ * Checks if the passed servant is an instance of the given CORBA IDL type.
+ *
+ * @param a_servant a servant to check.
+ * @param an_id a repository ID, representing an IDL type for that the
+ * servant must be checked.
+ *
+ * @return true if the servant is an instance of the given type, false
+ * otherwise.
+ */
+ boolean is_a(Servant a_servant, String an_id);
+
+ /**
+ * Determines if the server object for this reference has already
+ * been destroyed.
+ *
+ * @return true if the object has been destroyed, false otherwise.
+ */
+ boolean non_existent(Servant a_servant);
+
+ /**
+ * Return the invocation target object identifier as a byte array.
+ */
+ byte[] object_id(Servant a_servant);
+
+ /**
+ * Returns the ORB that is directly associated with the given servant.
+ */
+ ORB orb(Servant a_servant);
+
+ /**
+ * Get POA that is directly associated with the given servant.
+ */
+ POA poa(Servant a_servant);
+
+ /**
+ * Obtains the CORBA object reference that is an invocation target for the
+ * given servant.
+ */
+ org.omg.CORBA.Object this_object(Servant a_servant);
+}
\ No newline at end of file
--
cgit v1.1