diff options
Diffstat (limited to 'libjava/classpath/org/omg/DynamicAny')
57 files changed, 11366 insertions, 0 deletions
diff --git a/libjava/classpath/org/omg/DynamicAny/AnySeqHelper.java b/libjava/classpath/org/omg/DynamicAny/AnySeqHelper.java new file mode 100644 index 000000000..5dd08096d --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/AnySeqHelper.java @@ -0,0 +1,116 @@ +/* AnySeqHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.AnySeqHolder; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A helper operations for the array of {@link Any}. This class shares + * the same {@link AnySeqHolder} as the {@link org.omg.CORBA.AnySeqHelper}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class AnySeqHelper +{ + /** + * Delegates call to {@link org.omg.CORBA.AnySeqHelper#extract}. + */ + public static Any[] extract(Any any) + { + return org.omg.CORBA.AnySeqHelper.extract(any); + } + + /** + * Get the AnySeq repository id. + * + * @return "IDL:omg.org/DynamicAny/AnySeq:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/DynamicAny/AnySeq:1.0"; + } + + /** + * Delegates call to {@link org.omg.CORBA.AnySeqHelper#insert}. + */ + public static void insert(Any any, Any[] those) + { + org.omg.CORBA.AnySeqHelper.insert(any, those); + } + + /** + * Delegates call to {@link org.omg.CORBA.AnySeqHelper#read}. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static Any[] read(InputStream input) + { + return org.omg.CORBA.AnySeqHelper.read(input); + } + + /** + * Get the typecode as officially defined for this helper. + * + * @return alias of unbounded sequence of Any's, named AnySeq, + * with the id, returned by {@link #id()}. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + TypeCode t = + orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_any)); + return orb.create_alias_tc(id(), "AnySeq", t); + } + + /** + * Delegates call to {@link org.omg.CORBA.AnySeqHelper#write}. + */ + public static void write(OutputStream output, Any[] value) + { + org.omg.CORBA.AnySeqHelper.write(output, value); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynAny.java b/libjava/classpath/org/omg/DynamicAny/DynAny.java new file mode 100644 index 000000000..cdb7a4285 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAny.java @@ -0,0 +1,71 @@ +/* DynAny.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.Any; +import org.omg.CORBA.portable.IDLEntity; + +/** + * <p> + * 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 <code>fixed</code> + * 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. + * </p> + * <p> + * The DynAny's are usually produced by {@link DynAnyFactory}. This factory is + * obtained from the ORB: <br> + * <code> + * DynAnyFactory f = DynAnyFactoryHelper.narrow + * (orb.resolve_initial_references("DynAnyFactory")); + * </code> + * </p> + * <p> + * DynAny can also be returned by a method, invoked on another DynAny. + * </p> + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynAny + extends DynAnyOperations, IDLEntity, org.omg.CORBA.Object, Serializable +{ +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyFactory.java b/libjava/classpath/org/omg/DynamicAny/DynAnyFactory.java new file mode 100644 index 000000000..5d4cc7249 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyFactory.java @@ -0,0 +1,55 @@ +/* DynAnyFactory.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; + +/** + * Produces DynAnys from Anys or typecodes. The produced DynAnys are initialized + * to they agreed default values. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynAnyFactory + extends DynAnyFactoryOperations, IDLEntity, org.omg.CORBA.Object, + Serializable +{ +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java new file mode 100644 index 000000000..2720656cc --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java @@ -0,0 +1,188 @@ +/* DynAnyFactoryHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + + +package org.omg.DynamicAny; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +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 DynAnyFactory}. Following the 1.5 JDK + * specifications, DynAnyFactory 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 DynAnyFactoryHelper +{ + /** + * Cast the passed object into the DynAnyFactory. As DynAnyFactory is a local + * object, the method just uses java final_type cast. + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a DynAnyFactory. + */ + public static DynAnyFactory narrow(org.omg.CORBA.Object obj) + { + try + { + return (DynAnyFactory) obj; + } + catch (ClassCastException cex) + { + throw new BAD_PARAM(obj.getClass().getName() + + " is not a DynAnyFactory"); + } + } + + /** + * Narrow the given object to the DynAnyFactory. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). See also OMG issue 4158. + * + * @param obj the object to cast. + * + * @return the casted DynAnyFactory. + * + * @since 1.5 + */ + public static DynAnyFactory unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + + /** + * Get the final_type code of the {@link DynAnyFactory}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.create_interface_tc(id(), "DynAnyFactory"); + } + + /** + * Insert the DynAnyFactory into the given Any. + * + * @param any the Any to insert into. + * + * @param that the DynAnyFactory to insert. + */ + public static void insert(Any any, DynAnyFactory that) + { + any.insert_Object(that); + } + + /** + * Extract the DynAnyFactory from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain DynAnyFactory. + */ + public static DynAnyFactory extract(Any any) + { + return narrow(any.extract_Object()); + } + + /** + * Get the DynAnyFactory repository id. + * + * @return "IDL:omg.org/DynamicAny/DynAnyFactory:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/DynamicAny/DynAnyFactory:1.0"; + } + + /** + * This should read DynAnyFactory from the CDR input stream, but (following + * the JDK 1.5 API) it does not. The factory can only be obtained from the + * ORB. + * + * @param input a org.omg.CORBA.portable stream to read from. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static DynAnyFactory read(InputStream input) + { + throw new MARSHAL(not_applicable(id())); + } + + /** + * This should read DynAnyFactory from the CDR input stream, but (following + * the JDK 1.5 API) it does not. + * + * @param output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, DynAnyFactory value) + { + throw new MARSHAL(not_applicable(id())); + } + + /** + * The package level method for throwing exception, explaining that the + * operation is not applicable. + * + * @param Id the Id for the typecode for that the operations was attempted to + * perform. + */ + static String not_applicable(String Id) + { + MARSHAL m = new MARSHAL("The read/write are not applicable for " + Id); + m.minor = Minor.Inappropriate; + throw m; + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryOperations.java b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryOperations.java new file mode 100644 index 000000000..c3cd919ad --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryOperations.java @@ -0,0 +1,154 @@ +/* DynAnyFactoryOperations.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; + +/** + * Defines the operations, applicable for DynAnyFactory. These operations + * produce new DynAny's either from Any, serving as a template and value + * provider, or from the given typecode. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynAnyFactoryOperations +{ + /** + * Create DynAny for holding the data of the given type. The returned DynAny + * is initialised to its agreed default value. The agreed default values are: + * <table border='1'> + * <tr> + * <th>Type</th> + * <th>Value</th> + * <th>Creates</th> + * </tr> + * + * <tr> + * <td>boolean</td> + * <td>false</td> + * <td>{@link DynAny}</td> + * </tr> + * <tr> + * <td>numeric types, octet, fixed</td> + * <td>0</td> + * <td>{@link DynAny}</td> + * </tr> + * <tr> + * <td>char, wchar</td> + * <td>(char) 0</td> + * <td>{@link DynAny}</td> + * </tr> + * <tr> + * <td>string, wstring</td> + * <td>empty string ("", not <code>null<code>)</td> + * <td>{@link DynAny}</td> + * </tr> + * <tr> + * <td>{@link Any}</td> + * <td>{@link Any} with no value and typecode of kind {@link TCKind#tk_null}</td> + * <td>{@link DynAny}</td> + * </tr> + * <tr> + * <td>Sequence</td> + * <td>Empty (zero size) sequence</td> + * <td>{@link DynSequence}</td> + * </tr> + * <tr> + * <td>Array</td> + * <td>All members of array are recursively initialised to default values.</td> + * <td>{@link DynArray}</td> + * </tr> + * <tr> + * <td>Structure, exception</td> + * <td>All fields of the structure (if any) are recursively initialised to + * default values.</td> + * <td>{@link DynStruct}</td> + * </tr> + * <tr> + * <td>Enumeration</td> + * <td>Default value, indicated by typecode.</td> + * <td>{@link DynEnum}</td> + * </tr> + * <tr> + * <td>Union</td> + * <td>Default variant (indicated by typecode), recursively initialised to + * its default value.</td> + * <td>{@link DynUnion}</td> + * </tr> + * <tr> + * <td>Value, ValueBox</td> + * <td>null</td> + * <td>{@link DynValue}, {@link DynValueBox}</td> + * </tr> + * <tr> + * <td>TypeCode</td> + * <td>Typecode of kind <code>TCKind.tk_null</code></td> + * <td>{@link DynValue}, {@link DynValueBox}</td> + * </tr> + * + * </table> + * + * @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/DynAnyFactoryPackage/InconsistentTypeCode.java b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCode.java new file mode 100644 index 000000000..bf1d2e97c --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCode.java @@ -0,0 +1,82 @@ +/* InconsistentTypeCode.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny.DynAnyFactoryPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** +* The InconsistentTypeCode is thrown on the attempt to create +* an {@link org.omg.DynamicAny.DynAny} for <code>Principal</code> +* or <code>native</code> data types. The OMG documentation states +* that these two types should not be suported by org.omg.DynamicAny +* package. +* +* @see org.omg.DynamicAny.DynAnyOperations +* +* @author Audrius Meskauskas, Lithiania (AudriusA@Bioinformatics.org) +*/ +public final class InconsistentTypeCode + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 3679785322052655944L; + + /** + * Create InconsistentTypeCode with no explaining message. + */ + public InconsistentTypeCode() + { + } + + /** + * Create the InconsistentTypeCode with explaining message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public InconsistentTypeCode(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java new file mode 100644 index 000000000..70313004f --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java @@ -0,0 +1,140 @@ +/* InconsistentTypeCodeHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny.DynAnyFactoryPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the exception {@link InconsistentTypeCode}. +* +* @author Audrius Meskauskas, Lithiania (AudriusA@Bioinformatics.org) +*/ +public abstract class InconsistentTypeCodeHelper +{ + /** + * Create the InconsistentTypeCode typecode (structure, named + * "InconsistentTypeCode"). + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[0]; + return orb.create_exception_tc(id(), "InconsistentTypeCode", members); + } + + /** + * Insert the InconsistentTypeCode into the given Any. + * + * @param any the Any to insert into. + * @param that the InconsistentTypeCode to insert. + */ + public static void insert(Any any, InconsistentTypeCode that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the InconsistentTypeCode from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain + * InconsistentTypeCode. + */ + public static InconsistentTypeCode extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (InconsistentTypeCode) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("InconsistentTypeCode expected"); + bad.initCause(cex); + bad.minor = Minor.Any; + throw bad; + } + } + + /** + * Get the InconsistentTypeCode repository id. + * + * @return "IDL:omg.org/DynamicAny/DynAnyFactory/InconsistentTypeCode:1.0". + */ + public static String id() + { + return "IDL:omg.org/DynamicAny/DynAnyFactory/InconsistentTypeCode:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static InconsistentTypeCode read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + InconsistentTypeCode value = new InconsistentTypeCode(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, InconsistentTypeCode value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java new file mode 100644 index 000000000..e376367ef --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java @@ -0,0 +1,171 @@ +/* DynAnyHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + + +package org.omg.DynamicAny; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +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"); + } + } + + /** + * Narrow the given object to the DynAny. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). See also OMG issue 4158. + * + * @param obj the object to cast. + * + * @return the casted DynAny. + * + * @since 1.5 + */ + public static DynAny unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + + /** + * Get the type code of the {@link DynAny}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.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 output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, DynAny value) + { + throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id())); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyOperations.java b/libjava/classpath/org/omg/DynamicAny/DynAnyOperations.java new file mode 100644 index 000000000..a009f4c88 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyOperations.java @@ -0,0 +1,540 @@ +/* DynAnyOperations.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.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 <code>null</code>. + * + * @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 <code>double</code> 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 <code>float</code> 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 <code>short</code> 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 an_any 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 <code>short</code> 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; +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValue.java b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValue.java new file mode 100644 index 000000000..7bae38c55 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValue.java @@ -0,0 +1,81 @@ +/* InvalidValue.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny.DynAnyPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Raised when the operation on DynAny cannot be performed because one of + * the parameters, while having the correct type, has the invalid value. + * For instance, it is raised in response to the set the array content, + * when number of the provided elements mismatch the size of array. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class InvalidValue + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 4928947584617628504L; + + /** + * Create InvalidValue with no explaining + * message. + */ + public InvalidValue() + { + } + + /** + * Create the InvalidValue with explaining + * message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public InvalidValue(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java new file mode 100644 index 000000000..cc880ba34 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java @@ -0,0 +1,141 @@ +/* InvalidValueHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny.DynAnyPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the exception {@link InvalidValue}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class InvalidValueHelper +{ + /** + * Create the InvalidValue typecode (structure, named "InvalidValue"). + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[0]; + return orb.create_exception_tc(id(), "InvalidValue", members); + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the InvalidValue into the given Any. + * + * @param any the Any to insert into. + * @param that the InvalidValue to insert. + */ + public static void insert(Any any, InvalidValue that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the InvalidValue from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain InvalidValue. + */ + public static InvalidValue extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (InvalidValue) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("InvalidValue expected"); + bad.initCause(cex); + bad.minor = Minor.Any; + throw bad; + } + } + + /** + * Get the InvalidValue repository id. + * + * @return "IDL:omg.org/DynamicAny/DynAny/InvalidValue:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/DynamicAny/DynAny/InvalidValue:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static InvalidValue read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + InvalidValue value = new InvalidValue(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, InvalidValue value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatch.java b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatch.java new file mode 100644 index 000000000..810d92058 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatch.java @@ -0,0 +1,81 @@ +/* TypeMismatch.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny.DynAnyPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Raised when the operation cannot be performed because the involved + * data structure has the mismatching typecode. For instance, it is + * raised on the attempt to set the array content, when the value being set + * has a different type than the array element. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class TypeMismatch + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -6393641830493471034L; + + /** + * Create TypeMismatch with no explaining + * message. + */ + public TypeMismatch() + { + } + + /** + * Create the TypeMismatch with explaining + * message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public TypeMismatch(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java new file mode 100644 index 000000000..92644515c --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java @@ -0,0 +1,141 @@ +/* TypeMismatchHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny.DynAnyPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the exception {@link TypeMismatch}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class TypeMismatchHelper +{ + /** + * Create the TypeMismatch typecode (structure, named "TypeMismatch"). + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[0]; + return orb.create_exception_tc(id(), "TypeMismatch", members); + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the TypeMismatch into the given Any. + * + * @param any the Any to insert into. + * @param that the TypeMismatch to insert. + */ + public static void insert(Any any, TypeMismatch that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the TypeMismatch from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain TypeMismatch. + */ + public static TypeMismatch extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (TypeMismatch) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("TypeMismatch expected"); + bad.initCause(cex); + bad.minor = Minor.Any; + throw bad; + } + } + + /** + * Get the TypeMismatch repository id. + * + * @return "IDL:omg.org/DynamicAny/DynAny/TypeMismatch:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/DynamicAny/DynAny/TypeMismatch:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static TypeMismatch read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + TypeMismatch value = new TypeMismatch(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, TypeMismatch value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/package.html b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/package.html new file mode 100644 index 000000000..d31469fe3 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/package.html @@ -0,0 +1,49 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html -- + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. --> + +<html> +<head><title>GNU Classpath - org.omg.DynamicAny.DynAnyPackage</title></head> + +<body> + +Contains several exceptions that may be thrown during the operations on +{@link org.omg.DynamicAny.DynAny } and derived classes. Includes helpers, +providing helper operations for these exceptions. + +@author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)</body> +</html> diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java new file mode 100644 index 000000000..468083afe --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java @@ -0,0 +1,146 @@ +/* DynAnySeq.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import gnu.CORBA.DynAnySeqHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +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} (DynAny[]). + * 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 +{ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + TypeCode t = orb.create_sequence_tc(0, DynAnyHelper.type()); + return orb.create_alias_tc(id(), "DynAnySeq", t); + } + + /** + * 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); + bad.minor = Minor.Any; + 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 output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, DynAny[] value) + { + throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id())); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynArray.java b/libjava/classpath/org/omg/DynamicAny/DynArray.java new file mode 100644 index 000000000..30b556acf --- /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 000000000..d9e76eb06 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java @@ -0,0 +1,170 @@ +/* DynArrayHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +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"); + } + } + + /** + * Narrow the given object to the DynArray. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). See OMG issue 4158. + * + * @param obj the object to cast. + * + * @return the casted DynArray. + * + * @since 1.5 + */ + public static DynArray unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + + /** + * Get the type code of the {@link DynArray}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.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 output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, DynArray value) + { + throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id())); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynArrayOperations.java b/libjava/classpath/org/omg/DynamicAny/DynArrayOperations.java new file mode 100644 index 000000000..18693039b --- /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 000000000..6f71bb8f8 --- /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 000000000..9599d72b5 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java @@ -0,0 +1,171 @@ +/* DynEnumHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + + +package org.omg.DynamicAny; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +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"); + } + } + + /** + * Narrow the given object to the DynEnum. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). See OMG issue 4158. + * + * @param obj the object to cast. + * + * @return the casted DynEnum. + * + * @since 1.5 + */ + public static DynEnum unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + + /** + * Get the type code of the {@link DynEnum}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.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 output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, DynEnum value) + { + throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id())); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynEnumOperations.java b/libjava/classpath/org/omg/DynamicAny/DynEnumOperations.java new file mode 100644 index 000000000..3bc3ae208 --- /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 000000000..65aa98f15 --- /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 <code>fixed</code>. The operations on + * <code>fixed</code> (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 000000000..213eb0318 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java @@ -0,0 +1,171 @@ +/* DynFixedHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + + +package org.omg.DynamicAny; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +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"); + } + } + + /** + * Narrow the given object to the DynFixed. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). See OMG issue 4158. + * + * @param obj the object to cast. + * + * @return the casted DynFixed. + * + * @since 1.5 + */ + public static DynFixed unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + + /** + * Get the type code of the {@link DynFixed}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.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 output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, DynFixed value) + { + throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id())); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynFixedOperations.java b/libjava/classpath/org/omg/DynamicAny/DynFixedOperations.java new file mode 100644 index 000000000..e8c69a768 --- /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 <code>fixed</code>. + * 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 + * <code>fixed</code>. 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 000000000..08c7b527e --- /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 000000000..e2a859b63 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java @@ -0,0 +1,170 @@ +/* DynSequenceHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +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"); + } + } + + /** + * Narrow the given object to the DynSequence. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). See OMG issue 4158. + * + * @param obj the object to cast. + * + * @return the casted DynSequence. + * + * @since 1.5 + */ + public static DynSequence unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + + /** + * Get the type code of the {@link DynSequence}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.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 output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, DynSequence value) + { + throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id())); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynSequenceOperations.java b/libjava/classpath/org/omg/DynamicAny/DynSequenceOperations.java new file mode 100644 index 000000000..77cd28383 --- /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 000000000..540537547 --- /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 000000000..ed049a105 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynStructHelper.java @@ -0,0 +1,170 @@ +/* DynStructHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +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"); + } + } + + /** + * Narrow the given object to the DynStruct. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). See OMG issue 4158. + * + * @param obj the object to cast. + * + * @return the casted DynStruct. + * + * @since 1.5 + */ + public static DynStruct unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + + /** + * Get the type code of the {@link DynStruct}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.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 output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, DynStruct value) + { + throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id())); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynStructOperations.java b/libjava/classpath/org/omg/DynamicAny/DynStructOperations.java new file mode 100644 index 000000000..03524b2f9 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynStructOperations.java @@ -0,0 +1,140 @@ +/* DynStructOperations.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.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 value 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 value 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 000000000..8875d15fa --- /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 000000000..f39ff6641 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java @@ -0,0 +1,170 @@ +/* DynUnionHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +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"); + } + } + + /** + * Narrow the given object to the DynUnion. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). See OMG issue 4158. + * + * @param obj the object to cast. + * + * @return the casted DynUnion. + * + * @since 1.5 + */ + public static DynUnion unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + + /** + * Get the type code of the {@link DynUnion}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.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 output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, DynUnion value) + { + throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id())); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynUnionOperations.java b/libjava/classpath/org/omg/DynamicAny/DynUnionOperations.java new file mode 100644 index 000000000..30b891a2d --- /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: + * <ul> + * <li>0 - contains the discriminator of the union. The discriminator defines, + * which of the union variants is currently active.</li> + * <li>1 - contains the currently active variant of the union content (a union + * member). </li> + * </ul> + * 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 +{ + /** + * <p>Get the value of discriminator, defining which content variant + * (member) is active. + * </p><p> + * In the current implementation, the later changes on the returned value + * alter the state of the union via implemented internal listener. + * </p> + */ + DynAny get_discriminator(); + + /** + * <p>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. + * </p> + * @throws TypeMismatch if the discriminator has a wrong type of this union. + */ + void set_discriminator(DynAny aDiscriminator) + throws TypeMismatch; + + /** + * Get the kind of the union descriminator. + * + * @return the TCKind value of the discriminator typecode. + */ + TCKind discriminator_kind(); + + /** + * Get the current variant of the union content. + * + * @return the current member of the union. This reference is only valid as + * long as the current member does not change. + * + * @throws InvalidValue if the union has no active member. + */ + DynAny member() + throws InvalidValue; + + /** + * Returns the kind of the currently active union member. + * + * @return the TCKind value of the union member. + * + * @throws InvalidValue if the union has no active member. + */ + TCKind member_kind() + throws InvalidValue; + + /** + * Returns the name of the currently active union member. + * + * @return the TCKind value of the union member. + * + * @throws InvalidValue if the union has no active member. + */ + String member_name() + throws InvalidValue; + + /** + * Returns true if the union has no active member. This happens if If the + * discriminator value defines no valid variant. Such union consists of + * discriminator only, having the size 1. + */ + boolean has_no_active_member(); + + /** + * Set the discriminator to default value. The current position is set to 0. + * This also sets the content variant to the default variant, and the size of + * the union becomes 2. + * + * @throws TypeMismatch if the default case is not defined for this union. + */ + void set_to_default_member() + throws TypeMismatch; + + /** + * Set the discriminator to value that does not correspond any content variant + * (any union <code>case</code> 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; +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynValue.java b/libjava/classpath/org/omg/DynamicAny/DynValue.java new file mode 100644 index 000000000..831ce60b4 --- /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 <code>null</code> 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 000000000..15ff131a9 --- /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 <code>null</code>. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynValueBox + extends DynValueBoxOperations, DynValueCommon, DynAny, IDLEntity, + org.omg.CORBA.Object, Serializable +{ +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynValueBoxOperations.java b/libjava/classpath/org/omg/DynamicAny/DynValueBoxOperations.java new file mode 100644 index 000000000..d32541bbb --- /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 <code>null</code>. + */ + 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 <code>null</code>. + */ + 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 000000000..1b324aa7d --- /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 <code>null</code>. The + * {@link DynValueCommonOperations} provides methods for setting the value to + * <code>null</code> or non-<code>null</code> and checking if the value is + * <code>null</code>. + * + * @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 <code>null</code>. + * + * @return true if this {@link DynAny} is holding the <code>null</code>, + * false otherwise. + */ + boolean is_null(); + + /** + * Set the value of this {@link DynAny} to CORBA <code>null</code>. + */ + 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 000000000..e16e42888 --- /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 + * <code>null</code>. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynValueCommonOperations + extends DynAnyOperations +{ + /** + * Check if this {@link DynAny} is holding the <code>null</code>. + * + * @return true if this {@link DynAny} is holding the <code>null</code>, + * false otherwise. + */ + boolean is_null(); + + /** + * Set the value of this {@link DynAny} to CORBA <code>null</code>. + */ + 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 000000000..b8debb15f --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/DynValueHelper.java @@ -0,0 +1,170 @@ +/* DynValueHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +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"); + } + } + + /** + * Narrow the given object to the DynValue. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). See OMG issue 4158. + * + * @param obj the object to cast. + * + * @return the casted DynValue. + * + * @since 1.5 + */ + public static DynValue unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + + /** + * Get the type code of the {@link DynValue}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.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 output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, DynValue value) + { + throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id())); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/DynValueOperations.java b/libjava/classpath/org/omg/DynamicAny/DynValueOperations.java new file mode 100644 index 000000000..b986c24dd --- /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 <code>null</code>. + * + * @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 <code>null</code>. + * @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 <code>null</code>. + * @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 <code>null</code>. + */ + 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 <code>null</code>. + */ + 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 000000000..dcc667b42 --- /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.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A helper for the FieldName. The fields {@link NameValuePair#id}, + * {@link NameDynAnyPair#id} and return values of methods + * <code>current_member_name()</code>, <code>member_name()</code> 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 = OrbRestricted.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 istream the stream to read from. + */ + public static String read(InputStream istream) + { + return istream.read_string(); + } + + /** + * Calls {@link OutputStream#write_string(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); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/NameDynAnyPair.java b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPair.java new file mode 100644 index 000000000..5fe438b5e --- /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 + * <code>null</code> 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 000000000..edf51fa5e --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairHelper.java @@ -0,0 +1,164 @@ +/* NameDynAnyPairHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import gnu.CORBA.Minor; +import gnu.CORBA.NameDynAnyPairHolder; +import gnu.CORBA.OrbRestricted; + +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 +{ + /** + * 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); + bad.minor = Minor.Any; + 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() + { + ORB orb = OrbRestricted.Singleton; + 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); + return orb.create_struct_tc(id(), "NameDynAnyPair", members); + } + + /** + * 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 output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, NameDynAnyPair value) + { + throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id())); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java new file mode 100644 index 000000000..067d01a3c --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java @@ -0,0 +1,145 @@ +/* NameDynAnyPairSeq.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import gnu.CORBA.Minor; +import gnu.CORBA.NameDynAnyPairSeqHolder; +import gnu.CORBA.OrbRestricted; + +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} + * (NameDynAnyPair[]). + * + * 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 +{ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + TypeCode t = orb.create_sequence_tc(0, NameDynAnyPairHelper.type()); + return orb.create_alias_tc(id(), "NameDynAnyPairSeq", t); + } + + /** + * 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); + bad.minor = Minor.Any; + 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 output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL always. + */ + public static void write(OutputStream output, NameDynAnyPair[] value) + { + throw new MARSHAL(DynAnyFactoryHelper.not_applicable(id())); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/NameValuePair.java b/libjava/classpath/org/omg/DynamicAny/NameValuePair.java new file mode 100644 index 000000000..359fac384 --- /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; + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/NameValuePairHelper.java b/libjava/classpath/org/omg/DynamicAny/NameValuePairHelper.java new file mode 100644 index 000000000..e62074d83 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/NameValuePairHelper.java @@ -0,0 +1,153 @@ +/* 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.Minor; +import gnu.CORBA.NameValuePairHolder; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.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 +{ + /** + * Create the NameValuePair typecode (structure, + * named "NameValuePair"). + * The typecode states that the structure contains the + * following fields: id, value. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + 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); + return orb.create_struct_tc(id(), "NameValuePair", members); + } + + /** + * 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); + bad.minor = Minor.Any; + 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); + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/NameValuePairSeqHelper.java b/libjava/classpath/org/omg/DynamicAny/NameValuePairSeqHelper.java new file mode 100644 index 000000000..4bcd7f8b5 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/NameValuePairSeqHelper.java @@ -0,0 +1,141 @@ +/* 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.Minor; +import gnu.CORBA.NameValuePairSeqHolder; +import gnu.CORBA.OrbRestricted; + +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 +{ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + TypeCode t = orb.create_sequence_tc(0, NameValuePairHelper.type()); + return orb.create_alias_tc(id(), "NameValuePairSeq", t); + } + + /** + * 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); + bad.minor = Minor.Any; + 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 ]); + } + } +} diff --git a/libjava/classpath/org/omg/DynamicAny/_DynAnyFactoryStub.java b/libjava/classpath/org/omg/DynamicAny/_DynAnyFactoryStub.java new file mode 100644 index 000000000..dcfb9b59e --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/_DynAnyFactoryStub.java @@ -0,0 +1,120 @@ +/* _DynAnyFactoryStub.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import gnu.CORBA.Minor; + +import java.io.Serializable; + +import org.omg.CORBA.Any; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; + +/** + * 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 org.omg.CORBA.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. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + public static final Class _opsClass = DynAnyFactoryOperations.class; + + /** + * Create the DynAnyFactory stub. + */ + public _DynAnyFactoryStub() + { + } + + /** + * 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 + { + MARSHAL m = new MARSHAL(NOT_APPLICABLE); + m.minor = Minor.Inappropriate; + throw m; + } + + /** + * 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 + { + MARSHAL m = new MARSHAL(NOT_APPLICABLE); + m.minor = Minor.Inappropriate; + throw m; + } + + static String NOT_APPLICABLE = + "DynAnyFactory is always local objects. " + + "It is never accessed on remote side via stub."; +} diff --git a/libjava/classpath/org/omg/DynamicAny/_DynAnyStub.java b/libjava/classpath/org/omg/DynamicAny/_DynAnyStub.java new file mode 100644 index 000000000..1a81be306 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/_DynAnyStub.java @@ -0,0 +1,628 @@ +/* _DynAnyStub.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import java.io.Serializable; + +import org.omg.CORBA.Any; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +/** + * 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. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + public static final Class _opsClass = DynAnyOperations.class; + + /** + * Create the DynAny stub. + */ + public _DynAnyStub() + { + } + + /** + * 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."; +} diff --git a/libjava/classpath/org/omg/DynamicAny/_DynArrayStub.java b/libjava/classpath/org/omg/DynamicAny/_DynArrayStub.java new file mode 100644 index 000000000..74e763b37 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/_DynArrayStub.java @@ -0,0 +1,667 @@ +/* _DynArrayStub.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import java.io.Serializable; + +import org.omg.CORBA.Any; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +/** + * 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 ObjectImpl + implements DynArray, Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -6302474930370950228L; + + /** + * The purpose and value of this field are not documented. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + public static final Class _opsClass = DynArrayOperations.class; + + /** + * Create the DynArray stub. + */ + public _DynArrayStub() + { + } + + /** + * 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); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode type() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean next() + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public DynAny current_component() + throws TypeMismatch + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean equal(DynAny _0) + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any get_any() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean get_boolean() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_char() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public double get_double() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public float get_float() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_long() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_longlong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public byte get_octet() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_short() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_string() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode get_typecode() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_ulong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_ulonglong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_ushort() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Serializable get_val() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_wchar() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_wstring() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean seek(int _0) + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any to_any() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + +} diff --git a/libjava/classpath/org/omg/DynamicAny/_DynEnumStub.java b/libjava/classpath/org/omg/DynamicAny/_DynEnumStub.java new file mode 100644 index 000000000..e56ed7517 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/_DynEnumStub.java @@ -0,0 +1,667 @@ +/* _DynEnumStub.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import java.io.Serializable; + +import org.omg.CORBA.Any; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +/** + * 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 ObjectImpl + 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. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + public static final Class _opsClass = DynEnumOperations.class; + + /** + * Create the DynEnum stub. + */ + public _DynEnumStub() + { + } + + /** + * 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); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode type() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean next() + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public DynAny current_component() + throws TypeMismatch + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean equal(DynAny _0) + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any get_any() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean get_boolean() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_char() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public double get_double() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public float get_float() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_long() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_longlong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public byte get_octet() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_short() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_string() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode get_typecode() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_ulong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_ulonglong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_ushort() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Serializable get_val() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_wchar() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_wstring() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean seek(int _0) + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any to_any() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + +} diff --git a/libjava/classpath/org/omg/DynamicAny/_DynFixedStub.java b/libjava/classpath/org/omg/DynamicAny/_DynFixedStub.java new file mode 100644 index 000000000..759b48a4e --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/_DynFixedStub.java @@ -0,0 +1,646 @@ +/* _DynFixedStub.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import java.io.Serializable; + +import org.omg.CORBA.Any; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +/** + * 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 ObjectImpl + 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. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + public static final Class _opsClass = DynFixedOperations.class; + + /** + * Create the DynFixed stub. + */ + public _DynFixedStub() + { + } + + /** + * 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); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode type() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean next() + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public DynAny current_component() + throws TypeMismatch + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean equal(DynAny _0) + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any get_any() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean get_boolean() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_char() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public double get_double() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public float get_float() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_long() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_longlong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public byte get_octet() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_short() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_string() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode get_typecode() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_ulong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_ulonglong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_ushort() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Serializable get_val() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_wchar() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_wstring() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean seek(int _0) + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any to_any() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + +} diff --git a/libjava/classpath/org/omg/DynamicAny/_DynSequenceStub.java b/libjava/classpath/org/omg/DynamicAny/_DynSequenceStub.java new file mode 100644 index 000000000..488a7de9c --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/_DynSequenceStub.java @@ -0,0 +1,691 @@ +/* _DynSequenceStub.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import java.io.Serializable; + +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; + +/** + * 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 ObjectImpl + 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. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + 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() + { + } + + /** + * 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); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode type() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean next() + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public DynAny current_component() + throws TypeMismatch + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean equal(DynAny _0) + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any get_any() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean get_boolean() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_char() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public double get_double() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public float get_float() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_long() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_longlong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public byte get_octet() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_short() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_string() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode get_typecode() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_ulong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_ulonglong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_ushort() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Serializable get_val() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_wchar() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_wstring() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean seek(int _0) + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any to_any() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + +} diff --git a/libjava/classpath/org/omg/DynamicAny/_DynStructStub.java b/libjava/classpath/org/omg/DynamicAny/_DynStructStub.java new file mode 100644 index 000000000..907f3c834 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/_DynStructStub.java @@ -0,0 +1,693 @@ +/* _DynStructStub.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import java.io.Serializable; + +import org.omg.CORBA.Any; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +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; + +/** + * 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 ObjectImpl + 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. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + 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() + { + } + + /** + * 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); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode type() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean next() + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public DynAny current_component() + throws TypeMismatch + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean equal(DynAny _0) + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any get_any() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean get_boolean() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_char() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public double get_double() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public float get_float() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_long() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_longlong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public byte get_octet() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_short() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_string() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode get_typecode() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_ulong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_ulonglong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_ushort() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Serializable get_val() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_wchar() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_wstring() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean seek(int _0) + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any to_any() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + +} diff --git a/libjava/classpath/org/omg/DynamicAny/_DynUnionStub.java b/libjava/classpath/org/omg/DynamicAny/_DynUnionStub.java new file mode 100644 index 000000000..6789a34e8 --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/_DynUnionStub.java @@ -0,0 +1,725 @@ +/* _DynUnionStub.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import java.io.Serializable; + +import org.omg.CORBA.Any; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +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; + +/** + * 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 ObjectImpl + implements DynUnion, Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -8921031953572009897L; + + /** + * The purpose and value of this field are not documented. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + 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() + { + } + + /** + * 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); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode type() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean next() + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public DynAny current_component() + throws TypeMismatch + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean equal(DynAny _0) + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any get_any() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean get_boolean() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_char() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public double get_double() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public float get_float() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_long() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_longlong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public byte get_octet() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_short() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_string() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode get_typecode() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_ulong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_ulonglong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_ushort() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Serializable get_val() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_wchar() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_wstring() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean seek(int _0) + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any to_any() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + +} diff --git a/libjava/classpath/org/omg/DynamicAny/_DynValueStub.java b/libjava/classpath/org/omg/DynamicAny/_DynValueStub.java new file mode 100644 index 000000000..fffccfe0e --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/_DynValueStub.java @@ -0,0 +1,725 @@ +/* _DynValueStub.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.DynamicAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +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 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 ObjectImpl + 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. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + public static final Class _opsClass = DynValueOperations.class; + + /** + * Create the DynValue stub. To get the stub working, + * you must later set the delegate with + * {@link org.omg.CORBA.portable.ObjectImpl#_set_delegate(Delegate)}. + */ + public _DynValueStub() + { + } + + /** + * 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); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode type() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean next() + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public DynAny current_component() + throws TypeMismatch + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean equal(DynAny _0) + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any get_any() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean get_boolean() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_char() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public double get_double() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public float get_float() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_long() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_longlong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public byte get_octet() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_short() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_string() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public TypeCode get_typecode() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public int get_ulong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public long get_ulonglong() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public short get_ushort() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Serializable get_val() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public char get_wchar() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public String get_wstring() + throws TypeMismatch, InvalidValue + { + throw new MARSHAL(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.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(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public boolean seek(int _0) + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + + /** + * The remote call of DynAny methods is not possible. + * + * @throws MARSHAL, always. + */ + public Any to_any() + { + throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); + } + +} diff --git a/libjava/classpath/org/omg/DynamicAny/package.html b/libjava/classpath/org/omg/DynamicAny/package.html new file mode 100644 index 000000000..997006d2c --- /dev/null +++ b/libjava/classpath/org/omg/DynamicAny/package.html @@ -0,0 +1,87 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html - + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. --> + +<html> +<head><title>GNU Classpath - org.omg.DynamicAny</title></head> + +<body> +<p>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. +</p><p> +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. +</p><p> +DynAny's are created by {@link DynAnyFactory}. The factory is obtaines by +{@link org.omg.CORBA.ORB#resolve_initial_references): +<code> +ORB orb = ORB.init(new String[0], null); +DynAnyFactory f = DynAnyFactoryHelper.narrow(orb.resolve_initial_references("DynAnyFactory")); +</code> +DynAny's are also returned by some methods, invoked on another DynAny. +</p><p> +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. +</p><p> +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. +</p><p> +@author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +</body> +</html>
\ No newline at end of file |