diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /libjava/classpath/org/omg/CORBA | |
download | cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2 cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'libjava/classpath/org/omg/CORBA')
224 files changed, 28034 insertions, 0 deletions
diff --git a/libjava/classpath/org/omg/CORBA/ACTIVITY_COMPLETED.java b/libjava/classpath/org/omg/CORBA/ACTIVITY_COMPLETED.java new file mode 100644 index 000000000..5fb03533a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ACTIVITY_COMPLETED.java @@ -0,0 +1,102 @@ +/* ACTIVITY_COMPLETED.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.CORBA; + +import java.io.Serializable; + +/** + * The ACTIVITY_COMPLETED indicates that the Activity context in which the + * method call was made has been completed due to a timeout of either the + * Activity itself or a transaction that encompasses the Activity. It also + * may mean that the Activity is completed in a manner other than that + * originally requested. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class ACTIVITY_COMPLETED + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID (v1.5) for interoperability. + */ + private static final long serialVersionUID = 463786710302308798L; + + /** + * Creates ACTIVITY_COMPLETED with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public ACTIVITY_COMPLETED(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates ACTIVITY_COMPLETED with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public ACTIVITY_COMPLETED() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a ACTIVITY_COMPLETED exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public ACTIVITY_COMPLETED(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created ACTIVITY_COMPLETED exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public ACTIVITY_COMPLETED(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ACTIVITY_REQUIRED.java b/libjava/classpath/org/omg/CORBA/ACTIVITY_REQUIRED.java new file mode 100644 index 000000000..eeec38254 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ACTIVITY_REQUIRED.java @@ -0,0 +1,100 @@ +/* ACTIVITY_REQUIRED.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.CORBA; + +import java.io.Serializable; + +/** + * The ACTIVITY_REQUIRED system exception indicates that an Activity context was + * necessary to perform the invoked operation, but one was not found + * associated with the calling thread. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class ACTIVITY_REQUIRED + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID (v1.5) for interoperability. + */ + private static final long serialVersionUID = -5684213471781455027L; + + /** + * Creates ACTIVITY_REQUIRED with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public ACTIVITY_REQUIRED(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates ACTIVITY_REQUIRED with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public ACTIVITY_REQUIRED() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a ACTIVITY_REQUIRED exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public ACTIVITY_REQUIRED(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created ACTIVITY_REQUIRED exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public ACTIVITY_REQUIRED(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ARG_IN.java b/libjava/classpath/org/omg/CORBA/ARG_IN.java new file mode 100644 index 000000000..1c652166a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ARG_IN.java @@ -0,0 +1,55 @@ +/* ARG_IN.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.CORBA; + +/** + * This simple interface defines just one constant, normally used + * to mark the parameter as an "input parameter". + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + * + * @see NamedValue + */ +public interface ARG_IN +{ + /** + * The flag, specifying that the parameter is used to pass and not to + * return the data. + */ + int value = 1; +} diff --git a/libjava/classpath/org/omg/CORBA/ARG_INOUT.java b/libjava/classpath/org/omg/CORBA/ARG_INOUT.java new file mode 100644 index 000000000..247c61826 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ARG_INOUT.java @@ -0,0 +1,57 @@ +/* ARG_IN.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.CORBA; + +/** + * This simple interface defines just one constant, normally used + * to mark that the the parameter is used both to pass and to + * return some value. It is a similar conception like passing a + * parameter "by reference" in C or Pascal. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + * + * @see NamedValue + */ +public interface ARG_INOUT +{ + /** + * The constant, specifying that the parameter is used both + * to pass and to return the data. + */ + int value = 3; +} diff --git a/libjava/classpath/org/omg/CORBA/ARG_OUT.java b/libjava/classpath/org/omg/CORBA/ARG_OUT.java new file mode 100644 index 000000000..4f8748829 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ARG_OUT.java @@ -0,0 +1,55 @@ +/* ARG_IN.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.CORBA; + +/** + * This simple interface defines just one constant, normally used + * to mark the parameter as an "output parameter". + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + * + * @see NamedValue + */ +public interface ARG_OUT +{ + /** + * The flag, indicating that the parameter is used to return, and + * not to pass the data. + */ + int value = 2; +} diff --git a/libjava/classpath/org/omg/CORBA/Any.java b/libjava/classpath/org/omg/CORBA/Any.java new file mode 100644 index 000000000..1e72709d2 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/Any.java @@ -0,0 +1,460 @@ +/* Any.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.CORBA; + +import java.io.Serializable; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * A container that can store a value of either user defined or + * primitive IDL type. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class Any + implements Serializable, IDLEntity +{ + /** + * Using v 1.4 serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1217179597823814463L; + + /** + * Creates an input stream from that this Any object's value can be + * read (unmarshalled). + */ + public abstract org.omg.CORBA.portable.InputStream create_input_stream(); + + /** + * Creates an output stream into which this <code>Any</code> object's + * value can be written (marshalled). + * + * @return the newly created output stream. + */ + public abstract org.omg.CORBA.portable.OutputStream create_output_stream(); + + /** + * Compare this <code>Any</code> with another <code>Any</code>. + * + * @param other the other instance to compare with. + * + * @return true if both values and value typecodes are equal, + * false otherwise. + */ + public abstract boolean equal(Any other); + + /** + * Extract the CORBA <code>Object</code> from this <code>Any</code> + * @throws BAD_OPERATION if this instance contains value other + * than <code>Object</code> or the value has not been set. + */ + public abstract org.omg.CORBA.Object extract_Object() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>Principal</code> from this <code>Any</code> + * + * @throws NO_IMPLEMENT, always. + * + * @deprecated by CORBA 2.2. + */ + public Principal extract_Principal() + { + throw new NO_IMPLEMENT(); + } + + /** + * Extract an arbitrary {@link org.omg.CORBA.portable.Streamable } from + * this <code>Any</code>. + * + * @throws BAD_INV_ORDER if the caller has invoked operations in the + * wrong order. + * + * @throws NO_IMPLEMENT, always (override to get functionality). + */ + public org.omg.CORBA.portable.Streamable extract_Streamable() + throws org.omg.CORBA.BAD_INV_ORDER + { + throw new NO_IMPLEMENT(); + } + + /** + * Extract the TypeCode from this <code>Any</code> value field. + * + * @throws BAD_OPERATION if this instance contains value other + * than <code>TypeCode</code> or the value has not been set. + */ + public abstract TypeCode extract_TypeCode() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>Value</code> from this <code>Any</code> + * @throws BAD_OPERATION if this instance contains value other + * than <code>Value</code> or the value has not been set. + */ + public abstract java.io.Serializable extract_Value() + throws BAD_OPERATION; + + /** + * Extract another <code>Any</code> from this <code>Any</code>. + * + * @throws BAD_OPERATION if this instance contains value other + * than <code>any</code> or the value has not been set. + */ + public abstract Any extract_any() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>boolean</code> from this <code>Any</code>. + * + * @throws BAD_OPERATION if this instance contains value other + * than <code>boolean</code> or the value has not been set. + */ + public abstract boolean extract_boolean() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>char</code> from this <code>Any</code>. + * + * @throws BAD_OPERATION if this instance contains value other + * than <code>char</code> or the value has not been set. + */ + public abstract char extract_char() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>double</code> from this <code>Any</code>. + * + * @throws BAD_OPERATION if this instance contains value other + * than <code>double</code> or the value has not been set. + */ + public abstract double extract_double() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>fixed</code> from this <code>Any</code>. + * + * @throws BAD_OPERATION if this instance contains value other + * than <code>fixed</code> or the value has not been set. + * + * @throws NO_IMPLEMENT, always (override to get functionality). + */ + public java.math.BigDecimal extract_fixed() + throws BAD_OPERATION + { + throw new NO_IMPLEMENT(); + } + + /** + * Extract the CORBA <code>float</code> from this <code>Any</code>. + * + * @throws BAD_OPERATION if this instance contains value other + * than <code>float</code> or the value has not been set. + */ + public abstract float extract_float() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>long</code> from this <code>Any</code>. + * + * @throws BAD_OPERATION if this instance contains value other + * than <code>long</code> or the value has not been set. + */ + public abstract int extract_long() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>long long</code> from this <code>Any</code>. + * + * @throws BAD_OPERATION if this instance contains value other + * than <code>longlong</code> or the value has not been set. + */ + public abstract long extract_longlong() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>octet</code> from this <code>Any</code>. + * + * @throws BAD_OPERATION if this instance contains value other + * than <code>octet</code> or the value has not been set. + */ + public abstract byte extract_octet() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>short</code> from this <code>Any</code>. + * + * @throws BAD_OPERATION if this instance contains value other + * than <code>short</code> or the value has not been set. + */ + public abstract short extract_short() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>string</code> from this <code>Any</code>. + * + * @throws BAD_OPERATION if this instance contains value other + * than <code>string</code> or the value has not been set. + */ + public abstract String extract_string() + throws BAD_OPERATION; + + /** + * Extract the CORBA unsigned <code>long</code> from this <code>Any</code> + * @throws BAD_OPERATION if this instance contains value other + * than unsigned <code>long</code> or the value has not been set. + */ + public abstract int extract_ulong() + throws BAD_OPERATION; + + /** + * Extract the CORBA unsigned <code>long long</code> from this + * <code>Any</code>. + * + * @throws BAD_OPERATION if this instance contains value other + * than unsigned <code>long long</code> or the value has not been set. + */ + public abstract long extract_ulonglong() + throws BAD_OPERATION; + + /** + * Extract the CORBA unsigned <code>short</code> from this <code>Any</code> + * @throws BAD_OPERATION if this instance contains value other + * than unsigned <code>short</code> or the value has not been set. + */ + public abstract short extract_ushort() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>wchar</code> from this <code>Any</code> + * @throws BAD_OPERATION if this instance contains value other + * than <code>wchar</code> or the value has not been set. + */ + public abstract char extract_wchar() + throws BAD_OPERATION; + + /** + * Extract the CORBA <code>wstring</code> from this <code>Any</code> + * @throws BAD_OPERATION if this instance contains value other + * than <code>wstring</code> or the value has not been set. + */ + public abstract String extract_wstring() + throws BAD_OPERATION; + + /** + * Insert the CORBA <code>Object</code> into this <code>Any</code> + */ + public abstract void insert_Object(org.omg.CORBA.Object x, TypeCode typecode); + + /** + * Insert the CORBA <code>Object</code> into this <code>Any</code> + */ + public abstract void insert_Object(org.omg.CORBA.Object x); + + /** + * Insert the CORBA <code>Principal</code> into this <code>Any</code>. + * @deprecated by CORBA 2.2. + */ + public void insert_Principal(Principal x) + { + throw new NO_IMPLEMENT(); + } + + /** + * Insert the CORBA <code>Streamable</code> into this <code>Any</code> + */ + public void insert_Streamable(org.omg.CORBA.portable.Streamable x) + { + throw new NO_IMPLEMENT(); + } + + /** + * Insert the CORBA <code>TypeCode</code> into this <code>Any</code> + * value field. + */ + public abstract void insert_TypeCode(TypeCode typecode); + + /** + * Insert the CORBA <code>Value</code> into this <code>Any</code>. + * + * The type of the Any should be set (by {@link #type(TypeCode)}) + * before inserting the value. + */ + public abstract void insert_Value(Serializable x, TypeCode typecode); + + /** + * Insert the CORBA <code>Value</code> into this <code>Any</code>. + * + * The type of the Any should be set (by {@link #type(TypeCode)}) + * before inserting the value. + */ + public abstract void insert_Value(Serializable x); + + /** + * Insert the CORBA <code>any</code> into this <code>Any</code> + */ + public abstract void insert_any(Any x); + + /** + * Insert the CORBA <code>boolean</code> into this <code>Any</code> + */ + public abstract void insert_boolean(boolean x); + + /** + * Insert the CORBA <code>char</code> into this <code>Any</code> + */ + public abstract void insert_char(char x); + + /** + * Insert the CORBA <code>double</code> into this <code>Any</code> + */ + public abstract void insert_double(double x); + + /** + * Insert the CORBA <code>fixed</code> into this <code>Any</code> + */ + public void insert_fixed(java.math.BigDecimal x, TypeCode typecode) + { + throw new NO_IMPLEMENT(); + } + + /** + * Insert the CORBA <code>fixed</code> into this <code>Any</code> + */ + public void insert_fixed(java.math.BigDecimal x) + { + throw new NO_IMPLEMENT(); + } + + /** + * Insert the CORBA <code>float</code> into this <code>Any</code> + */ + public abstract void insert_float(float x); + + /** + * Insert the CORBA <code>long</code> into this <code>Any</code> + */ + public abstract void insert_long(int x); + + /** + * Insert the CORBA <code>longlong</code> into this <code>Any</code> + */ + public abstract void insert_longlong(long x); + + /** + * Insert the CORBA <code>octet</code> into this <code>Any</code> + */ + public abstract void insert_octet(byte x); + + /** + * Insert the CORBA <code>short</code> into this <code>Any</code> + */ + public abstract void insert_short(short x); + + /** + * Insert the CORBA <code>string</code> into this <code>Any</code> + */ + public abstract void insert_string(String x); + + /** + * Insert the CORBA <code>ulong</code> into this <code>Any</code> + */ + public abstract void insert_ulong(int x); + + /** + * Insert the CORBA <code>ulonglong</code> into this <code>Any</code> + */ + public abstract void insert_ulonglong(long x); + + /** + * Insert the CORBA <code>ushort</code> into this <code>Any</code> + */ + public abstract void insert_ushort(short x); + + /** + * Insert the CORBA <code>wchar</code> into this <code>Any</code> + */ + public abstract void insert_wchar(char x); + + /** + * Insert the CORBA <code>wstring</code> into this <code>Any</code> + */ + public abstract void insert_wstring(String x); + + /** + * Read the value into this <code>Any</code> from the given input stream. + * + * @param input a CORBA stream to read from. + * @param type a TypeCode of the object being read. + * + * @throws org.omg.CORBA.MARSHAL if the given TypeCode does not match + * the TypeCode of the object, found in the stream. + */ + public abstract void read_value(org.omg.CORBA.portable.InputStream input, + TypeCode type + ) + throws MARSHAL; + + /** + * Set the type of the object, stored in this <code>Any</code>, to the + * given TypeCode. Clear the value. + * + * @param valueTypeCode the type of the object that is expected to be stored + * in this <code>any</code>. + */ + public abstract void type(TypeCode valueTypeCode); + + /** + * Returns the TypeCode of the object, stored in this <code>Any</code> + * @return the TypeCode + */ + public abstract TypeCode type(); + + /** + * Writes out the value (without the typecode of the value), stored in + * this <code>Any</code>. + * + * @param output the CORBA stream to write into. + * + * @throws NullPointerException if the value of this <code>Any</code> + * has not been set. + */ + public abstract void write_value(org.omg.CORBA.portable.OutputStream output); +} diff --git a/libjava/classpath/org/omg/CORBA/AnyHolder.java b/libjava/classpath/org/omg/CORBA/AnyHolder.java new file mode 100644 index 000000000..c24855480 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/AnyHolder.java @@ -0,0 +1,119 @@ +/* AnyHolder.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.CORBA; + +import gnu.CORBA.typecodes.PrimitiveTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for storing an instance of {@link Any}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class AnyHolder + implements Streamable +{ + /** + * The default type code for this holder. + */ + private static final TypeCode t_any = new PrimitiveTypeCode(TCKind.tk_any); + + /** + * The instance of {@link Any} (not the "any value"), held by this holder. + */ + public Any value; + + /** + * Constructs an instance of AnyHolder, + * initializing {@link #value} to <code>null</code>. + */ + public AnyHolder() + { + } + + /** + * Constructs an instance of AnyHolder, + * initializing {@link #value} to the passed parameter. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public AnyHolder(Any initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For {@link Any}, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_any}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_any(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return t_any; + } + + /** + * Write the {@link #value } field to the given stream. + * For {@link Any} the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_any(Any) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_any(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/AnySeqHelper.java b/libjava/classpath/org/omg/CORBA/AnySeqHelper.java new file mode 100644 index 000000000..d06e5b854 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/AnySeqHelper.java @@ -0,0 +1,152 @@ +/* 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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * the array of the type {@link Any} (not with the "any array"). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class AnySeqHelper +{ + /** + * Extract the array of {@link Any}'s from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link AnySeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link AnySeqHolder}. + */ + public static Any[] extract(Any a) + { + AnySeqHolder h = (AnySeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given {@link Any}[] into the + * given {@link Any}. This implementation first creates + * a {@link AnySeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, Any[] that) + { + AnySeqHolder holder = new AnySeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the {@link Any}[] from the CORBA input stream. + * This implementation first creates an instance of + * {@link AnySeqHolder} and then delegates functionality + * to its <code>_read()</code> method. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static Any[] read(InputStream input) + { + Any[] value = new Any[ input.read_long() ]; + for (int i = 0; i < value.length; i++) + { + value [ i ] = input.read_any(); + } + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the array of {@link Any}'s. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_any); + } + + /** + * Writes the array of {@link Any}'s into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, Any[] value) + { + output.write_long(value.length); + + for (int i = 0; i < value.length; i++) + { + output.write_any(value [ i ]); + } + } +} diff --git a/libjava/classpath/org/omg/CORBA/AnySeqHolder.java b/libjava/classpath/org/omg/CORBA/AnySeqHolder.java new file mode 100644 index 000000000..294966446 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/AnySeqHolder.java @@ -0,0 +1,128 @@ +/* AnySeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>AnySeq</code> that is mapped into + * java <code>Any[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class AnySeqHolder + implements Streamable +{ + /** + * The <code>Any[]</code> (CORBA <code>AnySeq</code>) value, + * held by this AnySeqHolder. + */ + public Any[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_any); + + /** + * Constructs an instance of AnySeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public AnySeqHolder() + { + } + + /** + * Constructs an instance of AnySeqHolder, + * initializing {@link #value} to the given array + */ + public AnySeqHolder(Any [] a_value) + { + value = a_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>and then all Any's. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new Any[ input.read_long() ]; + for (int i = 0; i < value.length; i++) + { + value [ i ] = input.read_any(); + } + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code> and then all Any's. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + + for (int i = 0; i < value.length; i++) + { + output.write_any(value [ i ]); + } + } + +} diff --git a/libjava/classpath/org/omg/CORBA/BAD_CONTEXT.java b/libjava/classpath/org/omg/CORBA/BAD_CONTEXT.java new file mode 100644 index 000000000..b4dae0e8a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BAD_CONTEXT.java @@ -0,0 +1,97 @@ +/* BAD_CONTEXT.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the operation is invoked by a client but the passed + * context has no values required by this operation. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class BAD_CONTEXT + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -5025677944847478264L; + + /** + * Creates a BAD_CONTEXT with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public BAD_CONTEXT(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates BAD_CONTEXT with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public BAD_CONTEXT() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a BAD_CONTEXT exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public BAD_CONTEXT(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created BAD_CONTEXT exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public BAD_CONTEXT(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/BAD_INV_ORDER.java b/libjava/classpath/org/omg/CORBA/BAD_INV_ORDER.java new file mode 100644 index 000000000..ca907094b --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BAD_INV_ORDER.java @@ -0,0 +1,96 @@ +/* BAD_INV_ORDER.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the caller has invoked operations in the wrong order. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class BAD_INV_ORDER + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 7273325995832240406L; + + /** + * Creates a BAD_INV_ORDER with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public BAD_INV_ORDER(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates BAD_INV_ORDER with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public BAD_INV_ORDER() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a BAD_INV_ORDER exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public BAD_INV_ORDER(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created BAD_INV_ORDER exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public BAD_INV_ORDER(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/BAD_OPERATION.java b/libjava/classpath/org/omg/CORBA/BAD_OPERATION.java new file mode 100755 index 000000000..dfa870fe6 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BAD_OPERATION.java @@ -0,0 +1,169 @@ +/* BAD_OPERATION.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the object exists but does not support the operation that was + * invoked on it. + * + * In GNU Classpath, this exception may have the following Minor codes: + * + * <table border="1"> + * <tr> + * <th>Hex</th> + * <th>Dec</th> + * <th>Minor</th> + * <th>Name</th> + * <th>Case</th> + * </tr> + * <tr> + * <td>47430000</td> + * <td>1195573248 </td> + * <td>0</td> + * <td>Method</td> + * <td> The remote side requested to invoke the method that is not available on + * that target (client and server probably disagree in the object definition). + * This code is set when the problem arises in the Classpath core; the idlj and + * rmic may generate the user code that sets 0x0 or other value.</td> + * </tr> + * <tr> + * <td>47430009</td> + * <td>1195573257</td> + * <td>9</td> + * <td>Any</td> + * <td> Attempt to extract from the Any value of the different type that was + * stored into that Any. </td> + * </tr> + * <tr> + * <td>4743000a</td> + * <td>1195573258</td> + * <td>10</td> + * <td>Activation</td> + * <td>Failed to activate the inactive object due any reason.</td> + * </tr> + * <tr> + * <td>4743000b</td> + * <td>1195573259</td> + * <td>11</td> + * <td>Policy</td> + * <td> The policies, applying to ORB or POA prevent the requested operation. + * </td> + * </tr> + * <tr> + * <td>4743000c</td> + * <td>1195573260</td> + * <td>12</td> + * <td>Socket</td> + * <td> Socket related errors like failure to open socket on the expected port.</td> + * </tr> + * <tr> + * <td>4743000e</td> + * <td>1195573262</td> + * <td>14</td> + * <td>Enumeration</td> + * <td> The passed value for enumeration is outside the valid range for that + * enumeration. </td> + * </tr> + * <tr> + * <td>4743000f</td> + * <td>1195573263</td> + * <td>15</td> + * <td>PolicyType</td> + * <td> The passed policy code is outside the valid range of the possible + * policies for the given policy type. </td> + * </tr> + * </table> + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class BAD_OPERATION + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1654621651720499682L; + + /** + * Creates a BAD_OPERATION with the default minor code of 0, completion state + * COMPLETED_NO and the given explaining message. + * + * @param message the explaining message. + */ + public BAD_OPERATION(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates BAD_OPERATION with the default minor code of 0 and a completion + * state COMPLETED_NO. + */ + public BAD_OPERATION() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates a BAD_OPERATION exception with the specified minor code and + * completion status. + * + * @param minor additional error code. + * @param completed the method completion status. + */ + public BAD_OPERATION(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created BAD_OPERATION exception, providing full information. + * + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public BAD_OPERATION(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/BAD_PARAM.java b/libjava/classpath/org/omg/CORBA/BAD_PARAM.java new file mode 100644 index 000000000..b3e46db77 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BAD_PARAM.java @@ -0,0 +1,96 @@ +/* BAD_PARAM.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.CORBA; + +import java.io.Serializable; + +/** + * The exception thrown when a parameter passed to a call is considered + * illegal. + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class BAD_PARAM + extends SystemException + implements Serializable +{ + /** + * Creates BAD_PARAM with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public BAD_PARAM(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1917109334939470379L; + + /** + * Creates BAD_PARAM with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public BAD_PARAM() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a BAD_PARAM exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public BAD_PARAM(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created BAD_PARAM exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public BAD_PARAM(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/BAD_POLICY.java b/libjava/classpath/org/omg/CORBA/BAD_POLICY.java new file mode 100644 index 000000000..43724bf4a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BAD_POLICY.java @@ -0,0 +1,55 @@ +/* BAD_POLICY.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.CORBA; + +/** + * Holds a single constant, specifying, that + * the requested {@link Policy} is not valid. One of the PolicyErrorCodes, + * others being {@link UNSUPPORTED_POLICY}, + * {@link UNSUPPORTED_POLICY_VALUE}, + * {@link BAD_POLICY_TYPE}, {@link BAD_POLICY_VALUE}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface BAD_POLICY +{ + /** + * States that the requested {@link Policy} is not valid. + */ + short value = 0; +} diff --git a/libjava/classpath/org/omg/CORBA/BAD_POLICY_TYPE.java b/libjava/classpath/org/omg/CORBA/BAD_POLICY_TYPE.java new file mode 100644 index 000000000..c90832d72 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BAD_POLICY_TYPE.java @@ -0,0 +1,55 @@ +/* BAD_POLICY_TYPE.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.CORBA; + +/** + * Holds a single constant, specifying, that + * the requested {@link Policy} type is not valid. One of the + * PolicyErrorCodes, others being {@link UNSUPPORTED_POLICY}, + * {@link UNSUPPORTED_POLICY_VALUE}, {@link BAD_POLICY}, + * {@link BAD_POLICY_VALUE}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface BAD_POLICY_TYPE +{ + /** + * States that the requested {@link Policy} type is not valid. + */ + short value = 2; +} diff --git a/libjava/classpath/org/omg/CORBA/BAD_POLICY_VALUE.java b/libjava/classpath/org/omg/CORBA/BAD_POLICY_VALUE.java new file mode 100644 index 000000000..a92c9a8b4 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BAD_POLICY_VALUE.java @@ -0,0 +1,55 @@ +/* BAD_POLICY_VALUE.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.CORBA; + +/** + * Holds a single constant, specifying, that + * the requested {@link Policy} value is not valid. One of the + * PolicyErrorCodes, others being {@link UNSUPPORTED_POLICY}, + * {@link BAD_POLICY}, {@link BAD_POLICY_TYPE}, + * {@link BAD_POLICY_VALUE}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface BAD_POLICY_VALUE +{ + /** + * States that the requested {@link Policy} value is not valid. + */ + short value = 3; +} diff --git a/libjava/classpath/org/omg/CORBA/BAD_QOS.java b/libjava/classpath/org/omg/CORBA/BAD_QOS.java new file mode 100644 index 000000000..c7ceb6924 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BAD_QOS.java @@ -0,0 +1,99 @@ +/* BAD_QOS.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.CORBA; + +import java.io.Serializable; + +/** + * The BAD_QOS is raised when the object cannot support the quality of + * service required by an invocation parameter. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class BAD_QOS + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID (v1.5) for interoperability. + */ + private static final long serialVersionUID = 4746597571263117454L; + + /** + * Creates BAD_QOS with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public BAD_QOS(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates BAD_QOS with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public BAD_QOS() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a BAD_QOS exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public BAD_QOS(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created BAD_QOS exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public BAD_QOS(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/BAD_TYPECODE.java b/libjava/classpath/org/omg/CORBA/BAD_TYPECODE.java new file mode 100644 index 000000000..1336711a8 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BAD_TYPECODE.java @@ -0,0 +1,97 @@ +/* BAD_TYPECODE.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the some TypeCode has been realized to be invalid + * (for example, has an invalid TCKind value). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class BAD_TYPECODE + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 6193364410915696901L; + + /** + * Creates a BAD_TYPECODE with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public BAD_TYPECODE(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates BAD_TYPECODE with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public BAD_TYPECODE() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a BAD_TYPECODE exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public BAD_TYPECODE(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created BAD_TYPECODE exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public BAD_TYPECODE(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/BooleanHolder.java b/libjava/classpath/org/omg/CORBA/BooleanHolder.java new file mode 100644 index 000000000..a5b7bd8bc --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BooleanHolder.java @@ -0,0 +1,127 @@ +/* BooleanHolder.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.CORBA; + +import gnu.CORBA.typecodes.PrimitiveTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for CORBA <code>boolean</code> that is mapped into + * java <code>boolean</code>. + * + * The holders have several application areas. The end user usually + * sees them implementing CORBA methods where the primitive type + * is passed by reference. While CORBA (or, for example, C) supports + * this, the java does not and a wrapper class is required. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class BooleanHolder + implements Streamable +{ + /** + * The default type code for this holder. + */ + private static final TypeCode t_boolean = + new PrimitiveTypeCode(TCKind.tk_boolean); + + /** + * The <code>boolean</code> (CORBA <code>boolean</code>) value, + * held by this BooleanHolder. + */ + public boolean value; + + /** + * Constructs an instance of BooleanHolder, + * initializing {@link #value} to <code>false</code>. + */ + public BooleanHolder() + { + } + + /** + * Constructs an instance of BooleanHolder, + * initializing {@link #value} to the given <code>boolean</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public BooleanHolder(boolean initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For <code>boolean</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_boolean}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_boolean(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return t_boolean; + } + + /** + * Write the {@link #value } field to the given stream. + * For <code>boolean</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_boolean(boolean) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_boolean(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/BooleanSeqHelper.java b/libjava/classpath/org/omg/CORBA/BooleanSeqHelper.java new file mode 100644 index 000000000..3cb2538c3 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BooleanSeqHelper.java @@ -0,0 +1,143 @@ +/* BooleanSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA sequence of <code>boolean</code> + * (<code>BooleanSeq</code>). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class BooleanSeqHelper +{ + /** + * Extract the <code>boolean[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link BooleanSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link BooleanSeqHolder}. + */ + public static boolean[] extract(Any a) + { + BooleanSeqHolder h = (BooleanSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>boolean[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link BooleanSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, boolean[] that) + { + BooleanSeqHolder holder = new BooleanSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>boolean[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static boolean[] read(InputStream input) + { + boolean [] value = new boolean[ input.read_long() ]; + input.read_boolean_array(value, 0, value.length); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>BooleanSeq</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_boolean); + } + + /** + * Writes the <code>boolean[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, boolean[] value) + { + output.write_long(value.length); + output.write_boolean_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/BooleanSeqHolder.java b/libjava/classpath/org/omg/CORBA/BooleanSeqHolder.java new file mode 100644 index 000000000..6144a17d6 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BooleanSeqHolder.java @@ -0,0 +1,126 @@ +/* BooleanSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>BooleanSeq</code> that is mapped into + * java <code>boolean[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class BooleanSeqHolder + implements Streamable +{ + /** + * The <code>boolean[]</code> (CORBA <code>BooleanSeq</code>) value, + * held by this BooleanSeqHolder. + */ + public boolean[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_boolean); + + /** + * Constructs an instance of BooleanSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public BooleanSeqHolder() + { + } + + /** + * Constructs an instance of BooleanSeqHolder, + * initializing {@link #value} to the given <code>boolean[]</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public BooleanSeqHolder(boolean[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.InputStream#read_boolean_array }. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new boolean[ input.read_long() ]; + input.read_boolean_array(value, 0, value.length); + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.OutputStream#write_boolean_array }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + output.write_boolean_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/Bounds.java b/libjava/classpath/org/omg/CORBA/Bounds.java new file mode 100644 index 000000000..f5a546480 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/Bounds.java @@ -0,0 +1,71 @@ +/* Bounds.java -- Exception thrown due to out-of-bounds parameter + 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.CORBA; + +/** + * Thrown when a parameter is outside the bounds for a particular + * object a method is trying to access. + * + * @author Andrew John Hughes (gnu_andrew@member.fsf.org) + */ +public final class Bounds + extends UserException +{ + + /** + * Constructs a default <code>Bounds</code> exception, with + * no detail message. + */ + public Bounds() + { + super(); + } + + /** + * Constructs a <code>Bounds</code> exception using the specified + * message as the reason for throwing it. + * + * @param reason the reason the exception was thrown. + */ + public Bounds(String reason) + { + super(reason); + } + +} diff --git a/libjava/classpath/org/omg/CORBA/ByteHolder.java b/libjava/classpath/org/omg/CORBA/ByteHolder.java new file mode 100644 index 000000000..c590a433e --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ByteHolder.java @@ -0,0 +1,127 @@ +/* ByteHolder.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.CORBA; + +import gnu.CORBA.typecodes.PrimitiveTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for CORBA <code>octet</code> that is mapped into + * java <code>byte</code>. + * + * The holders have several application areas. The end user usually + * sees them implementing CORBA methods where the primitive type + * is passed by reference. While CORBA (or, for example, C) supports + * this, the java does not and a wrapper class is required. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class ByteHolder + implements Streamable +{ + /** + * The default type code for this holder. + */ + private static final TypeCode t_octet = + new PrimitiveTypeCode(TCKind.tk_octet); + + /** + * The <code>byte</code> (CORBA <code>octet</code>) value, + * held by this ByteHolder. + */ + public byte value; + + /** + * Constructs an instance of ByteHolder, + * initializing {@link #value} to <code>0x0 </code>. + */ + public ByteHolder() + { + } + + /** + * Constructs an instance of ByteHolder, + * initializing {@link #value} to the given <code>byte</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public ByteHolder(byte initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For <code>octet</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_octet}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_octet(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return t_octet; + } + + /** + * Write the {@link #value } field to the given stream. + * For <code>octet</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_octet(byte) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_octet(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/CODESET_INCOMPATIBLE.java b/libjava/classpath/org/omg/CORBA/CODESET_INCOMPATIBLE.java new file mode 100644 index 000000000..fc285baff --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CODESET_INCOMPATIBLE.java @@ -0,0 +1,103 @@ +/* CODESET_INCOMPATIBLE.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.CORBA; + +import java.io.Serializable; + +/** + * Raised when client and server are unable to reach any consensus on which + * code set should be used to represent the characters. This happens when + * neither server nor client can convert from the native code set of the + * corresponding side, there is no shared codeset from that both sides could + * convert and additionally the client and server native code sets are too + * different to communicate anyway without massive data loss. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class CODESET_INCOMPATIBLE + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID (v1.5) for interoperability. + */ + private static final long serialVersionUID = -8784048396454171789L; + + /** + * Creates CODESET_INCOMPATIBLE with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public CODESET_INCOMPATIBLE(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates CODESET_INCOMPATIBLE with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public CODESET_INCOMPATIBLE() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a CODESET_INCOMPATIBLE exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public CODESET_INCOMPATIBLE(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created CODESET_INCOMPATIBLE exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public CODESET_INCOMPATIBLE(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/COMM_FAILURE.java b/libjava/classpath/org/omg/CORBA/COMM_FAILURE.java new file mode 100644 index 000000000..eab23eb75 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/COMM_FAILURE.java @@ -0,0 +1,97 @@ +/* COMM_FAILURE.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the communication has been lost while an operation + * was in progress + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class COMM_FAILURE + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 294856734784364267L; + + /** + * Creates a COMM_FAILURE with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public COMM_FAILURE(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates COMM_FAILURE with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public COMM_FAILURE() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a COMM_FAILURE exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public COMM_FAILURE(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created COMM_FAILURE exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public COMM_FAILURE(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/CTX_RESTRICT_SCOPE.java b/libjava/classpath/org/omg/CORBA/CTX_RESTRICT_SCOPE.java new file mode 100644 index 000000000..de00deffd --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CTX_RESTRICT_SCOPE.java @@ -0,0 +1,54 @@ +/* CTX_RESTRICT_SCOPE.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.CORBA; + +/** + * This simple interface defines just one constant, normally used + * to restrict the property search in the {@link Context} by + * the current context. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface CTX_RESTRICT_SCOPE +{ + /** + * The flag, specifying that the search + * is limited to the current context. + */ + int value = 15; +} diff --git a/libjava/classpath/org/omg/CORBA/CharHolder.java b/libjava/classpath/org/omg/CORBA/CharHolder.java new file mode 100644 index 000000000..6ef5210a3 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CharHolder.java @@ -0,0 +1,126 @@ +/* CharHolder.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.CORBA; + +import gnu.CORBA.typecodes.PrimitiveTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for CORBA <code>char</code> that is mapped into + * java <code>char</code>. + * + * The holders have several application areas. The end user usually + * sees them implementing CORBA methods where the primitive type + * is passed by reference. While CORBA (or, for example, C) supports + * this, the java does not and a wrapper class is required. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class CharHolder + implements Streamable +{ + /** + * The default type code for this holder. + */ + private static final TypeCode t_char = new PrimitiveTypeCode(TCKind.tk_char); + + /** + * The <code>char</code> (CORBA <code>char</code>) value, + * held by this CharHolder. + */ + public char value; + + /** + * Constructs an instance of CharHolder, + * initializing {@link #value} to <code>0 </code>. + */ + public CharHolder() + { + } + + /** + * Constructs an instance of CharHolder, + * initializing {@link #value} to the given <code>char</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public CharHolder(char initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For <code>char</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_char}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_char(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return t_char; + } + + /** + * Write the {@link #value } field to the given stream. + * For <code>char</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_char(char) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_char(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/CharSeqHelper.java b/libjava/classpath/org/omg/CORBA/CharSeqHelper.java new file mode 100644 index 000000000..4853f3d16 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CharSeqHelper.java @@ -0,0 +1,143 @@ +/* CharSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA sequence of <code>char</code> + * (<code>CharSeq</code>). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class CharSeqHelper +{ + /** + * Extract the <code>char[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link CharSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link CharSeqHolder}. + */ + public static char[] extract(Any a) + { + CharSeqHolder h = (CharSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>char[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link CharSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, char[] that) + { + CharSeqHolder holder = new CharSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>char[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static char[] read(InputStream input) + { + char [] value = new char[ input.read_long() ]; + input.read_char_array(value, 0, value.length); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>CharSeq</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_char); + } + + /** + * Writes the <code>char[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, char[] value) + { + output.write_long(value.length); + output.write_char_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/CharSeqHolder.java b/libjava/classpath/org/omg/CORBA/CharSeqHolder.java new file mode 100644 index 000000000..3fa5475a0 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CharSeqHolder.java @@ -0,0 +1,126 @@ +/* CharSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>CharSeq</code> that is mapped into + * java <code>char[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class CharSeqHolder + implements Streamable +{ + /** + * The <code>char[]</code> (CORBA <code>CharSeq</code>) value, + * held by this CharSeqHolder. + */ + public char[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_char); + + /** + * Constructs an instance of CharSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public CharSeqHolder() + { + } + + /** + * Constructs an instance of CharSeqHolder, + * initializing {@link #value} to the given <code>char[]</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public CharSeqHolder(char[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.InputStream#read_char_array }. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new char[ input.read_long() ]; + input.read_char_array(value, 0, value.length); + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.OutputStream#write_char_array }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + output.write_char_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/CompletionStatus.java b/libjava/classpath/org/omg/CORBA/CompletionStatus.java new file mode 100644 index 000000000..e60b937ce --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CompletionStatus.java @@ -0,0 +1,164 @@ +/* CompletionStatus.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.CORBA; + +import gnu.CORBA.Minor; + +import java.io.Serializable; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * Defines the method completion status, usually for the time moment, + * when the exception has been thrown. + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class CompletionStatus + implements Serializable, IDLEntity +{ + /** + * Use serialVersionUID for interoperability. + * Using the version 1.4 UID. + */ + private static final long serialVersionUID = -9047319660881406859L; + + /** + * The method was completed when the exception was thrown. + */ + public static final int _COMPLETED_YES = 0; + + /** + * The method was running when the exception was thrown. + */ + public static final int _COMPLETED_NO = 1; + + /** + * The method was either running or complete (no exact information availabe) + * when the exception was thrown. + */ + public static final int _COMPLETED_MAYBE = 2; + + /** + * An instance of CompletionStatus, initialized to {@link #COMPLETED_YES } + */ + public static final CompletionStatus COMPLETED_YES = + new CompletionStatus(_COMPLETED_YES); + + /** + * An instance of CompletionStatus, initialized to {@link #COMPLETED_NO } + */ + public static final CompletionStatus COMPLETED_NO = + new CompletionStatus(_COMPLETED_NO); + + /** + * An instance of CompletionStatus, initialized to {@link #COMPLETED_MAYBE } + */ + public static final CompletionStatus COMPLETED_MAYBE = + new CompletionStatus(_COMPLETED_MAYBE); + + /** + * The private array of all states. As long as the states form the uniform + * sequence, from_int can find the needed value directly indexing this array. + */ + private static final CompletionStatus[] states = + new CompletionStatus[] { COMPLETED_YES, COMPLETED_NO, COMPLETED_MAYBE }; + private final int _value; + + /** + * No other instances can be created. + */ + private CompletionStatus(int a_value) + { + _value = a_value; + } + + /** + * Returns the CompletionStatus, matching the given integer constant + * + * @param completion one of COMPLETED_YES, COMPLETED_NO or COMPLEED_MAYBE. + * @return one of COMPLETED_YES, COMPLETED_NO or COMPLEED_MAYBE. + * @throws BAD_PARAM if the parameter is not one of these three valid values. + */ + public static CompletionStatus from_int(int completion) + { + try + { + return states[completion]; + } + catch (ArrayIndexOutOfBoundsException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("Invalid completion status " + + completion); + bad.minor = Minor.Enumeration; + throw bad; + } + } + + /** + * Returns a short string representation. + * @return a string, defining the completion status. + */ + public String toString() + { + switch (value()) + { + case _COMPLETED_YES : + return "completed"; + + case _COMPLETED_NO : + return "not completed"; + + case _COMPLETED_MAYBE : + return "maybe completed"; + + default : + return "invalid completion status instance"; + } + } + + /** + * Returns the value, representing the completion + * status of this object. + * @return one of COMPLETED_MAYBE, COMPLETED_YES or COMPLETED_NO + */ + public int value() + { + return _value; + } +} diff --git a/libjava/classpath/org/omg/CORBA/CompletionStatusHelper.java b/libjava/classpath/org/omg/CORBA/CompletionStatusHelper.java new file mode 100644 index 000000000..280a902e5 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CompletionStatusHelper.java @@ -0,0 +1,131 @@ +/* CompletionStatusHelper.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.CORBA; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * Provides static helper methods for working with + * {@link CompletionStatus}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class CompletionStatusHelper +{ + /** + * Extract the {@link CompletionStatus} from the + * given {@link Any}. This implementation expects + * the integer (Corba long) value, stating the completion + * status. + * + * @param a an Any to extract the completion status from. + * + * @return completion status + */ + public static CompletionStatus extract(Any a) + { + return CompletionStatus.from_int(a.extract_long()); + } + + /** + * Returns the agreed Id. + * @return <code>IDL:omg.org/CORBA/CompletionStatus:1.0</code>, always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/CompletionStatus:1.0"; + } + + /** + * Insert into the given {@link CompletionStatus} into the + * given {@link Any}. This implementation inserts it as an + * integer (CORBA long). + * + * @param into the target Any. + * @param that the {@link CompletionStatus} to insert. + */ + public static void insert(Any into, CompletionStatus that) + { + into.insert_long(that.value()); + } + + /** + * Reads the {@link CompletionStatus} from the CORBA input stream. + * This implementation reads an an integer (CORBA long). + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static CompletionStatus read(InputStream input) + { + return CompletionStatus.from_int(input.read_long()); + } + + /** + * Writes the {@link CompletionStatus} into the given stream. + * This implementation writes an int (CORBA long), corresponding + * the status of completion. + * + * @param output the CORBA (not java.io) output stream to write. + * @param status the value that must be written. + */ + public static void write(OutputStream output, CompletionStatus status) + { + output.write_long(status.value()); + } + + /** + * Get the parameter mode typecode (enumeration, named "CompletionStatus"). + * The typecode states that the enumeration can obtain one of + * the following values: COMPLETED_YES ,COMPLETED_NO or COMPLETED_MAYBE . + */ + public static TypeCode type() + { + String[] members = + new String[] { "COMPLETED_YES", "COMPLETED_NO", "COMPLETED_MAYBE" }; + + return + OrbRestricted.Singleton.create_enum_tc(id(), "CompletionStatus", + members + ); + } +} diff --git a/libjava/classpath/org/omg/CORBA/Context.java b/libjava/classpath/org/omg/CORBA/Context.java new file mode 100644 index 000000000..16a47f84b --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/Context.java @@ -0,0 +1,122 @@ +/* Context.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.CORBA; + + +/** + * + * This class holds the list of the named properties. It is normally + * used to represent information about various circumstances of the + * invocation. A Context if first created by + * {@link org.omg.CORBA.ORB#get_default_context() } and then invoking + * {@link #create_child(String)} of the default context. + * + * The contexts are named. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + * + */ +public abstract class Context +{ + public Context() + { + } + + /** + * Get the context name. + * @return the name of this context. + */ + public abstract String context_name(); + + /** + * Create a child of this Context, giving it a name. + * @param child a name of the child context. + * + * @return the newly created context. + */ + public abstract Context create_child(String child); + + /** + * Delete one or several (identically named) given properties. + * + * @param property the name of the property to delete, may + * end by wildchar character '*'. The search scope is always + * limited to the current context. + */ + public abstract void delete_values(String property); + + /** + * Search the values. + * + * @param start_scope the context at which to initiate the search. + * @param flags the search operation flags. + * The flag {@link CTX_RESTRICT_SCOPE} means + * that search is restricted to the start_scope. + * @param pattern the property being searched, can be + * either name or name with the optional trailing wildchar character + * '*'. + * @return the list of the found properties. + */ + public abstract NVList get_values(String start_scope, int flags, + String pattern + ); + + /** + * Get the parent of this context. + * @return the parent of this context. + */ + public abstract Context parent(); + + /** + * Set a property. + * @param name the property name. + * @param value the property value (the {@link Any} must hold string). + */ + public abstract void set_one_value(String name, Any value); + + /** + * Set multiple properties. + * + * @param values a list of properties, the {@link Any}'s + * in the list components must hold strings. + */ + public abstract void set_values(NVList values); + + +} diff --git a/libjava/classpath/org/omg/CORBA/ContextList.java b/libjava/classpath/org/omg/CORBA/ContextList.java new file mode 100644 index 000000000..d6b8800c9 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ContextList.java @@ -0,0 +1,85 @@ +/* ContextList.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.CORBA; + + +/** + * Stores a modifiable list of String objects representing the property names. + * The property values are normally stored in the {@link Context }. + * + * The context list is created by invoking {@link ORB#create_context_list()}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class ContextList +{ + /** + * Add a name object + * @param name a name to add. + */ + public abstract void add(String name); + + /** + * Return the number of stored names + * + * @return a number of names. + */ + public abstract int count(); + + /** + * Return the name at the given index. + * + * @param at the index + * @return the name at the given index + * + * @throws Bounds if the index is out of bounds. + */ + public abstract String item(int at) + throws Bounds; + + /** + * Remove the name at the given index. + * + * @param at the index + * + * @throws Bounds if the index is out of bounds. + */ + public abstract void remove(int at) + throws Bounds; +} diff --git a/libjava/classpath/org/omg/CORBA/Current.java b/libjava/classpath/org/omg/CORBA/Current.java new file mode 100644 index 000000000..fbf5e0c46 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/Current.java @@ -0,0 +1,59 @@ +/* Current.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.CORBA; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * <p> + * The interfaces, derived from this class, define the objects, providing + * information, associated with a particular thread of execution. The examples + * of such data could be the security information, transaction identifiers + * and so on. + * </p><p> + * The various aspects of this information are provided by subinterfaces, + * derived from the Current. There are no operations defined for + * the "general" Current itself. + * </p> + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface Current + extends org.omg.CORBA.Object, IDLEntity, CurrentOperations +{ +} diff --git a/libjava/classpath/org/omg/CORBA/CurrentHelper.java b/libjava/classpath/org/omg/CORBA/CurrentHelper.java new file mode 100644 index 000000000..80c5855ef --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CurrentHelper.java @@ -0,0 +1,173 @@ +/* CurrentHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.CORBA; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.Delegate; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the CORBA object {@link Current}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class CurrentHelper +{ + /** + * The Current stub (proxy), used on the client side. + * The {@link Current} methods should contain the code for remote + * invocaton. As there are no methods defined, this class is only + * used for the formal support of the + * {@link #narrow(org.omg.CORBA.Object)}. + */ + private static class _CurrentStub + extends ObjectImpl + implements Current + { + /** + * Create the naming context stub with the given delegate. + */ + public _CurrentStub(Delegate delegate) + { + _set_delegate(delegate); + } + + /** + * Return the array of repository ids for this object. + */ + public String[] _ids() + { + return new String[] { id() }; + } + } + + /** + * Get the type code of the {@link Current}. + */ + public static TypeCode type() + { + return + OrbRestricted.Singleton.create_interface_tc(id(), "Current"); + } + + /** + * Insert the Current into the given Any. + * + * @param any the Any to insert into. + * @param that the Current to insert. + */ + public static void insert(Any any, Current that) + { + any.insert_Object(that); + } + + /** + * Extract the Current from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain Current. + */ + public static Current extract(Any any) + { + return narrow(any.extract_Object()); + } + + /** + * Get the Current repository id. + * + * @return "IDL:omg.org/CORBA/Current:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/Current:1.0"; + } + + /** + * Cast the passed object into the Current. If the + * object has a different java type, create an instance + * of the _CurrentStub, using the same delegate, as for + * the passed parameter. Hence, unlike java type cast, + * this method may return a different object, than has been passed. + * + * @param obj the object to narrow. + * @return narrowed instance. + * + * @throws BAD_PARAM if the passed object is not a Current. + */ + public static Current narrow(org.omg.CORBA.Object obj) + { + if (obj == null) + return null; + else if (obj instanceof Current) + return (Current) obj; + else if (!obj._is_a(id())) + throw new BAD_PARAM("Not a Current"); + else + { + Delegate delegate = ((ObjectImpl) obj)._get_delegate(); + return new _CurrentStub(delegate); + } + } + + /** + * Read the Current from the CDR intput stream (IOR profile expected). + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static Current read(InputStream input) + { + return narrow(input.read_Object()); + } + + /** + * Write the Current to the CDR output stream (as IOR profile). + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, Current value) + { + output.write_Object(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/CurrentHolder.java b/libjava/classpath/org/omg/CORBA/CurrentHolder.java new file mode 100644 index 000000000..fa01a41ea --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CurrentHolder.java @@ -0,0 +1,103 @@ +/* CurrentHolder.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.CORBA; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** +* A holder for the object {@link Current}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public final class CurrentHolder + implements Streamable +{ + /** + * The stored Current value. + */ + public Current value; + + /** + * Create the uninitialised instance, leaving the value field + * with default <code>null</code> value. + */ + public CurrentHolder() + { + } + + /** + * Create the initialised instance. + * @param initialValue the value that will be assigned to + * the <code>value</code> field. + */ + public CurrentHolder(Current initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link #value} by data from the CDR stream. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = CurrentHelper.read(input); + } + + /** + * Write the stored value into the CDR stream. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + CurrentHelper.write(output, value); + } + + /** + * Get the typecode of the Current. + */ + public org.omg.CORBA.TypeCode _type() + { + return CurrentHelper.type(); + } +} diff --git a/libjava/classpath/org/omg/CORBA/CurrentOperations.java b/libjava/classpath/org/omg/CORBA/CurrentOperations.java new file mode 100644 index 000000000..a40db85c4 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CurrentOperations.java @@ -0,0 +1,57 @@ +/* CurrentOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.CORBA; + + +/** + * <p> + * The interfaces, derived from this class, define operations that provide + * information, associated with a particular thread of execution. + * </p><p> + * There are no operations for the general "Current". Instead, the operations + * are defined for various subinterfaces that were derived from the + * Current. + * </p> + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + * + * @see Current + */ +public interface CurrentOperations +{ +} diff --git a/libjava/classpath/org/omg/CORBA/CustomMarshal.java b/libjava/classpath/org/omg/CORBA/CustomMarshal.java new file mode 100644 index 000000000..5adbf3197 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CustomMarshal.java @@ -0,0 +1,68 @@ +/* CustomMarshal.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.CORBA; + + +/** + * This interface indicates that the object can provide its own methods + * for reading and writing its content. This interface is typically used + * by the CORBA implementation only. The user application should use the + * {@link CustomValue} that is a descendant of this interface. + * + * @see DataInputStream + * @see DataOutputStream + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface CustomMarshal +{ + /** + * Read (unmarshal) the content of this object from the given input stream. + * + * @param into_stream a stream to read from. + */ + public void marshal(DataOutputStream into_stream); + + /** + * Write (marshal) the content of this object to the given input stream. + * + * @param from_stream a stream to write into. + */ + public void unmarshal(DataInputStream from_stream); +} diff --git a/libjava/classpath/org/omg/CORBA/CustomValue.java b/libjava/classpath/org/omg/CORBA/CustomValue.java new file mode 100644 index 000000000..0c080fb84 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CustomValue.java @@ -0,0 +1,61 @@ +/* CustomValue.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.CORBA; + +import org.omg.CORBA.portable.StreamableValue; +import org.omg.CORBA.portable.ValueBase; + +/** + * A Custom Value is a {@link ValueBase} implementing its own methods for + * reading and writing (unmarshaling and marshaling) the content. These methods + * are defined in superinterface {@link CustomMarshal}. + * + * Custom value types can never be safely truncated to the more general + * base type. They and always require an exact match for their RepositoryId + * in the receiving context. + * + * If the value base does not implement this interface, it normally implements + * {@link StreamableValue} instead. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface CustomValue + extends ValueBase, CustomMarshal +{ +} diff --git a/libjava/classpath/org/omg/CORBA/DATA_CONVERSION.java b/libjava/classpath/org/omg/CORBA/DATA_CONVERSION.java new file mode 100644 index 000000000..a7dd4d728 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DATA_CONVERSION.java @@ -0,0 +1,117 @@ +/* DATA_CONVERSION.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the ORB cannot convert between the marshalled and + * native data representation. + * + * In GNU Classpath, this exception may have the following minor codes: + * + * <table border="1"> + * <tr> + * <td>Hex</td> + * <td>Dec</td> + * <td>Minor</td> + * <td>Name</td> + * <td>Case</td> + * </tr> + * <td>47430016</td> + * <td>1195573270</td> + * <td>22</td> + * <td>Missing_IOR</td> + * <td>The object URL is such that the IOR string must be read from some + * local or remote resource (file or network), but this resource is not + * reacheable.</td> + * </tr> + * </table> + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class DATA_CONVERSION + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1874869932271600956L; + + /** + * Creates a DATA_CONVERSION with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public DATA_CONVERSION(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates DATA_CONVERSION with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public DATA_CONVERSION() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a DATA_CONVERSION exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public DATA_CONVERSION(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created DATA_CONVERSION exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public DATA_CONVERSION(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/DataInputStream.java b/libjava/classpath/org/omg/CORBA/DataInputStream.java new file mode 100644 index 000000000..70a0b2c47 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DataInputStream.java @@ -0,0 +1,276 @@ +/* DataInputStream.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.CORBA; + +import org.omg.CORBA.portable.ValueBase; + +/** + * An interface for reading the custom value types. A value type, providing + * its own mechanism for reading the content, must implement + * the {@link CustomValue} that uses this interface. + * + * @see CustomValue + * @see CustomMarshal + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DataInputStream + extends ValueBase +{ + /** + * Read {@link Any}. + * @return a value, extracted from the stream. + */ + Any read_any(); + + /** + * Read boolean. + * @return a value, extracted from the stream. + */ + boolean read_boolean(); + + /** + * Read narrow (usually 8 bit) char. + * @return a value, extracted from the stream. + */ + char read_char(); + + /** + * Read wide (usually 16 bit) char. + * @return a value, extracted from the stream. + */ + char read_wchar(); + + /** + * Read octet (byte). + * @return a value, extracted from the stream. + */ + byte read_octet(); + + /** + * Read short (16 bit int). + * @return a value, extracted from the stream. + */ + short read_short(); + + /** + * Read unsigned short. + * @return a value, extracted from the stream. + */ + short read_ushort(); + + /** + * Read CORBA long (java int, 32 bits). + * @return a value, extracted from the stream. + */ + int read_long(); + + /** + * Read CORBA unsigned long (java int). + * @return a value, extracted from the stream. + */ + int read_ulong(); + + /** + * Read CORBA long long (java long, 64 bits). + * @return a value, extracted from the stream. + */ + long read_longlong(); + + /** + * Read unsigned CORBA long long (java long, 64 bits). + * @return a value, extracted from the stream. + */ + long read_ulonglong(); + + /** + * Read float. + * @return a value, extracted from the stream. + */ + float read_float(); + + /** + * Read dobule. + * @return a value, extracted from the stream. + */ + double read_double(); + + /** + * Read narrow string (usually 8 bits per character). + * @return a value, extracted from the stream. + */ + String read_string(); + + /** + * Read wide string (usually 16 bits per character). + * @return a value, extracted from the stream. + */ + String read_wstring(); + + /** + * Read CORBA object. + * + * @return a value, extracted from the stream. May be null + * if the null was previously written by {@link DataOutputStream#write_Object}. + */ + org.omg.CORBA.Object read_Object(); + + /** + * Read abstract interface. + * + * @return a value, extracted from the stream. May be either CORBA Object or + * CORBA value type. + */ + java.lang.Object read_Abstract(); + + /** + * Read the CORBA value type. + * @return a value, extracted from the stream. + */ + java.io.Serializable read_Value(); + + /** + * Read typecode. + * @return a value, extracted from the stream. + */ + TypeCode read_TypeCode(); + + /** + * Read array of Any's. + * + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_any_array(AnySeqHolder seq, int offset, int length); + + /** + * Read boolean array. + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_boolean_array(BooleanSeqHolder seq, int offset, int length); + + /** + * Read array of narrow (usually 8 bit) chars. + * + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_char_array(CharSeqHolder seq, int offset, int length); + + /** + * Read array of wide (usually 16 bit) chars. + * + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_wchar_array(WCharSeqHolder seq, int offset, int length); + + /** + * Read array of bytes. + * + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_octet_array(OctetSeqHolder seq, int offset, int length); + + /** + * Read array of shorts (16 bit ints). + * + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_short_array(ShortSeqHolder seq, int offset, int length); + + /** + * Read array of unsigned shorts (16 bit ints). + * + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_ushort_array(UShortSeqHolder seq, int offset, int length); + + /** + * Read array of CORBA longs (java ints). + * + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_long_array(LongSeqHolder seq, int offset, int length); + + /** + * Read array of CORBA unsigned longs (java ints). + * + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_ulong_array(ULongSeqHolder seq, int offset, int length); + + /** + * Read array of CORBA unsigned long longs (java longs). + * + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_ulonglong_array(ULongLongSeqHolder seq, int offset, int length); + + /** + * Read array of CORBA long longs (java longs). + * + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_longlong_array(LongLongSeqHolder seq, int offset, int length); + + /** + * Read array of floats. + * + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_float_array(FloatSeqHolder seq, int offset, int length); + + /** + * Read array of doubles. + * + * The value, extracted from the stream, is returned in the + * .value field of the passed holder. + */ + void read_double_array(DoubleSeqHolder seq, int offset, int length); +} diff --git a/libjava/classpath/org/omg/CORBA/DataOutputStream.java b/libjava/classpath/org/omg/CORBA/DataOutputStream.java new file mode 100644 index 000000000..e1a417fce --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DataOutputStream.java @@ -0,0 +1,281 @@ +/* DataOutputStream.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.CORBA; + +import org.omg.CORBA.portable.ValueBase; + +/** + * An interface for writing the custom value types. A value type, providing + * its own mechanism for writing the content, must implement + * the {@link CustomValue} that uses this interface. + * + * @see CustomValue + * @see CustomMarshal + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DataOutputStream + extends ValueBase +{ + /** + * Write {@link Any} to the output stream. + * + * @param value a value to write. + */ + void write_any(Any value); + + /** + * Write boolean to the output stream. + * + * @param value a value to write. + */ + void write_boolean(boolean value); + + /** + * Write narrow (usually 8 bit) char to the output stream. + * + * @param value a value to write. + */ + void write_char(char value); + + /** + * Write wide (usually 16 bit) char to the output stream. + * + * @param value a value to write. + */ + void write_wchar(char value); + + /** + * Write octet (byte) to the output stream. + * + * @param value a value to write. + */ + void write_octet(byte value); + + /** + * Write short (16 bit signed integer) to the output stream. + * + * @param value a value to write. + */ + void write_short(short value); + + /** + * Write unsigned short to the output stream. + * + * @param value a value to write. + */ + void write_ushort(short value); + + /** + * Write CORBA long (32 bits, java int) to the output stream. + * + * @param value a value to write. + */ + void write_long(int value); + + /** + * Write unsigned CORBA long (32 bits, java int) to the output stream. + * + * @param value a value to write. + */ + void write_ulong(int value); + + /** + * Write CORBA long long (64 bits, java long) to the output stream. + * + * @param value a value to write. + */ + void write_longlong(long value); + + /** + * Write unsigned CORBA long long (64 bits, java long) to the output stream. + * + * @param value a value to write. + */ + void write_ulonglong(long value); + + /** + * Write float to the output stream. + * + * @param value a value to write. + */ + void write_float(float value); + + /** + * Write double to the output stream. + * + * @param value a value to write. + */ + void write_double(double value); + + /** + * Write narrow (usually 8 bits per character) string to the output stream. + * + * @param value a value to write. + */ + void write_string(String value); + + /** + * Write wide (usually 16 bits per character) string to the output stream. + * + * @param value a value to write. + */ + void write_wstring(String value); + + /** + * Write CORBA object reference to the output stream. + * + * @param value a value to write, null should be supported. + */ + void write_Object(org.omg.CORBA.Object value); + + /** + * Write abstract interface to the output stream. + * + * @param value a value to write, can be either CORBA object or + * CORBA value type. + */ + void write_Abstract(java.lang.Object value); + + /** + * Write value type to the output stream. + * + * @param value a value to write. + */ + void write_Value(java.io.Serializable value); + + /** + * Write typecode to the output stream. + * + * @param value a value to write. + */ + void write_TypeCode(TypeCode value); + + /** + * Write array of Any's to the output stream. + * + * @param seq a value to write. + */ + void write_any_array(Any[] seq, int offset, int length); + + /** + * Write array of boolean's to the output stream. + * + * @param seq a value to write. + */ + void write_boolean_array(boolean[] seq, int offset, int length); + + /** + * Write array of narrow chars to the output stream. + * + * @param seq a value to write. + */ + void write_char_array(char[] seq, int offset, int length); + + /** + * Write array of wide chars to the output stream. + * + * @param seq a value to write. + */ + void write_wchar_array(char[] seq, int offset, int length); + + /** + * Write array of octets (bytes) to the output stream. + * + * @param seq a value to write. + */ + void write_octet_array(byte[] seq, int offset, int length); + + /** + * Write array of shorts (16 bit integers) to the output stream. + * + * @param seq a value to write. + */ + void write_short_array(short[] seq, int offset, int length); + + /** + * Write array of unsigned shorts (16 bit integers) to the output stream. + * + * @param seq a value to write. + */ + void write_ushort_array(short[] seq, int offset, int length); + + /** + * Write array of CORBA longs (java ints) to the output stream. + * + * @param seq a value to write. + */ + void write_long_array(int[] seq, int offset, int length); + + /** + * Write array of unsigned CORBA longs (java ints) to the output stream. + * + * @param seq a value to write. + */ + void write_ulong_array(int[] seq, int offset, int length); + + /** + * Write array of unsigned CORBA long longs (java longs) + * to the output stream. + * + * @param seq a value to write. + */ + void write_ulonglong_array(long[] seq, int offset, int length); + + /** + * Write arrayo fo CORBA long longs (java ints) to the output stream. + * + * @param seq a value to write. + */ + void write_longlong_array(long[] seq, int offset, int length); + + /** + * Write array of floats to the output stream. + * + * @param seq a value to write. + */ + void write_float_array(float[] seq, int offset, int length); + + /** + * Write array of doubles to the output stream. + * + * @param seq a value to write. + */ + void write_double_array(double[] seq, int offset, int length); +} diff --git a/libjava/classpath/org/omg/CORBA/DefinitionKind.java b/libjava/classpath/org/omg/CORBA/DefinitionKind.java new file mode 100644 index 000000000..09100b598 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DefinitionKind.java @@ -0,0 +1,425 @@ +/* DefinitionKind.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.CORBA; + +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * This class indicates the kind of the definition, stored in the interface + * repository. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class DefinitionKind + implements IDLEntity, Serializable +{ + /** + * Use v1.4 serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -8601167576704143376L; + + /** + * Indicates that the current definition defines has no definition kind. + */ + public static final int _dk_none = 0; + + /** + * This is a "wildcard '*'", used in cases where any definition kind + * is appropriate . + */ + public static final int _dk_all = 1; + + /** + * Indicates that the current definition defines an attribute. + */ + public static final int _dk_Attribute = 2; + + /** + * Indicates that the current definition defines a constant. + */ + public static final int _dk_Constant = 3; + + /** + * Indicates that the current definition defines an exception. + */ + public static final int _dk_Exception = 4; + + /** + * Indicates that the current definition defines an interface. + * The interface definition can contain constants, types, + * exceptions, operations, and attributes. + */ + public static final int _dk_Interface = 5; + + /** + * Indicates that the current definition defines a Module. + * The Module can contain constants, typedefs, exceptions and also + * interface, component, home, value or event type definitions. + * The module can also enclose other (nested) modules. + */ + public static final int _dk_Module = 6; + + /** + * Indicates that the current definition defines an operation, including + * the lists of parameters and exceptions raised by this operation. + */ + public static final int _dk_Operation = 7; + + /** + * Indicates that the current definition defines a named type that is not + * an interface nor a value definition. Generally, it also cannot be + * a definition of component, home and event, but these three kinds are + * not listed in this class. + */ + public static final int _dk_Typedef = 8; + + /** + * Indicates that the current definition defines an alias. + */ + public static final int _dk_Alias = 9; + + /** + * Indicates that the current definition defines a structure. + */ + public static final int _dk_Struct = 10; + + /** + * Indicates that the current definition defines a union. + */ + public static final int _dk_Union = 11; + + /** + * Indicates that the current definition defines an enumeration. + */ + public static final int _dk_Enum = 12; + + /** + * Indicates that the current definition defines a primitive type. + */ + public static final int _dk_Primitive = 13; + + /** + * Indicates that the current definition defines a string. + */ + public static final int _dk_String = 14; + + /** + * Indicates that the current definition defines a sequence. + */ + public static final int _dk_Sequence = 15; + + /** + * Indicates that the current definition defines an array. + */ + public static final int _dk_Array = 16; + + /** + * Indicates that the current definition defines an another interface + * repository. + */ + public static final int _dk_Repository = 17; + + /** + * Indicates that the current definition defines a wide (usually 16-bit + * per character) string. + */ + public static final int _dk_Wstring = 18; + + /** + * Indicates that the current definition defines a CORBA <code>fixed</code>. + */ + public static final int _dk_Fixed = 19; + + /** + * Indicates that the current definition defines a value. + */ + public static final int _dk_Value = 20; + + /** + * Indicates that the current definition defines a value box. + */ + public static final int _dk_ValueBox = 21; + + /** + * Indicates that the current definition defines value member. + */ + public static final int _dk_ValueMember = 22; + + /** + * Indicates that the current definition defines a Native. + */ + public static final int _dk_Native = 23; + + /** + * Indicates that the current definition defines an abstract interface. + */ + public static final int _dk_AbstractInterface = 24; + + /** + * Indicates that the current definition defines has no definition kind. + */ + public static final DefinitionKind dk_none = new DefinitionKind(_dk_none); + + /** + * This is a "wildcard '*'", used in cases where any definition kind + * is appropriate . + */ + public static final DefinitionKind dk_all = new DefinitionKind(_dk_all); + + /** + * Indicates that the current definition defines an attribute. + */ + public static final DefinitionKind dk_Attribute = new DefinitionKind(_dk_Attribute); + + /** + * Indicates that the current definition defines a constant. + */ + public static final DefinitionKind dk_Constant = new DefinitionKind(_dk_Constant); + + /** + * Indicates that the current definition defines an exception. + */ + public static final DefinitionKind dk_Exception = new DefinitionKind(_dk_Exception); + + /** + * Indicates that the current definition defines an interface. + * The interface definition can contain constants, types, + * exceptions, operations, and attributes. + */ + public static final DefinitionKind dk_Interface = new DefinitionKind(_dk_Interface); + + /** + * Indicates that the current definition defines a Module. + * The Module can contain constants, typedefs, exceptions and also + * interface, component, home, value or event type definitions. + * The module can also enclose other (nested) modules. + */ + public static final DefinitionKind dk_Module = new DefinitionKind(_dk_Module); + + /** + * Indicates that the current definition defines an operation, including + * the lists of parameters and exceptions raised by this operation. + */ + public static final DefinitionKind dk_Operation = new DefinitionKind(_dk_Operation); + + /** + * Indicates that the current definition defines a named type that is not + * an interface nor a value definition. Generally, it also cannot be + * a definition of component, home and event, but these three kinds are + * not listed in this class. + */ + public static final DefinitionKind dk_Typedef = new DefinitionKind(_dk_Typedef); + + /** + * Indicates that the current definition defines an alias. + */ + public static final DefinitionKind dk_Alias = new DefinitionKind(_dk_Alias); + + /** + * Indicates that the current definition defines a structure. + */ + public static final DefinitionKind dk_Struct = new DefinitionKind(_dk_Struct); + + /** + * Indicates that the current definition defines a union. + */ + public static final DefinitionKind dk_Union = new DefinitionKind(_dk_Union); + + /** + * Indicates that the current definition defines an enumeration. + */ + public static final DefinitionKind dk_Enum = new DefinitionKind(_dk_Enum); + + /** + * Indicates that the current definition defines a primitive type. + */ + public static final DefinitionKind dk_Primitive = new DefinitionKind(_dk_Primitive); + + /** + * Indicates that the current definition defines a string. + */ + public static final DefinitionKind dk_String = new DefinitionKind(_dk_String); + + /** + * Indicates that the current definition defines a sequence. + */ + public static final DefinitionKind dk_Sequence = new DefinitionKind(_dk_Sequence); + + /** + * Indicates that the current definition defines an array. + */ + public static final DefinitionKind dk_Array = new DefinitionKind(_dk_Array); + + /** + * Indicates that the current definition defines an another interface + * repository. + */ + public static final DefinitionKind dk_Repository = + new DefinitionKind(_dk_Repository); + + /** + * Indicates that the current definition defines a wide (usually 16-bit + * per character) string. + */ + public static final DefinitionKind dk_Wstring = new DefinitionKind(_dk_Wstring); + + /** + * Indicates that the current definition defines a CORBA <code>fixed</code>. + */ + public static final DefinitionKind dk_Fixed = new DefinitionKind(_dk_Fixed); + + /** + * Indicates that the current definition defines a value. + */ + public static final DefinitionKind dk_Value = new DefinitionKind(_dk_Value); + + /** + * Indicates that the current definition defines a value box. + */ + public static final DefinitionKind dk_ValueBox = new DefinitionKind(_dk_ValueBox); + + /** + * Indicates that the current definition defines value member. + */ + public static final DefinitionKind dk_ValueMember = + new DefinitionKind(_dk_ValueMember); + + /** + * Indicates that the current definition defines a Native. + */ + public static final DefinitionKind dk_Native = new DefinitionKind(_dk_Native); + + /** + * Indicates that the current definition defines . + */ + public static final DefinitionKind dk_AbstractInterface = + new DefinitionKind(_dk_AbstractInterface); + + /** + * The defintion code of the current instance of the definition kind. + */ + private final int kind; + + /** + * The table of the definition kinds + */ + private static DefinitionKind[] table; + + /** + * Creates a definition kind with the given integer definition kind code. + * + * @param a_kind a definition kind code, one of the _dk_.. constants, + * defined in this class. + */ + protected DefinitionKind(int a_kind) + { + kind = a_kind; + } + + /** + * Get the definition code of the current instance of the definition kind. + * + * @return one of the _dk_... constants, defined in this class. + */ + public int value() + { + return kind; + } + + /** + * Get the definition kind, corresponding the given integer code. + * + * @param a_kind the definition kind code, one of the _dk_... constants, + * defined in this class. + * + * @return the corresponding definition kind, one of the dk_... constants, + * defined in this class. + * + * @throws BAD_PARAM if the given integer does not match any definition + * kind. + */ + public static DefinitionKind from_int(int a_kind) + { + if (table == null) + fill_table(); + try + { + return table [ a_kind ]; + } + catch (ArrayIndexOutOfBoundsException ex) + { + throw new BAD_PARAM("No def. kind " + a_kind); + } + } + + /** + * Fill the conversion table on demand. + */ + private static void fill_table() + { + table = new DefinitionKind[ 25 ]; + table [ _dk_none ] = dk_none; + table [ _dk_all ] = dk_all; + table [ _dk_Attribute ] = dk_Attribute; + table [ _dk_Constant ] = dk_Constant; + table [ _dk_Exception ] = dk_Exception; + table [ _dk_Interface ] = dk_Interface; + table [ _dk_Module ] = dk_Module; + table [ _dk_Operation ] = dk_Operation; + table [ _dk_Typedef ] = dk_Typedef; + table [ _dk_Alias ] = dk_Alias; + table [ _dk_Struct ] = dk_Struct; + table [ _dk_Union ] = dk_Union; + table [ _dk_Enum ] = dk_Enum; + table [ _dk_Primitive ] = dk_Primitive; + table [ _dk_String ] = dk_String; + table [ _dk_Sequence ] = dk_Sequence; + table [ _dk_Array ] = dk_Array; + table [ _dk_Repository ] = dk_Repository; + table [ _dk_Wstring ] = dk_Wstring; + table [ _dk_Fixed ] = dk_Fixed; + table [ _dk_Value ] = dk_Value; + table [ _dk_ValueBox ] = dk_ValueBox; + table [ _dk_ValueMember ] = dk_ValueMember; + table [ _dk_Native ] = dk_Native; + table [ _dk_AbstractInterface ] = dk_AbstractInterface; + } +} diff --git a/libjava/classpath/org/omg/CORBA/DefinitionKindHelper.java b/libjava/classpath/org/omg/CORBA/DefinitionKindHelper.java new file mode 100644 index 000000000..2a6c97dc1 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DefinitionKindHelper.java @@ -0,0 +1,125 @@ +/* DefinitionKindHelper.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.CORBA; + +import gnu.CORBA.DefinitionKindHolder; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A helper operations for the definition kind. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class DefinitionKindHelper +{ + /** + * Insert the definition kind into the given Any. + */ + public static void insert(Any a, DefinitionKind that) + { + a.insert_Streamable(new DefinitionKindHolder(that)); + } + + /** + * Extract the definition kind from the given Any. + */ + public static DefinitionKind extract(Any a) + { + return ((DefinitionKindHolder) a.extract_Streamable()).value; + } + + /** + * Get the definition kind typecode (enumeration, named "DefinitionKind"). + * The member names are listed as defined by java 1.4 specification. + * The names, defined in OMG specification only (like dk_Home or + * dk_Event) are not listed. + */ + public static TypeCode type() + { + String[] members = + new String[] + { + "dk_none", "dk_all", "dk_Attribute", "dk_Constant", "dk_Exception", + "dk_Interface", "dk_Module", "dk_Operation", "dk_Typedef", + "dk_Alias", "dk_Struct", "dk_Union", "dk_Enum", "dk_Primitive", + "dk_String", "dk_Sequence", "dk_Array", "dk_Repository", + "dk_Wstring", "dk_Fixed", "dk_Value", "dk_ValueBox", + "dk_ValueMember", "dk_Native" + }; + + return + OrbRestricted.Singleton.create_enum_tc(id(), "DefinitionKind", + members + ); + } + + /** + * Get the definition kind repository id. + * + * @return "IDL:omg.org/CORBA/DefinitionKind:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/DefinitionKind:1.0"; + } + + /** + * Read the definitin kind (as int) from the CDR intput stream. + * + * @param istream a stream to read from. + */ + public static DefinitionKind read(InputStream istream) + { + return DefinitionKind.from_int(istream.read_long()); + } + + /** + * Write the definition kind (as int) to the CDR output stream. + * + * @param ostream a stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream ostream, DefinitionKind value) + { + ostream.write_long(value.value()); + } +} diff --git a/libjava/classpath/org/omg/CORBA/DomainManager.java b/libjava/classpath/org/omg/CORBA/DomainManager.java new file mode 100644 index 000000000..a7a89fd1a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DomainManager.java @@ -0,0 +1,57 @@ +/* DomainManager.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.CORBA; + +import java.io.Serializable; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * Establishes and navigates relationships to superior and subordinate domains, + * and also creates and access policies. + * + * The DomainManager has associated with it the policy objects for a + * particular domain. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface DomainManager + extends IDLEntity, Object, Serializable, DomainManagerOperations +{ +} diff --git a/libjava/classpath/org/omg/CORBA/DomainManagerOperations.java b/libjava/classpath/org/omg/CORBA/DomainManagerOperations.java new file mode 100644 index 000000000..6bda64d76 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DomainManagerOperations.java @@ -0,0 +1,59 @@ +/* DomainManagerOperations.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.CORBA; + + +/** + * Provides the means to access the policies of the domain, with that + * the implementing {@link DomainManager} is associated. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface DomainManagerOperations +{ + /** + * Get the policy of the specified type for the objects, belonging + * to this domain. The policy types are domain specific. + * + * @param policy_type the policy type + * + * @return the policy + */ + Policy get_domain_policy(int policy_type); +} diff --git a/libjava/classpath/org/omg/CORBA/DoubleHolder.java b/libjava/classpath/org/omg/CORBA/DoubleHolder.java new file mode 100644 index 000000000..23ec513f9 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DoubleHolder.java @@ -0,0 +1,127 @@ +/* DoubleHolder.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.CORBA; + +import gnu.CORBA.typecodes.PrimitiveTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for CORBA <code>double</code> that is mapped into + * java <code>double</code>. + * + * The holders have several application areas. The end user usually + * sees them implementing CORBA methods where the primitive type + * is passed by reference. While CORBA (or, for example, C) supports + * this, the java does not and a wrapper class is required. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class DoubleHolder + implements Streamable +{ + /** + * The default type code for this holder. + */ + private static final TypeCode t_double = + new PrimitiveTypeCode(TCKind.tk_double); + + /** + * The <code>double</code> (CORBA <code>double</code>) value, + * held by this DoubleHolder. + */ + public double value; + + /** + * Constructs an instance of DoubleHolder, + * initializing {@link #value} to <code>0.0</code>. + */ + public DoubleHolder() + { + } + + /** + * Constructs an instance of DoubleHolder, + * initializing {@link #value} to the given <code>double</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public DoubleHolder(double initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For <code>double</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_double}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_double(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return t_double; + } + + /** + * Write the {@link #value } field to the given stream. + * For <code>double</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_double(double) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_double(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/DoubleSeqHelper.java b/libjava/classpath/org/omg/CORBA/DoubleSeqHelper.java new file mode 100644 index 000000000..6c971b7be --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DoubleSeqHelper.java @@ -0,0 +1,143 @@ +/* DoubleSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA sequence of <code>double</code> + * (<code>DoubleSeq</code>). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class DoubleSeqHelper +{ + /** + * Extract the <code>double[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link DoubleSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link DoubleSeqHolder}. + */ + public static double[] extract(Any a) + { + DoubleSeqHolder h = (DoubleSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>double[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link DoubleSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, double[] that) + { + DoubleSeqHolder holder = new DoubleSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>double[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static double[] read(InputStream input) + { + double[] value = new double[ input.read_long() ]; + input.read_double_array(value, 0, value.length); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>DoubleSeq</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_double); + } + + /** + * Writes the <code>double[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, double[] value) + { + output.write_long(value.length); + output.write_double_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/DoubleSeqHolder.java b/libjava/classpath/org/omg/CORBA/DoubleSeqHolder.java new file mode 100644 index 000000000..5d7fb1aed --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DoubleSeqHolder.java @@ -0,0 +1,126 @@ +/* DoubleSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>DoubleSeq</code> that is mapped into + * java <code>double[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class DoubleSeqHolder + implements Streamable +{ + /** + * The <code>double[]</code> (CORBA <code>DoubleSeq</code>) value, + * held by this DoubleSeqHolder. + */ + public double[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_double); + + /** + * Constructs an instance of DoubleSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public DoubleSeqHolder() + { + } + + /** + * Constructs an instance of DoubleSeqHolder, + * initializing {@link #value} to the given <code>double[]</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public DoubleSeqHolder(double[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.InputStream#read_double_array }. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new double[ input.read_long() ]; + input.read_double_array(value, 0, value.length); + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.OutputStream#write_double_array }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + output.write_double_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/DynAny.java b/libjava/classpath/org/omg/CORBA/DynAny.java new file mode 100644 index 000000000..a49e6c06d --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynAny.java @@ -0,0 +1,507 @@ +/* DynAny.java -- + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.CORBA; + +import org.omg.CORBA.DynAnyPackage.Invalid; +import org.omg.CORBA.DynAnyPackage.InvalidValue; +import org.omg.CORBA.DynAnyPackage.TypeMismatch; + +import java.io.Serializable; + +/** + * The DynAny interface provides possibility to access the components of + * the CORBA object, stored inside the {@link Any}. The {@link Any} itself + * allows to read, write and pass as parameter the stored value without + * knowning its exact data type. 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. + * + * @deprecated by {@link org.omg.DynamicAny.DynAny} + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynAny + extends org.omg.CORBA.Object +{ + /** + * Copy one DynAny into another. + * + * @param from the DynAny to copy from. + * @throws Invalid if the source DynAny is invalid. + */ + void assign(DynAny from) + throws Invalid; + + /** + * Clones this DynAny. + */ + 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>this</code>. + */ + DynAny current_component(); + + /** + * 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. + */ + void from_any(Any an_any) + throws Invalid; + + /** + * Retrieves the {@link Any}, stored inside this DynAny. + * + * @throws TypeMismatch if the typecode of the accessed Any + * is not the same as the typecode of this DynAny. + */ + Any get_any() + throws TypeMismatch; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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. + */ + Object get_reference() + throws TypeMismatch; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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(Object a_x) + throws InvalidValue; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 the enclosed {@link Any}. + * + * @return the enclosed {@link Any}. + */ + Any to_any() + throws Invalid; + + /** + * 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(); +} diff --git a/libjava/classpath/org/omg/CORBA/DynAnyPackage/Invalid.java b/libjava/classpath/org/omg/CORBA/DynAnyPackage/Invalid.java new file mode 100644 index 000000000..cc232c4ea --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynAnyPackage/Invalid.java @@ -0,0 +1,78 @@ +/* Invalid.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.CORBA.DynAnyPackage; + +import java.io.Serializable; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +/** + * This exception is thrown by dynamic any operations when a bad DynAny or Any is passed as a parameter. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class Invalid + extends UserException + implements Serializable, IDLEntity +{ + /** + * Use 1.4 version serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -8258194490767575588L; + + /** + * Creates Invalid without explaining message. + */ + public Invalid() + { + super(); + } + + /** + * Created Invalid exception, providing the explaining message. + * + * @param reason the reason of throwing the exception. + */ + public Invalid(String reason) + { + super(reason); + } +} diff --git a/libjava/classpath/org/omg/CORBA/DynAnyPackage/InvalidSeq.java b/libjava/classpath/org/omg/CORBA/DynAnyPackage/InvalidSeq.java new file mode 100644 index 000000000..0904866ca --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynAnyPackage/InvalidSeq.java @@ -0,0 +1,77 @@ +/* InvalidSeq.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.CORBA.DynAnyPackage; + +import java.io.Serializable; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +/** + * This exception is thrown by by dynamic any operations when a bad <code>sequence</code> is passed as a parameter. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class InvalidSeq + extends UserException + implements Serializable, IDLEntity +{ + /** + * Use 1.4 version serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -5678460771857763522L; + + /** + * Creates InvalidSeq without explaining message. + */ + public InvalidSeq() + { + super(); + } + + /** + * Created InvalidSeq exception, providing the explaining message. + * + * @param reason the reason of throwing the exception. + */ + public InvalidSeq(String reason) + { + super(reason); + } +} diff --git a/libjava/classpath/org/omg/CORBA/DynAnyPackage/InvalidValue.java b/libjava/classpath/org/omg/CORBA/DynAnyPackage/InvalidValue.java new file mode 100644 index 000000000..c2c4394ad --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynAnyPackage/InvalidValue.java @@ -0,0 +1,77 @@ +/* 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.CORBA.DynAnyPackage; + +import java.io.Serializable; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +/** + * This expception in response to insert the inapproriate value into dynamic Any, usually by the DynAny.insert_*(value) method group. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class InvalidValue + extends UserException + implements Serializable, IDLEntity +{ + /** + * Use 1.4 version serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -4741963043279146697L; + + /** + * Creates InvalidValue without explaining message. + */ + public InvalidValue() + { + super(); + } + + /** + * Created InvalidValue exception, providing the explaining message. + * + * @param reason the reason of throwing the exception. + */ + public InvalidValue(String reason) + { + super(reason); + } +} diff --git a/libjava/classpath/org/omg/CORBA/DynAnyPackage/TypeMismatch.java b/libjava/classpath/org/omg/CORBA/DynAnyPackage/TypeMismatch.java new file mode 100644 index 000000000..f1dfd5d41 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynAnyPackage/TypeMismatch.java @@ -0,0 +1,77 @@ +/* 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.CORBA.DynAnyPackage; + +import java.io.Serializable; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +/** + * This exception is thrown by dynamic any accessor methods when type of the actual contents do not match what is trying to be accessed. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class TypeMismatch + extends UserException + implements Serializable, IDLEntity +{ + /** + * Use 1.4 version serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 2763424591181102501L; + + /** + * Creates TypeMismatch without explaining message. + */ + public TypeMismatch() + { + super(); + } + + /** + * Created TypeMismatch exception, providing the explaining message. + * + * @param reason the reason of throwing the exception. + */ + public TypeMismatch(String reason) + { + super(reason); + } +} diff --git a/libjava/classpath/org/omg/CORBA/DynAnyPackage/package.html b/libjava/classpath/org/omg/CORBA/DynAnyPackage/package.html new file mode 100644 index 000000000..f8c476e6f --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynAnyPackage/package.html @@ -0,0 +1,46 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html - describes classes in javax.sql package. + 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.CORBA.TypeCodePackage</title></head> + +<body> +<p>Provides a couple of exceptions, thrown by methods in the <code>TypeCode</code> class.</p> + +</body> +</html> diff --git a/libjava/classpath/org/omg/CORBA/DynArray.java b/libjava/classpath/org/omg/CORBA/DynArray.java new file mode 100644 index 000000000..59901c23b --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynArray.java @@ -0,0 +1,67 @@ +/* DynArray.java -- + Copyright (C) 2005, 2007 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.CORBA; + +import org.omg.CORBA.DynAnyPackage.InvalidSeq; + + +/** + * Represents the {@link DynAny}, holding an array. + * + * @deprecated by {@link org.omg.DynamicAny.DynArray} + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynArray + extends DynAny +{ + /** + * Get the elements of the enclosed array. + */ + Any[] get_elements(); + + /** + * Set the elements from of the enclosed array of Anys. + * + * @throws InvalidSeq if the passed array contains the + * elements of the different type of if the array size mismatch. + */ + void set_elements(Any[] an_array) + throws InvalidSeq; +} diff --git a/libjava/classpath/org/omg/CORBA/DynEnum.java b/libjava/classpath/org/omg/CORBA/DynEnum.java new file mode 100644 index 000000000..e082d3e55 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynEnum.java @@ -0,0 +1,86 @@ +/* DynEnum.java -- + Copyright (C) 2005, 2007 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.CORBA; + + +/** + * Represents the dynamic enumeration, allowing to get/set the value by + * name or by position in the enumeration list. The CORBA enumeration + * can obtain one of the named values from the specified enumeration list. + * + * @deprecated by {@link org.omg.DynamicAny.DynEnum} + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynEnum + extends DynAny +{ + /** + * Get the value of this object. + * @return the currently set value, one of the allowed values + * for this enumeration. + */ + String value_as_string(); + + /** + * Set the value of this object. + * + * @param member the value to set, must be one of the allowed values for + * this enumeration. Otherwise the {@link SystemException} may be thrown. + */ + void value_as_string(String member); + + /** + * Set the value of this object as the position inside the list of this + * enumeration. + * + * @param member the position of the enumeration value inside + * the enumeration list. Otherwise the {@link SystemException} may be thrown. + */ + void value_as_ulong(int member); + + /** + * Get the value of this object as the position inside the list of this + * enumeration. + * + * @return member the position of the currently set enumeration value inside + * the enumeration list. + */ + int value_as_ulong(); +} diff --git a/libjava/classpath/org/omg/CORBA/DynFixed.java b/libjava/classpath/org/omg/CORBA/DynFixed.java new file mode 100644 index 000000000..0faded9ed --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynFixed.java @@ -0,0 +1,79 @@ +/* DynFixed.java -- + Copyright (C) 2005, 2007 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.CORBA; + +import org.omg.CORBA.DynAnyPackage.InvalidValue; + +/** + * Represents a CORBA <code>fixed</code>, allowing to get and set its value + * in the form of the binary representation. + * + * The format, described in CORBA specification, requires to store + * data in hexadecimal format, two digits per byte (oceted), most + * significant digit first. The last half-byte in the representation + * stores the sign, being 0xD for negative numbers and 0xC for + * zero and positive numbers. To have the even number of half bytes, + * 0x0 is appended to the beginning, if required. The position of the + * decimal point is not stored. + * + * @see gnu.CORBA.BigDecimalHelper + * + * @deprecated by {@link org.omg.DynamicAny.DynFixed} + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynFixed + extends DynAny +{ + /** + * Get the value of this DynFixed in the binary form. + * + * @return the binary representation, defined in the header comment. + */ + byte[] get_value(); + + /** + * Sets the value of this DynFixed from the binary representation. + * + * @param a_value the byte array, representing a CORBA <code>fixed</code>, + * as defined in the header comment. + */ + void set_value(byte[] a_value) + throws InvalidValue; +} diff --git a/libjava/classpath/org/omg/CORBA/DynSequence.java b/libjava/classpath/org/omg/CORBA/DynSequence.java new file mode 100644 index 000000000..addaac856 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynSequence.java @@ -0,0 +1,80 @@ +/* DynSequence.java -- + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.CORBA; + +import org.omg.CORBA.DynAnyPackage.InvalidSeq; + +/** + * Represents the {@link DynAny}, holding the CORBA sequence + * (an array with the flexible length). + * + * @deprecated by {@link org.omg.DynamicAny.DynSequence} + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynSequence + extends DynAny +{ + /** + * Get the elements of the enclosed sequence. + */ + Any[] get_elements(); + + /** + * Returns the number of elements, stored in the sequence. + * @return the length of the sequence + */ + int length(); + + /** + * Sets the length of this sequence to the given value. + * + * @param l the new length of the sequence. + */ + void length(int l); + + /** + * Set the elements from of the enclosed array of Anys. + * + * @throws InvalidSeq if the passed array contains the + * elements of the different type. + */ + void set_elements(Any[] an_array) + throws InvalidSeq; +} diff --git a/libjava/classpath/org/omg/CORBA/DynStruct.java b/libjava/classpath/org/omg/CORBA/DynStruct.java new file mode 100644 index 000000000..e292e99f1 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynStruct.java @@ -0,0 +1,91 @@ +/* DynStruct.java -- + Copyright (C) 2005, 2007 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.CORBA; + +import org.omg.CORBA.DynAnyPackage.InvalidSeq; + +/** + * Represents the {@link DynAny}, holding the CORBA structure (record + * with the named fields). The internal reference, described in + * {@link DynAny#current_component()}, iterates over the fields of the + * structure. + * + * @deprecated by {@link org.omg.DynamicAny.DynStruct} + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynStruct + extends DynAny +{ +/** + * Get the kind of the structure field that would be returned by + * {@link DynAny#current_component()}. + * + * @return the kind of the structure field. + */ + TCKind current_member_kind(); + + /** + * Get the name of the structure field that would be returned by + * {@link DynAny#current_component()}. + * + * @return the name of the structure field. + */ + String current_member_name(); + + /** + * Get all fields of the structure in the array of the named values, + * holding name, repository id and value of the associated field. + * + * @return members the array of the named values, + * representing the structure fields. + */ + NameValuePair[] get_members(); + + /** + * Set all fields of this structure by name. + * + * @param members the array of the named values, + * representing the structure fields. + * + * @throws InvalidSeq if the passed argument is invalid. + */ + void set_members(NameValuePair[] members) + throws InvalidSeq; +} diff --git a/libjava/classpath/org/omg/CORBA/DynUnion.java b/libjava/classpath/org/omg/CORBA/DynUnion.java new file mode 100644 index 000000000..2712cc838 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynUnion.java @@ -0,0 +1,101 @@ +/* DynUnion.java -- + Copyright (C) 2005, 2007 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.CORBA; + + +/** + * Represents the {@link DynAny}, holding the CORBA structure (variant record + * with the named fields). The internal reference, described in + * {@link DynAny#current_component()}, iterates over the fields of the + * member, stored in the union. The union always holds only one member; + * which one, depends from the value of the discriminator. + * + * @deprecated by {@link org.omg.DynamicAny.DynUnion} + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynUnion + extends DynAny +{ + /** + * Returns the discriminator, defining, which set of fields is stored. + * @return the discriminator. + */ + DynAny discriminator(); + + /** + * Returns the discriminator kind. + */ + TCKind discriminator_kind(); + + /** + * Returns the member, stored in this union. + */ + DynAny member(); + + /** + * Returns the kind of the member, stored in this union. + */ + TCKind member_kind(); + + /** + * Returns the name of the currently focused member. + */ + String member_name(); + + /** + * Renames the currently focused member. + * + * @param new_name the new name of the currently focused member. + */ + void member_name(String new_name); + + /** + * Checks if the discriminator of this union has been assigned a valid + * default value. + */ + boolean set_as_default(); + + /** + * Determines if the discriminator of this union gets assigned a valid + * default value. + * @param assign_default + */ + void set_as_default(boolean assign_default); +} diff --git a/libjava/classpath/org/omg/CORBA/DynValue.java b/libjava/classpath/org/omg/CORBA/DynValue.java new file mode 100644 index 000000000..a23cd1a7f --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynValue.java @@ -0,0 +1,90 @@ +/* DynValue.java -- + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.CORBA; + +import org.omg.CORBA.DynAnyPackage.InvalidSeq; + +/** + * Represents the {@link DynAny}, holding a value type. + * + * A value type is something between CORBA structure and CORBA object. + * Like CORBA object, it can have methods, supporting some IDL-defined + * interface. However, like structures, they are always local and passed by + * value, not by IOR reference. + * + * The value types can have both public and private members. They support + * inheritance. Value types can also be abstract. + * + * @deprecated by {@link org.omg.DynamicAny.DynValue} + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DynValue + extends DynAny, org.omg.CORBA.Object +{ + /** + * Get the kind of the member, pointed by the internal pointer. + * + * @return the kind of the member. + */ + TCKind current_member_kind(); + + /** + * Get the name of the member, pointed by the internal pointer. + * + * @return the name of the member. + */ + String current_member_name(); + + /** + * Get all members of the enclosed value type object. + * @return members, as an array of the name - value pairs. + */ + NameValuePair[] get_members(); + + /** + * Set all members for the enclosed value type object. + * + * @param value an array of members to set. + * + * @throws InvalidSeq if the passed sequence is not valid. + */ + void set_members(NameValuePair[] value) + throws InvalidSeq; +} diff --git a/libjava/classpath/org/omg/CORBA/DynamicImplementation.java b/libjava/classpath/org/omg/CORBA/DynamicImplementation.java new file mode 100644 index 000000000..40c800798 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/DynamicImplementation.java @@ -0,0 +1,178 @@ +/* DynamicImplementation.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.CORBA; + +import gnu.CORBA.Unexpected; +import gnu.CORBA.gnuAny; +import gnu.CORBA.gnuNVList; + +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.CORBA.portable.OutputStream; + +/** + * This class was probably originally thinked as a base of all CORBA + * object implementations. However the code, generated by IDL to + * java compilers almost never use it, preferring to derive the + * object implementation bases directly from the {@link ObjectImpl}. + * The class has become deprecated since the 1.4 release. + * + * @deprecated since 1.4. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class DynamicImplementation + extends ObjectImpl +{ + /** + * Invoke the method of the CORBA object. After converting the parameters, + * this method delegates call to the {@link ObjectImpl#_invoke}. + * + * @deprecated since 1.4. + * + * @param request the container for both passing and returing the parameters, + * also contains the method name and thrown exceptions. + */ + public void invoke(ServerRequest request) + { + Request r = _request(request.operation()); + + // Copy the parameters. + NVList args = new gnuNVList(); + request.arguments(args); + NamedValue v; + int i = 0; + + try + { + // Set the arguments. + for (i = 0; i < args.count(); i++) + { + v = args.item(i); + Any n; + OutputStream out; + + switch (v.flags()) + { + case ARG_IN.value: + out = v.value().create_output_stream(); + v.value().write_value(out); + n = r.add_named_in_arg(v.name()); + n.read_value(out.create_input_stream(), v.value().type()); + break; + case ARG_INOUT.value: + out = v.value().create_output_stream(); + v.value().write_value(out); + n = r.add_named_inout_arg(v.name()); + n.read_value(out.create_input_stream(), v.value().type()); + break; + case ARG_OUT.value: + r.add_named_out_arg(v.name()); + break; + + default: + throw new InternalError("Invalid flags " + v.flags()); + } + } + } + catch (Bounds b) + { + throw new Unexpected(args.count() + "[" + i + "]", b); + } + + // Set context. + r.ctx(request.ctx()); + + // Set the return type (expects that the ServerRequest will initialise + // the passed Any. + + gnuAny g = new gnuAny(); + request.result(g); + r.set_return_type(g.type()); + + // Invoke the method. + r.invoke(); + + // Transfer the returned values. + NVList r_args = r.arguments(); + + try + { + // API states that the ServerRequest.arguments must be called only + // once. Hence we assume we can just modify the previously returned + // value <code>args</code>, and the ServerRequest will preserve the + // reference. + for (i = 0; i < args.count(); i++) + { + v = args.item(i); + + if (v.flags() == ARG_OUT.value || v.flags() == ARG_INOUT.value) + { + OutputStream out = r_args.item(i).value().create_output_stream(); + r_args.item(i).value().write_value(out); + v.value().read_value(out.create_input_stream(), + v.value().type()); + } + } + } + catch (Bounds b) + { + throw new Unexpected(args.count() + "[" + i + "]", b); + } + + // Set the returned result (if any). + NamedValue returns = r.result(); + if (returns != null) + request.set_result(returns.value()); + } + + /** + * Returns the array of the repository ids, supported by this object. + * In this implementation, the method must be overrridden to return + * a sendible object-specific information. The default method returns + * an empty array. + * + * @deprecated since 1.4. + * + * @return the empty array, always. + */ + public String[] _ids() + { + return new String[ 0 ]; + } +} diff --git a/libjava/classpath/org/omg/CORBA/Environment.java b/libjava/classpath/org/omg/CORBA/Environment.java new file mode 100644 index 000000000..fab77c7ec --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/Environment.java @@ -0,0 +1,70 @@ +/* Environment.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.CORBA; + + +/** + * A container for an exception, that has been thrown by the method + * of the CORBA object. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class Environment +{ + /** + * Removes the exception object from this container. + */ + public abstract void clear(); + + /** + * Returns an exception, enclosed in this container. + * + * @return the enclosed exception or null if no any + * exception has been thrown or {@link #clear()} + * has been previously called. + */ + public abstract Exception exception(); + + /** + * Inserts the given exception into this container. + * + * @param except the exception to insert. + */ + public abstract void exception(Exception except); +} diff --git a/libjava/classpath/org/omg/CORBA/ExceptionList.java b/libjava/classpath/org/omg/CORBA/ExceptionList.java new file mode 100644 index 000000000..0a834344d --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ExceptionList.java @@ -0,0 +1,73 @@ +/* ExceptionList.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.CORBA; + +/** + * Stores exceptions that can be thrown when invoking a method of an + * CORBA {@link org.omg.CORBA.Object}. + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org). + */ +public abstract class ExceptionList +{ + /** + * Add the typecode of the given exception to the list. + */ + public abstract void add(TypeCode an_exception); + + /** + * Get the number of the stored exceptions. + */ + public abstract int count(); + + /** + * Get the item at the given position. + * @param at the index + * @throws Bounds if the index is out of range. + */ + public abstract TypeCode item(int at) + throws Bounds; + + /** + * Remove the item at the given position. + * @param at the index + * @throws Bounds if the index is out of range. + */ + public abstract void remove(int at) + throws Bounds; +} diff --git a/libjava/classpath/org/omg/CORBA/FREE_MEM.java b/libjava/classpath/org/omg/CORBA/FREE_MEM.java new file mode 100644 index 000000000..ac656c0fa --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/FREE_MEM.java @@ -0,0 +1,96 @@ +/* FREE_MEM.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.CORBA; + +import java.io.Serializable; + +/** + * Means errors, related to freeing the allocated memory. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class FREE_MEM + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -1333559476995791982L; + + /** + * Creates a FREE_MEM with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public FREE_MEM(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates FREE_MEM with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public FREE_MEM() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a FREE_MEM exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public FREE_MEM(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created FREE_MEM exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public FREE_MEM(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/FieldNameHelper.java b/libjava/classpath/org/omg/CORBA/FieldNameHelper.java new file mode 100644 index 000000000..276105eec --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/FieldNameHelper.java @@ -0,0 +1,116 @@ +/* FieldNameHelper.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.CORBA; + +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 formal helper for the CORBA FieldName that is identical to the + * narrow string. + * + * @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 string alias typecode, named "FieldName". + */ + 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/CORBA/FieldName:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/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/CORBA/FixedHolder.java b/libjava/classpath/org/omg/CORBA/FixedHolder.java new file mode 100644 index 000000000..a44cde52d --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/FixedHolder.java @@ -0,0 +1,125 @@ +/* FixedHolder.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.CORBA; + +import gnu.CORBA.typecodes.FixedTypeCode; + +import java.math.BigDecimal; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for CORBA <code>fixed</code> that is mapped into + * java <code>BigDecimal</code>. + * + * The holders have several application areas. The end user usually + * sees them implementing CORBA methods where the primitive type + * is passed by reference. While CORBA (or, for example, C) supports + * this, the java does not and a wrapper class is required. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class FixedHolder + implements Streamable +{ + /** + * The <code>BigDecimal</code> (CORBA <code>fixed</code>) value, + * held by this FixedHolder. + */ + public BigDecimal value; + + /** + * Constructs an instance of FixedHolder, + * initializing {@link #value} to <code>null</code>. + */ + public FixedHolder() + { + } + + /** + * Constructs an instance of FixedHolder, + * initializing {@link #value} to the given <code>BigDecimal</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public FixedHolder(BigDecimal initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For <code>fixed</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_fixed}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_fixed(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. The scale and digits are set corresponding + * the scale and used digits of the value that is currently stored + * or left with default value 0 if the value is not set. + */ + public TypeCode _type() + { + return new FixedTypeCode(value); + } + + /** + * Write the {@link #value } field to the given stream. + * For <code>fixed</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_fixed(BigDecimal) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_fixed(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/FloatHolder.java b/libjava/classpath/org/omg/CORBA/FloatHolder.java new file mode 100644 index 000000000..8d765ced3 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/FloatHolder.java @@ -0,0 +1,127 @@ +/* FloatHolder.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.CORBA; + +import gnu.CORBA.typecodes.PrimitiveTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for CORBA <code>float</code> that is mapped into + * java <code>float</code>. + * + * The holders have several application areas. The end user usually + * sees them implementing CORBA methods where the primitive type + * is passed by reference. While CORBA (or, for example, C) supports + * this, the java does not and a wrapper class is required. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class FloatHolder + implements Streamable +{ + /** + * The default type code for this holder. + */ + private static final TypeCode t_float = + new PrimitiveTypeCode(TCKind.tk_float); + + /** + * The <code>float</code> (CORBA <code>float</code>) value, + * held by this FloatHolder. + */ + public float value; + + /** + * Constructs an instance of FloatHolder, + * initializing {@link #value} to <code>0.0</code>. + */ + public FloatHolder() + { + } + + /** + * Constructs an instance of FloatHolder, + * initializing {@link #value} to the given <code>float</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public FloatHolder(float initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For <code>float</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_float}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_float(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return t_float; + } + + /** + * Write the {@link #value } field to the given stream. + * For <code>float</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_float(float) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_float(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/FloatSeqHelper.java b/libjava/classpath/org/omg/CORBA/FloatSeqHelper.java new file mode 100644 index 000000000..10850e022 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/FloatSeqHelper.java @@ -0,0 +1,143 @@ +/* FloatSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA sequence of <code>float</code> + * (<code>FloatSeq</code>). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class FloatSeqHelper +{ + /** + * Extract the <code>float[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link FloatSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link FloatSeqHolder}. + */ + public static float[] extract(Any a) + { + FloatSeqHolder h = (FloatSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>float[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link FloatSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, float[] that) + { + FloatSeqHolder holder = new FloatSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>float[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static float[] read(InputStream input) + { + float[] value = new float[ input.read_long() ]; + input.read_float_array(value, 0, value.length); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>FloatSeq</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_float); + } + + /** + * Writes the <code>float[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, float[] value) + { + output.write_long(value.length); + output.write_float_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/FloatSeqHolder.java b/libjava/classpath/org/omg/CORBA/FloatSeqHolder.java new file mode 100644 index 000000000..b7e8efcc0 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/FloatSeqHolder.java @@ -0,0 +1,126 @@ +/* FloatSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>FloatSeq</code> that is mapped into + * java <code>float[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class FloatSeqHolder + implements Streamable +{ + /** + * The <code>float[]</code> (CORBA <code>FloatSeq</code>) value, + * held by this FloatSeqHolder. + */ + public float[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_float); + + /** + * Constructs an instance of FloatSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public FloatSeqHolder() + { + } + + /** + * Constructs an instance of FloatSeqHolder, + * initializing {@link #value} to the given <code>float[]</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public FloatSeqHolder(float[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.InputStream#read_float_array }. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new float[ input.read_long() ]; + input.read_float_array(value, 0, value.length); + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.OutputStream#write_float_array }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + output.write_float_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/IDLType.java b/libjava/classpath/org/omg/CORBA/IDLType.java new file mode 100644 index 000000000..74c10549f --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/IDLType.java @@ -0,0 +1,55 @@ +/* IDLType.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.CORBA; + +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * An abstract interface + * that represent OMG IDL types. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface IDLType + extends IDLTypeOperations, IRObject, IDLEntity, org.omg.CORBA.Object, + Serializable +{ +} diff --git a/libjava/classpath/org/omg/CORBA/IDLTypeHelper.java b/libjava/classpath/org/omg/CORBA/IDLTypeHelper.java new file mode 100644 index 000000000..fa8d71dd3 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/IDLTypeHelper.java @@ -0,0 +1,128 @@ +/* IDLTypeHelper.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.CORBA; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.portable.Delegate; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.CORBA.portable.OutputStream; + +/** + * A helper operations for the IDL type. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class IDLTypeHelper +{ + /** + * Insert the IDL type into the given Any. + */ + public static void insert(Any a, IDLType that) + { + OutputStream out = a.create_output_stream(); + a.type(type()); + write(out, that); + a.read_value(out.create_input_stream(), type()); + } + + /** + * Extract the IDL type from the given Any. + */ + public static IDLType extract(Any a) + { + return read(a.create_input_stream()); + } + + /** + * Get the typecode of the IDL type (the interface typecode, name "IDLType"). + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.create_interface_tc(IDLTypeHelper.id(), + "IDLType"); + } + + /** + * Return the IDLType repository id. + * + * @return "IDL:omg.org/CORBA/IDLType:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/IDLType:1.0"; + } + + /** + * Read the IDL type from the given input stream. + * The method reads an object and narrows into IDL type using this + * helper. + */ + public static IDLType read(InputStream istream) + { + return narrow(istream.read_Object()); + } + + /** + * Write the IDL type to the output stream (as CORBA object). + */ + public static void write(OutputStream ostream, IDLType value) + { + ostream.write_Object((org.omg.CORBA.Object) value); + } + + /** + * Narrows the CORBA object into the IDL type. + */ + public static IDLType narrow(org.omg.CORBA.Object obj) + { + if (obj == null) + return null; + else if (obj instanceof IDLType) + return (IDLType) obj; + else if (!obj._is_a(id())) + throw new org.omg.CORBA.BAD_PARAM(); + else + { + Delegate delegate = ((ObjectImpl) obj)._get_delegate(); + return new _IDLTypeStub(delegate); + } + } +} diff --git a/libjava/classpath/org/omg/CORBA/IDLTypeOperations.java b/libjava/classpath/org/omg/CORBA/IDLTypeOperations.java new file mode 100644 index 000000000..1389167ed --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/IDLTypeOperations.java @@ -0,0 +1,56 @@ +/* IDLTypeOperations.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. */ + + +/** + * Defines operations, applicable for the IDL type. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +package org.omg.CORBA; + +public interface IDLTypeOperations + extends IRObjectOperations +{ + /** + * Get the type code of the interface repository object. + * + * @return the data structure, describing the type of the object, stored in + * the repository. + */ + TypeCode type(); +} diff --git a/libjava/classpath/org/omg/CORBA/IMP_LIMIT.java b/libjava/classpath/org/omg/CORBA/IMP_LIMIT.java new file mode 100644 index 000000000..5fda9276d --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/IMP_LIMIT.java @@ -0,0 +1,97 @@ +/* IMP_LIMIT.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the server has reached some implementation limit + * (too many clients, too many references, too long parameters and so on). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class IMP_LIMIT + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -8086463494577448422L; + + /** + * Creates a IMP_LIMIT with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public IMP_LIMIT(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates IMP_LIMIT with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public IMP_LIMIT() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a IMP_LIMIT exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public IMP_LIMIT(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created IMP_LIMIT exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public IMP_LIMIT(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/INITIALIZE.java b/libjava/classpath/org/omg/CORBA/INITIALIZE.java new file mode 100644 index 000000000..ac07b3f5c --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/INITIALIZE.java @@ -0,0 +1,96 @@ +/* INITIALIZE.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the server cannot be initialized because of the some reason. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class INITIALIZE + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -3753094599663690309L; + + /** + * Creates a INITIALIZE with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public INITIALIZE(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates INITIALIZE with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public INITIALIZE() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a INITIALIZE exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public INITIALIZE(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created INITIALIZE exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public INITIALIZE(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/INTERNAL.java b/libjava/classpath/org/omg/CORBA/INTERNAL.java new file mode 100644 index 000000000..74478e7c6 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/INTERNAL.java @@ -0,0 +1,96 @@ +/* INTERNAL.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.CORBA; + +import java.io.Serializable; + +/** + * Means an internal failure in the ORB. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class INTERNAL + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 3771336866139357605L; + + /** + * Creates a INTERNAL with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public INTERNAL(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates INTERNAL with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public INTERNAL() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a INTERNAL exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public INTERNAL(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created INTERNAL exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public INTERNAL(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/INTF_REPOS.java b/libjava/classpath/org/omg/CORBA/INTF_REPOS.java new file mode 100644 index 000000000..7c65dc1f2 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/INTF_REPOS.java @@ -0,0 +1,96 @@ +/* INTF_REPOS.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.CORBA; + +import java.io.Serializable; + +/** + * Means errors, related to the interface repository. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class INTF_REPOS + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 722572694720671863L; + + /** + * Creates a INTF_REPOS with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public INTF_REPOS(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates INTF_REPOS with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public INTF_REPOS() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a INTF_REPOS exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public INTF_REPOS(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created INTF_REPOS exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public INTF_REPOS(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/INVALID_ACTIVITY.java b/libjava/classpath/org/omg/CORBA/INVALID_ACTIVITY.java new file mode 100644 index 000000000..eb4f69af1 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/INVALID_ACTIVITY.java @@ -0,0 +1,100 @@ +/* INVALID_ACTIVITY.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.CORBA; + +import java.io.Serializable; + +/** + * Raised when the transaction or Activity is resumed in a different context + * than from which it was suspended. It is also raised when the invocation is + * not incompatible with the Activity's current state. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class INVALID_ACTIVITY + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID (v1.5) for interoperability. + */ + private static final long serialVersionUID = 7907846629733712546L; + + /** + * Creates INVALID_ACTIVITY with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public INVALID_ACTIVITY(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates INVALID_ACTIVITY with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public INVALID_ACTIVITY() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a INVALID_ACTIVITY exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public INVALID_ACTIVITY(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created INVALID_ACTIVITY exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public INVALID_ACTIVITY(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/INVALID_TRANSACTION.java b/libjava/classpath/org/omg/CORBA/INVALID_TRANSACTION.java new file mode 100644 index 000000000..ed39311cf --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/INVALID_TRANSACTION.java @@ -0,0 +1,96 @@ +/* INVALID_TRANSACTION.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.CORBA; + +import java.io.Serializable; + +/** + * Means that request carried an invalid transaction context. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class INVALID_TRANSACTION + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -4265126403821571697L; + + /** + * Creates a INVALID_TRANSACTION with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public INVALID_TRANSACTION(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates INVALID_TRANSACTION with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public INVALID_TRANSACTION() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a INVALID_TRANSACTION exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public INVALID_TRANSACTION(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created INVALID_TRANSACTION exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public INVALID_TRANSACTION(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/INV_FLAG.java b/libjava/classpath/org/omg/CORBA/INV_FLAG.java new file mode 100644 index 000000000..6f6f6333e --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/INV_FLAG.java @@ -0,0 +1,96 @@ +/* INV_FLAG.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.CORBA; + +import java.io.Serializable; + +/** + * Means invalid flag, passed during operation. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class INV_FLAG + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -4863924749863817671L; + + /** + * Creates a INV_FLAG with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public INV_FLAG(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates INV_FLAG with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public INV_FLAG() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a INV_FLAG exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public INV_FLAG(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created INV_FLAG exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public INV_FLAG(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/INV_IDENT.java b/libjava/classpath/org/omg/CORBA/INV_IDENT.java new file mode 100644 index 000000000..ae1de4fe8 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/INV_IDENT.java @@ -0,0 +1,96 @@ +/* INV_IDENT.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.CORBA; + +import java.io.Serializable; + +/** + * Means that some IDL identifier has a wrong syntax. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class INV_IDENT + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 4399295047946553530L; + + /** + * Creates a INV_IDENT with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public INV_IDENT(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates INV_IDENT with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public INV_IDENT() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a INV_IDENT exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public INV_IDENT(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created INV_IDENT exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public INV_IDENT(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/INV_OBJREF.java b/libjava/classpath/org/omg/CORBA/INV_OBJREF.java new file mode 100644 index 000000000..ef12b3cdc --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/INV_OBJREF.java @@ -0,0 +1,96 @@ +/* INV_OBJREF.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.CORBA; + +import java.io.Serializable; + +/** + * Means that some object reference is internally malformed. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class INV_OBJREF + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -7238811948257685034L; + + /** + * Creates a INV_OBJREF with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public INV_OBJREF(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates INV_OBJREF with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public INV_OBJREF() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a INV_OBJREF exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public INV_OBJREF(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created INV_OBJREF exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public INV_OBJREF(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/INV_POLICY.java b/libjava/classpath/org/omg/CORBA/INV_POLICY.java new file mode 100644 index 000000000..45ef7ab07 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/INV_POLICY.java @@ -0,0 +1,98 @@ +/* INV_POLICY.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.CORBA; + +import java.io.Serializable; + +/** + * This exception is thrown when an invocation cannot be made because of + * an incompatibility between Policy overrides that apply to the + * particular invocation. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class INV_POLICY + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -7823113107689030975L; + + /** + * Creates a INV_POLICY with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public INV_POLICY(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates INV_POLICY with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public INV_POLICY() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a INV_POLICY exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public INV_POLICY(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created INV_POLICY exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public INV_POLICY(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/IRObject.java b/libjava/classpath/org/omg/CORBA/IRObject.java new file mode 100644 index 000000000..b0750089c --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/IRObject.java @@ -0,0 +1,53 @@ +/* IRObject.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.CORBA; + +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Represents the interface repository object. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IRObject + extends IRObjectOperations, org.omg.CORBA.Object, Serializable, IDLEntity +{ +} diff --git a/libjava/classpath/org/omg/CORBA/IRObjectOperations.java b/libjava/classpath/org/omg/CORBA/IRObjectOperations.java new file mode 100644 index 000000000..40e936947 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/IRObjectOperations.java @@ -0,0 +1,68 @@ +/* IRObjectOperations.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.CORBA; + + +/** + * Defines the operations, applicable to the interface repository object. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IRObjectOperations { + /** + * Get the definition kind of this interface repository object. + * + * @return the defintion kind (one of the DefinitionKind.dk_... + * constants). + */ + DefinitionKind def_kind(); + + /** + * Destroy this interface repository object. If the object is a container, + * the method applies to all its contents. If the object is part of some + * other object, it is removed. + * + * @throws BAD_INV_ORDER, minor code 1, if destroying this object would + * leave the repository in an incoherent state. + * + * @throws BAD_INV_ORDER, minor code 2, if the method is invoked on the + * Repository or on the definition of the primitive type. + */ + void destroy() throws BAD_INV_ORDER; + +} diff --git a/libjava/classpath/org/omg/CORBA/IdentifierHelper.java b/libjava/classpath/org/omg/CORBA/IdentifierHelper.java new file mode 100644 index 000000000..644a3eb4e --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/IdentifierHelper.java @@ -0,0 +1,116 @@ +/* IdentifierHelper.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.CORBA; + +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 formal helper for the CORBA Identifier that is identical to the + * narrow string. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class IdentifierHelper +{ + /** + * Insert the Identifier 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 Identifier 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 string alias typecode, named "Identifier". + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "Identifier", orb.create_string_tc(0)); + } + + /** + * Return the Identifier repository id. + * @return "IDL:omg.org/CORBA/Identifier:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/Identifier: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 (Identifier) value to write. + */ + public static void write(OutputStream ostream, String value) + { + ostream.write_string(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/IntHolder.java b/libjava/classpath/org/omg/CORBA/IntHolder.java new file mode 100644 index 000000000..a27cf435c --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/IntHolder.java @@ -0,0 +1,126 @@ +/* IntHolder.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.CORBA; + +import gnu.CORBA.typecodes.PrimitiveTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for CORBA <code>long</code> that is mapped into + * java <code>int</code>. + * + * The holders have several application areas. The end user usually + * sees them implementing CORBA methods where the primitive type + * is passed by reference. While CORBA (or, for example, C) supports + * this, the java does not and a wrapper class is required. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class IntHolder + implements Streamable +{ + /** + * The default type code for this holder. + */ + private static final TypeCode t_long = new PrimitiveTypeCode(TCKind.tk_long); + + /** + * The <code>int</code> (CORBA <code>long</code>) value, + * held by this IntHolder. + */ + public int value; + + /** + * Constructs an instance of IntHolder, + * initializing {@link #value} to <code>0</code>. + */ + public IntHolder() + { + } + + /** + * Constructs an instance of IntHolder, + * initializing {@link #value} to the given <code>int</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public IntHolder(int initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For <code>long</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_long}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_long(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return t_long; + } + + /** + * Write the {@link #value } field to the given stream. + * For <code>long</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_long(int) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/LocalObject.java b/libjava/classpath/org/omg/CORBA/LocalObject.java new file mode 100644 index 000000000..60436ee35 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/LocalObject.java @@ -0,0 +1,364 @@ +/* LocalObject.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.CORBA; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.Context; +import org.omg.CORBA.ContextList; +import org.omg.CORBA.DomainManager; +import org.omg.CORBA.ExceptionList; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.NVList; +import org.omg.CORBA.NamedValue; +import org.omg.CORBA.Policy; +import org.omg.CORBA.Request; +import org.omg.CORBA.SetOverrideType; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; +import org.omg.CORBA.portable.ServantObject; + +import javax.rmi.CORBA.Util; + +/** + * An object, formally implementing the CORBA {@link Object}, but actually + * handling all invocations locally. + * Various calls to the remote object specific methods throw the + * {@link NO_IMPLEMENT}. The explaining message for this exception is + * specified in java API as <code>"This is a locally constrained object."</code>. + * It is not possible to get a stringified reference of the local object, or + * invoke a method using DII (by name via {@link Request} class). + * + * However narrowing and widening methods will work with local objects. + * + * @since 1.4 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class LocalObject + implements org.omg.CORBA.Object +{ + /** + * The explaining message for the exception, thrown in response to call + * the method, not appropriate for the local object. + */ + private static final String INAPPROPRIATE = + "This is a locally constrained object."; + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public Request _create_request(Context context, String operation, + NVList parameters, NamedValue returns + ) + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public Request _create_request(Context context, String operation, + NVList parameters, NamedValue returns, + ExceptionList exceptions, ContextList ctx_list + ) + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public org.omg.CORBA.Object _duplicate() + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public DomainManager[] _get_domain_managers() + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public org.omg.CORBA.Object _get_interface_def() + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public org.omg.CORBA.Object _get_interface() + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public Policy _get_policy(int a_policy_type) + throws BAD_PARAM + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * {@inheritDoc} + */ + public int _hash(int maximum) + { + return Math.abs(hashCode()) % maximum; + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public boolean _is_a(String repositoryIdentifer) + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * Determines if the object is equal to another object, so far as it is + * possible to determine easily. + * + * @param other the other object. + * + * @return true if the pased object is not null and + * java.lang.Object.equals(other) returns true. False otherwise. + */ + public boolean _is_equivalent(org.omg.CORBA.Object other) + { + if (other != null) + if (other.equals(this)) + return true; + + return false; + } + + /** + * Always returs false. + * + * @return false, always. + */ + public boolean _non_existent() + { + return false; + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public void _release() + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @specnote it is possible to implement a local handling of the _request(), + * but the API clearly states that NO_IMPLEMENT + * must be thrown instead. + * + * @throws NO_IMPLEMENT, always. + */ + public Request _request(String operation) + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public org.omg.CORBA.Object _set_policy_override(Policy[] policies, + SetOverrideType how + ) + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * This method is called from <code>rmic</code> generated stubs if the + * {@link Util#isLocal}, called passing <code>this</code> as parameter, + * returns true. If the method returns null, the requested method is then + * invoked on <code>this</code>. Else it is invoked on the returned object, + * casting it into the interface that the local object implements. In this + * case, the generated stub also later calls + * {@link #_servant_postinvoke(ServantObject)}, passing that returned target + * as parameter. + * + * @param operation the name of the method being invoked. + * @param expectedType the interface that the returned servant + * object must implement. + * + * @throws NO_IMPLEMENT always. If used, the method must be overridden. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + public ServantObject _servant_preinvoke(String operation, Class expectedType) + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + + /** + * This method is called from <code>rmic</code> generated stubs if the + * {@link Util#isLocal}, called passing <code>this</code> as parameter, + * returns true, and the {@link #_servant_preinvoke} return non-null object. + * The stub then invokes the requrested method on that returned object and + * later calls _servant_postinvoke, passing that returned target as parameter. + * + * @param servant the object that has served as the invocation target for the + * current operation. + */ + public void _servant_postinvoke(ServantObject servant) + { + } + + /** + * Invokes the operation. This method takes the OutputStream that was previously + * returned by a {@link #_request(String)} and returns an InputStream which + * contains the reply. Up till jdk 1.5 inclusive this method is marked as + * unimplemented. + * + * @throws NO_IMPLEMENT always. + */ + public InputStream _invoke(OutputStream output) + throws ApplicationException, RemarshalException + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * While it may look that this should return true, the jdk 1.5 API states + * that it must throw NO_IMPLEMENT instead. The rmi stubs do not call this + * method to check if the object is local; they call {@link Util#isLocal} + * instead (passing <code>this</code> as parameter). + * + * @return never. + * + * @throws NO_IMPLEMENT always. + */ + public boolean _is_local() + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public ORB _orb() + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public void _releaseReply(InputStream input) + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public OutputStream _request(String operation, boolean responseExpected) + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } + + /** + * This method is not appropriate for the local objects and just + * throws an exception. + * + * @throws NO_IMPLEMENT, always. + */ + public boolean validate_connection() + { + throw new NO_IMPLEMENT(INAPPROPRIATE); + } +} diff --git a/libjava/classpath/org/omg/CORBA/LongHolder.java b/libjava/classpath/org/omg/CORBA/LongHolder.java new file mode 100644 index 000000000..db412d969 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/LongHolder.java @@ -0,0 +1,127 @@ +/* LongHolder.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.CORBA; + +import gnu.CORBA.typecodes.PrimitiveTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for CORBA <code>long long</code> that is mapped into + * java <code>long</code>. + * + * The holders have several application areas. The end user usually + * sees them implementing CORBA methods where the primitive type + * is passed by reference. While CORBA (or, for example, C) supports + * this, the java does not and a wrapper class is required. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class LongHolder + implements Streamable +{ + /** + * The default type code for this holder. + */ + private static final TypeCode t_longlong = + new PrimitiveTypeCode(TCKind.tk_longlong); + + /** + * The <code>long</code> (CORBA <code>long long</code>) value, + * held by this LongHolder. + */ + public long value; + + /** + * Constructs an instance of LongHolder, + * initializing {@link #value} to <code>0 </code>. + */ + public LongHolder() + { + } + + /** + * Constructs an instance of LongHolder, + * initializing {@link #value} to the given <code>long</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public LongHolder(long initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For <code>long long</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_longlong}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_longlong(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return t_longlong; + } + + /** + * Write the {@link #value } field to the given stream. + * For <code>long long</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_longlong(long) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_longlong(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/LongLongSeqHelper.java b/libjava/classpath/org/omg/CORBA/LongLongSeqHelper.java new file mode 100644 index 000000000..1ba58d5d3 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/LongLongSeqHelper.java @@ -0,0 +1,143 @@ +/* LongLongSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA sequence of <code>long</code> + * (<code>LongLongSeq</code>). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class LongLongSeqHelper +{ + /** + * Extract the <code>long[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link LongLongSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link LongLongSeqHolder}. + */ + public static long[] extract(Any a) + { + LongLongSeqHolder h = (LongLongSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>long[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link LongLongSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, long[] that) + { + LongLongSeqHolder holder = new LongLongSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>long long[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static long[] read(InputStream input) + { + long[] value = new long[ input.read_long() ]; + input.read_longlong_array(value, 0, value.length); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>LongLongSeq</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_long); + } + + /** + * Writes the <code>long[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, long[] value) + { + output.write_long(value.length); + output.write_longlong_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/LongLongSeqHolder.java b/libjava/classpath/org/omg/CORBA/LongLongSeqHolder.java new file mode 100644 index 000000000..ebb83cfd0 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/LongLongSeqHolder.java @@ -0,0 +1,126 @@ +/* LongLongSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>LongLongSeq</code> that is mapped into + * java <code>long[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class LongLongSeqHolder + implements Streamable +{ + /** + * The <code>long[]</code> (CORBA <code>LongLongSeq</code>) value, + * held by this LongLongSeqHolder. + */ + public long[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_longlong); + + /** + * Constructs an instance of LongLongSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public LongLongSeqHolder() + { + } + + /** + * Constructs an instance of LongLongSeqHolder, + * initializing {@link #value} to the given <code>long[]</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public LongLongSeqHolder(long[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.InputStream#read_longlong_array }. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new long[ input.read_long() ]; + input.read_longlong_array(value, 0, value.length); + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.OutputStream#write_longlong_array }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + output.write_longlong_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/LongSeqHelper.java b/libjava/classpath/org/omg/CORBA/LongSeqHelper.java new file mode 100644 index 000000000..c33611da8 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/LongSeqHelper.java @@ -0,0 +1,143 @@ +/* LongSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA sequence of <code>int</code> + * (<code>LongSeq</code>). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class LongSeqHelper +{ + /** + * Extract the <code>int[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link LongSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link LongSeqHolder}. + */ + public static int[] extract(Any a) + { + LongSeqHolder h = (LongSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>int[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link LongSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, int[] that) + { + LongSeqHolder holder = new LongSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>int[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static int[] read(InputStream input) + { + int[] value = new int[ input.read_long() ]; + input.read_long_array(value, 0, value.length); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>LongSeq</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_long); + } + + /** + * Writes the <code>int[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, int[] value) + { + output.write_long(value.length); + output.write_long_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/LongSeqHolder.java b/libjava/classpath/org/omg/CORBA/LongSeqHolder.java new file mode 100644 index 000000000..8ecf96cc6 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/LongSeqHolder.java @@ -0,0 +1,128 @@ +/* LongSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>LongSeq</code> that is mapped into + * java <code>int[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class LongSeqHolder + implements Streamable +{ + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_long); + + /** + * The <code>int[]</code> (CORBA <code>LongSeq</code>) value, + * held by this LongSeqHolder. + */ + public int[] value; + + /** + * Constructs an instance of LongSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public LongSeqHolder() + { + } + + /** + * Constructs an instance of LongSeqHolder, + * initializing {@link #value} to the given <code>int</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public LongSeqHolder(int[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>and then calls the + * {@link org.omg.CORBA.portable.InputStream#read_long_array }. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new int[ input.read_long() ]; + input.read_long_array(value, 0, value.length); + typecode.setLength(value.length); + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code>and then calls the + * {@link org.omg.CORBA.portable.OutputStream#write_long_array }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + output.write_long_array(value, 0, value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + +} diff --git a/libjava/classpath/org/omg/CORBA/MARSHAL.java b/libjava/classpath/org/omg/CORBA/MARSHAL.java new file mode 100644 index 000000000..d5d86db4e --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/MARSHAL.java @@ -0,0 +1,323 @@ +/* MARSHAL.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.CORBA; + +import java.io.Serializable; + +/** + * Means that some request or reply from the network has a wrong size or is + * structurally invalid. In GNU Classpath, this exception may have the following + * minor codes (the high 20 bits being Classpath VMCID): + * + * <table border="1"> + * <tr> + * <th>Hex</th> + * <th>Dec</th> + * <th>Minor</th> + * <th>Name</th> + * <th>Case</th> + * </tr> + * <tr> + * <td>47430001</td> + * <td>1195573249</td> + * <td>1</td> + * <td>Giop</td> + * <td>The message being received is not a GIOP message. It does not start from + * the expected magic sequence byte[] { 'G', 'I', 'O', 'P' }.</td> + * </tr> + * <tr> + * <td>47430002</td> + * <td>1195573250</td> + * <td>2</td> + * <td>Header</td> + * <td>The unexpected IOException while reading or writing the GIOP message + * header or the subsequent request or response header</td> + * </tr> + * <tr> + * <td>47430003</td> + * <td>1195573251</td> + * <td>3</td> + * <td>EOF</td> + * <td>The data stream ended before reading all expected values from it. This + * usually means that the CORBA message is corrupted, but may also indicate that + * the server expects the remote method being invoked to have more or different + * parameters</td> + * </tr> + * <tr> + * <td>47430005</td> + * <td>1195573253</td> + * <td>5</td> + * <td>CDR</td> + * <td>The unexpected IOException while reading or writing the data via Commond + * Data Representation stream</td> + * </tr> + * <tr> + * <td>47430006</td> + * <td>1195573254 </td> + * <td>6</td> + * <td>Value</td> + * <td>The unexpected IOException while reading or writing the Value type. + * </td> + * </tr> + * <tr> + * <td>47430007 </td> + * <td>1195573255</td> + * <td>7</td> + * <td>Forwarding</td> + * <td>The unexpected IOException while handling request forwarding.</td> + * </tr> + * <tr> + * <td>47430008</td> + * <td>1195573256</td> + * <td>8</td> + * <td>Encapsulation </td> + * <td>The unexpected IOException while handling data encapsulation, tagged + * components, tagged profiles, etc.</td> + * </tr> + * <tr> + * <td>47430009</td> + * <td>1195573257</td> + * <td>9 </td> + * <td>Any</td> + * <td>The unexpected IOException while inserting or extracting data to/from + * the Any.</td> + * </tr> + * <tr> + * <td>4743000a</td> + * <td>1195573258 </td> + * <td>10</td> + * <td>UserException</td> + * <td>The unexpected UserException in the context where it cannot be handled + * as such and must be converted to the SystemException. </td> + * </tr> + * <tr> + * <td>4743000b</td> + * <td>1195573259</td> + * <td>11</td> + * <td>Inappropriate</td> + * <td>While the operation could formally be applied to the target, the OMG + * standard states that it is actually not applicable. For example, some CORBA + * objects like POA are always local and should not be passed to or returned + * from the remote side.</td> + * </tr> + * <tr> + * <td>4743000c</td> + * <td>1195573260</td> + * <td>12</td> + * <td>Negative</td> + * <td>When reading data, it was discovered that size of the data structure + * like string, sequence or character is written as the negative number.</td> + * </tr> + * <tr> + * <td>4743000e</td> + * <td>1195573262 </td> + * <td>14</td> + * <td>Graph</td> + * <td>Reference to non-existing node in the data grapth while reading the + * value types.</td> + * </tr> + * <tr> + * <td>4743000f</td> + * <td>1195573263</td> + * <td>15</td> + * <td>Boxed</td> + * <td>Unexpected exception was thrown from the IDL type helper while handling + * the object of this type as a boxed value.</td> + * </tr> + * <tr> + * <td>47430010</td> + * <td>1195573264</td> + * <td>16</td> + * <td>Instantiation</td> + * <td>Unable to instantiate an value type object while reading it from the + * stream.</td> + * </tr> + * <tr> + * <td>47430011</td> + * <td>1195573265</td> + * <td>17</td> + * <td>ValueHeaderTag</td> + * <td>The header tag of the value type being read from the CDR stream contains + * an unexpected value outside 0x7fffff00 .. 0x7fffffff and also not null and + * not an indirection.</td> + * </tr> + * <tr> + * <td>47430012</td> + * <td>1195573266</td> + * <td>18</td> + * <td>ValueHeaderFlags</td> + * <td>The header tag flags of the value type being read from the CDR stream + * make the invalid combination (for instance, 0x7fffff04).</td> + * </tr> + * <tr> + * <td>47430013</td> + * <td>1195573267</td> + * <td>19</td> + * <td>ClassCast</td> + * <td>The value type class, written on the wire, is not compatible with the + * expected class, passed as a parameter to the InputStream.read_value.</td> + * </tr> + * <tr> + * <td>47430014</td> + * <td>1195573268</td> + * <td>20</td> + * <td>Offset</td> + * <td>Positive or otherwise invalid indirection offset when reading the data + * graph of the value type.</td> + * </tr> + * <tr> + * <td>47430015</td> + * <td>1195573269</td> + * <td>21</td> + * <td>Chunks</td> + * <td>Errors while reading the chunked value type.</td> + * </tr> + * <tr> + * <td>47430016</td> + * <td>1195573270</td> + * <td>22</td> + * <td>UnsupportedValue</td> + * <td>No means are provided to read or write this value type (not Streamable, + * not CustomMarshal, not Serializable, no factory, no helper.</td> + * </tr> + * <tr> + * <td>47430017</td> + * <td>1195573271</td> + * <td>23</td> + * <td>Factory</td> + * <td>The value factory, required for the operation being invoked, is not + * registered with this ORB.</td> + * </tr> + * <tr> + * <td>47430018</td> + * <td>1195573272</td> + * <td>24</td> + * + * <td>UnsupportedAddressing</td> + * <td>Unsupported object addressing method in GIOP request header.</td> + * </tr> + * <tr> + * <td>47430019</td> + * <td>1195573273</td> + * <td>25</td> + * <td>IOR</td> + * <td>Invalid object reference (IOR).</td> + * </tr> + * <tr> + * <td>4743001a</td> + * <td>1195573274</td> + * <td>26</td> + * <td>TargetConversion</td> + * <td>Problems with converting between stubs, ties, interfaces and + * implementations.</td> + * + * </tr> + * <tr> + * <td>4743001b</td> + * <td>1195573275</td> + * <td>27</td> + * <td>ValueFields</td> + * <td>Problems with reading or writing the fields of the value type object + * </td> + * </tr> + * <tr> + * <td>4743001c</td> + * <td>1195573276</td> + * <td>28</td> + * <td>NonSerializable</td> + * <td>The instance of the value type, passed using RMI over IIOP, is not + * serializable</td> + * </tr> + * </table> + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class MARSHAL + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 7416408250336395546L; + + /** + * Creates a MARSHAL with the default minor code of 0, completion state + * COMPLETED_NO and the given explaining message. + * + * @param message the explaining message. + */ + public MARSHAL(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates MARSHAL with the default minor code of 0 and a completion state + * COMPLETED_NO. + */ + public MARSHAL() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates a MARSHAL exception with the specified minor code and completion + * status. + * + * @param minor_code additional error code. + * @param is_completed the method completion status. + */ + public MARSHAL(int minor_code, CompletionStatus is_completed) + { + super("", minor_code, is_completed); + } + + /** + * Created MARSHAL exception, providing full information. + * + * @param reason explaining message. + * @param minor_code additional error code (the "minor"). + * @param is_completed the method completion status. + */ + public MARSHAL(String reason, int minor_code, CompletionStatus is_completed) + { + super(reason, minor_code, is_completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/NO_IMPLEMENT.java b/libjava/classpath/org/omg/CORBA/NO_IMPLEMENT.java new file mode 100644 index 000000000..97caa1af0 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/NO_IMPLEMENT.java @@ -0,0 +1,97 @@ +/* NO_IMPLEMENT.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.CORBA; + +import java.io.Serializable; + +/** + * Means that while the operation being invoked does exists, no + * implementation for it exists. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class NO_IMPLEMENT + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 3519190655657192112L; + + /** + * Creates a NO_IMPLEMENT with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public NO_IMPLEMENT(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates NO_IMPLEMENT with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public NO_IMPLEMENT() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a NO_IMPLEMENT exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public NO_IMPLEMENT(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created NO_IMPLEMENT exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public NO_IMPLEMENT(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/NO_MEMORY.java b/libjava/classpath/org/omg/CORBA/NO_MEMORY.java new file mode 100644 index 000000000..04bf3ff61 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/NO_MEMORY.java @@ -0,0 +1,96 @@ +/* NO_MEMORY.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the server has runned out of memory. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class NO_MEMORY + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -4591569617929689285L; + + /** + * Creates a NO_MEMORY with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public NO_MEMORY(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates NO_MEMORY with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public NO_MEMORY() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a NO_MEMORY exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public NO_MEMORY(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created NO_MEMORY exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public NO_MEMORY(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/NO_PERMISSION.java b/libjava/classpath/org/omg/CORBA/NO_PERMISSION.java new file mode 100644 index 000000000..cdce9c820 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/NO_PERMISSION.java @@ -0,0 +1,96 @@ +/* NO_PERMISSION.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the caller has no rights to invoke the operation. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class NO_PERMISSION + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -1533969523582458479L; + + /** + * Creates a NO_PERMISSION with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public NO_PERMISSION(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates NO_PERMISSION with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public NO_PERMISSION() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a NO_PERMISSION exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public NO_PERMISSION(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created NO_PERMISSION exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public NO_PERMISSION(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/NO_RESOURCES.java b/libjava/classpath/org/omg/CORBA/NO_RESOURCES.java new file mode 100644 index 000000000..a58279fbd --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/NO_RESOURCES.java @@ -0,0 +1,131 @@ +/* NO_RESOURCES.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the ORB has reached some general resource limitation like maximal + * number of the opened connections. + * + * In GNU Classpath, this exception may have the following minor codes: + * + * <table border="1"> + * <tr> + * <td>Hex</td> + * <td>Dec</td> + * <td>Minor</td> + * <td>Name</td> + * <td>Case</td> + * </tr> + * <tr> + * <td>47430014</td> + * <td>1195573268</td> + * <td>20</td> + * <td>Ports</td> + * <td>No more free ports available for the new objects. The port control, if + * turned on, prevents malicios client from knocking the server out by suddenly + * requiring to allocate a very large number of objects.</td> + * </tr> + * <tr> + * <td>47430015</td> + * <td>1195573269</td> + * <td>21</td> + * <td>Threads</td> + * <td> Too many parallel calls (too many parallel threads). The thread control, + * if turned on, prevents malicios client from knocking the server out by + * suddenly submitting a very large number of requests. </td> + * </tr> + * </table> + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class NO_RESOURCES + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 8129246118235803597L; + + /** + * Creates a NO_RESOURCES with the default minor code of 0, completion state + * COMPLETED_NO and the given explaining message. + * + * @param message the explaining message. + */ + public NO_RESOURCES(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates NO_RESOURCES with the default minor code of 0 and a completion + * state COMPLETED_NO. + */ + public NO_RESOURCES() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates a NO_RESOURCES exception with the specified minor code and + * completion status. + * + * @param a_minor additional error code. + * @param a_completed the method completion status. + */ + public NO_RESOURCES(int a_minor, CompletionStatus a_completed) + { + super("", a_minor, a_completed); + } + + /** + * Created NO_RESOURCES exception, providing full information. + * + * @param a_reason explaining message. + * @param a_minor additional error code (the "minor"). + * @param a_completed the method completion status. + */ + public NO_RESOURCES(String a_reason, int a_minor, CompletionStatus a_completed) + { + super(a_reason, a_minor, a_completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/NO_RESPONSE.java b/libjava/classpath/org/omg/CORBA/NO_RESPONSE.java new file mode 100644 index 000000000..140a39c9a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/NO_RESPONSE.java @@ -0,0 +1,97 @@ +/* NO_RESPONSE.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the client attempts to retrieve the result that is not + * yet available. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class NO_RESPONSE + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1971973765161647047L; + + /** + * Creates a NO_RESPONSE with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public NO_RESPONSE(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates NO_RESPONSE with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public NO_RESPONSE() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a NO_RESPONSE exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public NO_RESPONSE(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created NO_RESPONSE exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public NO_RESPONSE(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/NVList.java b/libjava/classpath/org/omg/CORBA/NVList.java new file mode 100644 index 000000000..f446d6007 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/NVList.java @@ -0,0 +1,117 @@ +/* NVList.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.CORBA; + +import org.omg.CORBA.Any; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.NamedValue; + +/** + * The named value list, used to define the parameters in the + * {@link org.omg.CORBA.Request}. This class is also + * used to hold the values of {@link Context}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class NVList +{ + /** + * Create and add a new named value object with null name, + * null value and having given flags. + * @param a_flags the flags, the normally expected values are + * {@link org.omg.CORBA.ARG_IN#value}, + * {@link org.omg.CORBA.ARG_OUT#value} and + * {@link org.omg.CORBA.ARG_INOUT#value} or 0. + * + * @return the created and added value. + */ + public abstract NamedValue add(int a_flags); + + /** + * Create and add the new named value object with the given + * names, given flags and the null value. + * @param a_name the name + * @param a_flags the flags, the normally expected values are + * {@link org.omg.CORBA.ARG_IN#value}, + * {@link org.omg.CORBA.ARG_OUT#value} and + * {@link org.omg.CORBA.ARG_INOUT#value} or 0. + * + * @return the created and added value. + */ + public abstract NamedValue add_item(String a_name, int a_flags); + + /** + * Create and add the named value object with the given name, + * value and flags. + * @param a_name the name + * @param a_value the value + * @param a_flags the flags, the normally expected values are + * {@link org.omg.CORBA.ARG_IN#value}, + * {@link org.omg.CORBA.ARG_OUT#value} and + * {@link org.omg.CORBA.ARG_INOUT#value} or 0. + * + * @return the created object. + */ + public abstract NamedValue add_value(String a_name, Any a_value, int a_flags); + + /** + * Get the number of the present named value pairs. + * + * @return the number of objects in the list. + */ + public abstract int count(); + + /** + * Get the item at the given index + * @param at the index. + * + * @return the item at the index + * @throws Bounds if the index is out of bounds. + */ + public abstract NamedValue item(int at) + throws Bounds; + + /** + * Remove the item at the given index + * @param at the index + * @throws Bounds if the index is out of bounds. + */ + public abstract void remove(int at) + throws Bounds; +} diff --git a/libjava/classpath/org/omg/CORBA/NameValuePair.java b/libjava/classpath/org/omg/CORBA/NameValuePair.java new file mode 100644 index 000000000..a447c6f7b --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/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.CORBA; + +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 +{ + /** + * The value of the structure record. + */ + public Any value; + + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 7000741877654946223L; + + /** + * 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 an_id the name (also called id) of the name-value pair, normally + * the name of the structure field. + * + * @param a_value the value of the name-value pair. + */ + public NameValuePair(String an_id, Any a_value) + { + id = an_id; + value = a_value; + } +} diff --git a/libjava/classpath/org/omg/CORBA/NameValuePairHelper.java b/libjava/classpath/org/omg/CORBA/NameValuePairHelper.java new file mode 100644 index 000000000..f6d933930 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/NameValuePairHelper.java @@ -0,0 +1,137 @@ +/* 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.CORBA; + +import gnu.CORBA.DynAn.NameValuePairHolder; +import gnu.CORBA.typecodes.AliasTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; +import gnu.CORBA.typecodes.StringTypeCode; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for {@link NameValuePair}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class NameValuePairHelper +{ + /** + * The {@link NameValuePair} repository id, + * 'IDL:omg.org/CORBA/NameValuePair:1.0'. + */ + private static String _id = "IDL:omg.org/CORBA/NameValuePair:1.0"; + + /** + * Extract the NameValuePair from the given {@link Any}. + */ + public static NameValuePair extract(Any a) + { + try + { + return ((NameValuePairHolder) a.extract_Streamable()).value; + } + catch (ClassCastException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("NameValuePair expected"); + bad.minor = Minor.Any; + throw bad; + } + } + + /** + * Return the NameValuePair repository id. + */ + public static String id() + { + return _id; + } + + /** + * Insert the NameValuePair into the given {@link Any}. + */ + public static void insert(Any a, NameValuePair that) + { + a.insert_Streamable(new NameValuePairHolder(that)); + } + + /** + * Read the NameValuePair from the given CDR stream. First reads the + * name (id) as string, then the value as {@link Any}. + */ + public static NameValuePair read(InputStream istream) + { + NameValuePair p = new NameValuePair(); + p.id = istream.read_string(); + p.value = istream.read_any(); + return p; + } + + /** + * Create the type code for the name value pair. + */ + public static TypeCode type() + { + StructMember[] members = new StructMember[2]; + + TypeCode t_id = new AliasTypeCode(new StringTypeCode(TCKind.tk_string), "", + "id"); + + members[0] = new StructMember("id", t_id, null); + + members[1] = new StructMember("value", + new PrimitiveTypeCode(TCKind.tk_any), null); + + return OrbRestricted.Singleton.create_struct_tc(id(), "NameValuePair", + members); + } + + /** + * Write the exception to the CDR output stream. First writes the + * name (id), then the value as {@link Any}. + */ + public static void write(OutputStream ostream, NameValuePair value) + { + ostream.write_string(value.id); + ostream.write_any(value.value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/NamedValue.java b/libjava/classpath/org/omg/CORBA/NamedValue.java new file mode 100644 index 000000000..492c854b7 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/NamedValue.java @@ -0,0 +1,71 @@ +/* NamedValue.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.CORBA; + +/** + * The class is used to describe a call parameter, having name, + * value and the passing mode flags ({@link ARG_IN}, {@link ARG_OUT} or + * {@link ARG_INOUT}. The same class is also used in {@link Context} to + * pass the property names and values. This class is normally created by + * {@link ORB#create_named_value(String, Any, int)}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class NamedValue +{ + /** + * Get the parameter flags. + * @return normally one of ({@link ARG_IN}, {@link ARG_OUT} or + * {@link ARG_INOUT}). + */ + public abstract int flags(); + + /** + * Get the name of this parameter. + * @return the name of this instance. + */ + public abstract String name(); + + /** + * Get the value of this parameter. The parameter value is wrapped into + * the instance of {@link Any}. + * + * @return the value of this parameter. + */ + public abstract Any value(); +} diff --git a/libjava/classpath/org/omg/CORBA/OBJECT_NOT_EXIST.java b/libjava/classpath/org/omg/CORBA/OBJECT_NOT_EXIST.java new file mode 100644 index 000000000..97ca3197e --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/OBJECT_NOT_EXIST.java @@ -0,0 +1,95 @@ +/* OBJECT_NOT_EXIST.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.CORBA; + +import java.io.Serializable; + +/** + * Means an attempt to perform some operation on a deleted object. + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class OBJECT_NOT_EXIST + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 7226958015420512389L; + + /** + * Creates a OBJECT_NOT_EXIST with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public OBJECT_NOT_EXIST(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates OBJECT_NOT_EXIST with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public OBJECT_NOT_EXIST() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a OBJECT_NOT_EXIST exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public OBJECT_NOT_EXIST(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created OBJECT_NOT_EXIST exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public OBJECT_NOT_EXIST(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/OBJ_ADAPTER.java b/libjava/classpath/org/omg/CORBA/OBJ_ADAPTER.java new file mode 100644 index 000000000..8ec07fd4d --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/OBJ_ADAPTER.java @@ -0,0 +1,96 @@ +/* OBJ_ADAPTER.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.CORBA; + +import java.io.Serializable; + +/** + * This exception typically indicates an administrative mismatch. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class OBJ_ADAPTER + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -1516541344234786928L; + + /** + * Creates a OBJ_ADAPTER with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public OBJ_ADAPTER(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates OBJ_ADAPTER with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public OBJ_ADAPTER() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a OBJ_ADAPTER exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public OBJ_ADAPTER(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created OBJ_ADAPTER exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public OBJ_ADAPTER(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/OMGVMCID.java b/libjava/classpath/org/omg/CORBA/OMGVMCID.java new file mode 100644 index 000000000..127706bf0 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/OMGVMCID.java @@ -0,0 +1,72 @@ +/* OMGVMCID.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.CORBA; + +/** + * </p> + * The higher 20 bits of any CORBA exception hold "Vendor Minor Codeset ID" + * (VMCID), for instance 0x4F4D0000 (OMG standard), 0x54410000 (TAO), 0x4A430000 + * (JacORB), 0x49540000 (IONA), 0x53550000 (Sun). + * </p> + * <p> + * GNU Classpath official vendor minor code set id is 0x47430000 ("GC\x00\x00"), + * and the reserved space spans till 0x47430FFF, allowing to use up to 4096 + * Classpath specific exceptions. It was assigned 30/09/2005 by OMG Vice President + * Andrew Watson. + * </p> + * <p> + * The standard minor codes for the standard system exceptions are prefaced by + * the VMCID assigned to OMG, defined as 0x4F4D0000 (the code of the minor field + * for the standard exception with minor code 1 is 0x4F4D0001). Within a vendor + * assigned space, the assignment of values to minor codes is left to the + * vendor. + * </p> + * + * <p> + * The VMCID 0 and 0xFFFFF0000 are reserved for experimental use. + * </p> + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface OMGVMCID +{ + /** + * The OMG vendor minor code ID. + */ + int value = 0x4F4D0000; +} diff --git a/libjava/classpath/org/omg/CORBA/ORB.java b/libjava/classpath/org/omg/CORBA/ORB.java new file mode 100644 index 000000000..d40007d2c --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ORB.java @@ -0,0 +1,1247 @@ +/* ORB.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.CORBA; + +import gnu.CORBA.OrbFocused; +import gnu.CORBA.ObjectCreator; +import gnu.CORBA.OrbRestricted; +import gnu.CORBA.typecodes.FixedTypeCode; +import gnu.CORBA.typecodes.GeneralTypeCode; +import gnu.CORBA.typecodes.RecordTypeCode; +import gnu.CORBA.typecodes.RecursiveTypeCode; + +import org.omg.CORBA.ORBPackage.InconsistentTypeCode; +import org.omg.PortableInterceptor.ObjectReferenceTemplate; + +import java.applet.Applet; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; + +import java.util.Properties; + +/** + * A central class in CORBA implementation, responsible for sending and handling + * remote invocations. ORB also works as a factory for creating instances of + * certain CORBA classes. + * + * Despite the core library contains the fully working CORBA implementation, it + * also provides a simple way to plug-in the alternative CORBA support. This is + * done by replacing the ORB. The alternative ORB can be specified via + * properties, passed to ORB.Init(...). + * + * When creating an ORB instance, the class name is searched in the following + * locations: + * <p> + * 1. Applet parameter or application string array, if any.<br> + * 2. The properties parameter, if any.<br> + * 3. The System properties.<br> + * 4. The orb.properties file located in the user.home directory (if any).<br> + * 5. The orb.properties file located in the java.home/lib directory (if any). + * </p> + * + * The supported properties are: <table border="1"> + * <tr> + * <td> org.omg.CORBA.ORBClass</td> + * <td>The class, implementing the functional ORB, returned by + * {@link #init(Applet, Properties)} or {@link #init(String[], Properties)} + * </td> + * </tr> + * <tr> + * <td>org.omg.CORBA.ORBSingletonClass</td> + * <td>The class, implementing the restricted ORB, returned by {@link #init()}. + * </td> + * </tr> + * <tr> + * <td>org.omg.CORBA.ORBInitRef</td> + * <td>Specifies the initial reference, accessible by name with the method + * {@link #resolve_initial_references(String)}.</td> + * </tr> + * <tr> + * <td>org.omg.CORBA.ORBid</td> + * <td>Specifies the name (ORB Id) of this ORB. The ORB Id is later accessible + * by {@link ObjectReferenceTemplate#orb_id}. The default value includes the + * hashcode of the ORB instance that is normally different for each ORB. + * </td> + * </tr> + * <tr> + * <td>org.omg.CORBA.ServerId</td> + * <td>Specifies the name (Server Id) of this server. This property assigns + * value to the <i>static</i> field, ensuring that all ORB's on the same jre + * have the same Server Id. It is normally set as the system property. The + * server Id is later accessible as {@link ObjectReferenceTemplate#server_id}. + * </td> + * </tr> + * <tr> + * <td>gnu.CORBA.ListenerPort</td> + * <td>Specifies that this ORB should serve all its objects on a single port + * (for example, "1234") or on a specified port range (for example, + * "1100-1108"). The property is used when working with firewals and serves as a + * replacement for the proprietary properties like com.ibm.CORBA.ListenerPort + * or com.sun.CORBA.POA.ORBPersistentServerPort. The specified port or range + * should not overlap with the values, specified for other ORB's. + * </td> + * </tr> + * <tr> + * <td>gnu.Corba.SocketFactory</td> + * <td>Sets the user-defined server and client socket factory for the ORB being + * currently instantiated. Serves as a replacement of the proprietary + * property com.sun.CORBA.connection.ORBSocketFactoryClass. To have multiple + * types of sockets, instantiate several ORB's with this property each time + * set to the different value. + * The factory must implement gnu.CORBA.interfaces.SocketFactory. + * </td> + * </tr> + * </table> + * <p>The command line accepts the same properties as a keys. When + * specifying in the command line, the prefix org.omg.CORBA can be omitted, for + * instance<code> -ORBInitRef NameService=IOR:aabbccdd....</code> + * </p> + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class ORB +{ + /** + * By default, {@link #init(String[], Properties)} and + * {@link #init(Applet, Properties)} return + * the built-in fully functional ORB is returned. If the + * <code>props</code> contains the property org.omg.CORBA.ORBClass, + * the value of this property is used as a class name to instantiate + * a user-defined ORB. + */ + private static final String FUNCTIONAL_ORB = "org.omg.CORBA.ORBClass"; + + /** + * The name of the restricted ORB property. + */ + private static final String RESTRICTED_ORB = + "org.omg.CORBA.ORBSingletonClass"; + + private static final String LISTENER_PORT = + OrbFocused.LISTENER_PORT; + + /** + * The class, implementing the default fully functional ORB. + */ + private static final String DEFAULT_FUNCTIONAL_ORB = + gnu.CORBA.Poa.ORB_1_4.class.getName(); + + private static final String DEFAULT_FOCUSED_ORB = + gnu.CORBA.OrbFocused.class.getName(); + + // There is no need for name of the default restricted ORB as it is + // singleton and it is more effectively referred directly. + + /** + * Connect the given CORBA object to this ORB. After the object is + * connected, it starts receiving remote invocations via this ORB. + * + * The OMG group recommends to use Portable Object Adapter (POA) instead + * of calling this method. + * + * This method is implemented in the derived Gnu Classpah classes, + * returned by ORB.init(..). In this abstract class, the implementation + * just throws {@link NO_IMPLEMENT}. + * + * @param object the org.omg.CORBA.Object to connect. + */ + public void connect(org.omg.CORBA.Object object) + { + throw new NO_IMPLEMENT(); + } + + /** + * Disconnect the given CORBA object from this ORB. The object will be + * no longer receiving the remote invocations. In response to the + * remote invocation on this object, the ORB will send the + * exception {@link OBJECT_NOT_EXIST}. The object, however, is not + * destroyed and can receive the local invocations. + * + * This method is implemented in the derived Gnu Classpah classes, + * returned by ORB.init(..). In this abstract class, the implementation + * just throws {@link NO_IMPLEMENT}. + * + * @param object the object to disconnect. + */ + public void disconnect(org.omg.CORBA.Object object) + { + throw new NO_IMPLEMENT(); + } + + /** + * Create a typecode, representing a tree-like structure. + * This structure contains a member that is a sequence of the same type, + * as the structure itself. You can imagine as if the folder definition + * contains a variable-length array of the enclosed (nested) folder + * definitions. In this way, it is possible to have a tree like + * structure that can be transferred via CORBA CDR stream. + * + * @deprecated It is easier and clearler to use a combination of + * create_recursive_tc and create_sequence_tc instead. + * + * @param bound the maximal expected number of the nested components + * on each node; 0 if not limited. + * + * @param offset the position of the field in the returned structure + * that contains the sequence of the structures of the same field. + * The members before this field are intialised using parameterless + * StructMember constructor. + * + * @return a typecode, defining a stucture, where a member at the + * <code>offset</code> position defines an array of the identical + * structures. + * + * @see #create_recursive_tc(String) + * @see #create_sequence_tc(int, TypeCode) + */ + public abstract TypeCode create_recursive_sequence_tc(int bound, int offset); + + /** + * Create alias typecode for the given typecode. + */ + public abstract TypeCode create_alias_tc(String id, String name, + TypeCode typecode + ); + + /** + * Create an instance of the CORBA {@link Any} with the type, intialised + * to {@link TCKind#tk_null} + */ + public abstract Any create_any(); + + /** + * Create a typecode, defining an array of the given elements. + * + * @param length the size of array + * @param element_type the array component type. + * + * @return the corresponding typecode. + */ + public abstract TypeCode create_array_tc(int length, TypeCode element_type); + + /** + * Creates an empty CORBA <code>ContextList</code>. + * + * @return the newly created context list. + */ + public abstract ContextList create_context_list(); + + /** + * The support for {@link DynAny} and derived interfaces + * has never been implemented in Sun's java releases, + * at least till v1.4 inclusive. + * + * Since v1.4 this stil missing implementation was replaced + * by the new DynamicAny package. + * + * @deprecated Use {@link org.omg.DynamicAny.DynAnyFactory} + * + * @throws NO_IMPLEMENT, always. + */ + public DynAny create_basic_dyn_any(org.omg.CORBA.TypeCode t) + throws InconsistentTypeCode + { + throw new NO_IMPLEMENT(); + } + + /** + * The support for {@link DynAny} and derived interfaces + * has never been implemented in Sun's java releases, + * at least till v1.4 inclusive. + * + * Since v1.4 this stil missing implementation was replaced + * by the new DynamicAny package. + * + * @deprecated Use {@link org.omg.DynamicAny.DynAnyFactory} + * + * @throws NO_IMPLEMENT, always. + */ + public DynAny create_dyn_any(org.omg.CORBA.Any a) + { + throw new NO_IMPLEMENT(); + } + + /** + * The support for {@link DynArray} + * has never been implemented in Sun's java releases, + * at least till v1.4 inclusive. + * + * Since v1.4 this stil missing implementation was replaced + * by the new DynamicAny package. + * + * @deprecated Use {@link org.omg.DynamicAny.DynAnyFactory} + * + * @throws NO_IMPLEMENT, always. + */ + public DynArray create_dyn_array(org.omg.CORBA.TypeCode t) + throws InconsistentTypeCode + { + throw new NO_IMPLEMENT(); + } + + /** + * The support for {@link DynEnum} + * has never been implemented in Sun's java releases, + * at least till v1.4 inclusive. + * + * Since v1.4 this stil missing implementation was replaced + * by the new DynamicAny package. + * + * @deprecated Use {@link org.omg.DynamicAny.DynAnyFactory} + * + * @throws NO_IMPLEMENT, always. + */ + public DynEnum create_dyn_enum(org.omg.CORBA.TypeCode t) + throws InconsistentTypeCode + { + throw new NO_IMPLEMENT(); + } + + /** + * The support for {@link DynSequence} + * has never been implemented in Sun's java releases, + * at least till v1.4 inclusive. + * + * Since v1.4 this stil missing implementation was replaced + * by the new DynamicAny package. + * + * @deprecated Use {@link org.omg.DynamicAny.DynAnyFactory} + * + * @throws NO_IMPLEMENT, always. + */ + public DynSequence create_dyn_sequence(org.omg.CORBA.TypeCode t) + throws InconsistentTypeCode + { + throw new NO_IMPLEMENT(); + } + + /** + * The support for {@link DynStruct} and derived interfaces + * has never been implemented in Sun's java releases, + * at least till v1.4 inclusive. + * + * Since v1.4 this stil missing implementation was replaced + * by the new DynamicAny package. + * + * @deprecated Use {@link org.omg.DynamicAny.DynAnyFactory} + * + * @throws NO_IMPLEMENT, always. + */ + public DynStruct create_dyn_struct(org.omg.CORBA.TypeCode t) + throws InconsistentTypeCode + { + throw new NO_IMPLEMENT(); + } + + /** + * The support for {@link DynUnion} and derived interfaces + * has never been implemented in Sun's java releases, + * at least till v1.4 inclusive. + * + * Since v1.4 this stil missing implementation was replaced + * by the new DynamicAny package. + * + * @deprecated Use {@link org.omg.DynamicAny.DynAnyFactory} + * + * @throws NO_IMPLEMENT, always. + */ + public DynUnion create_dyn_union(org.omg.CORBA.TypeCode t) + throws InconsistentTypeCode + { + throw new NO_IMPLEMENT(); + } + + /** + * Create a typecode, defining the given enumeration. + * + * @param id the id. + * @param name the name. + * @param members the memebers + * @return the created enumeration. + */ + public abstract TypeCode create_enum_tc(String id, String name, + String[] members + ); + + /** + * Create an environment (container for exceptions). + * + * @return the created container. + */ + public abstract Environment create_environment(); + + /** + * Creates an empty exception list. + * + * @return the newly created list. + */ + public abstract ExceptionList create_exception_list(); + + /** + * Create the exception typecode. + * + * @param id the id of exception. + * @param name the name of exception. + * @param members the members of exception. + */ + public abstract TypeCode create_exception_tc(String id, String name, + StructMember[] members + ); + + /** + * Creates a TypeCode object for CORBA <code>fixed</code> that is + * mapped to java {@link java.math.BigDecimal}. + * + * @param digits the number of digits in that <code>fixed</code>. + * @param scale the number of digits after the decimal point. + * + * @return the corresponding TypeCode. + */ + public TypeCode create_fixed_tc(short digits, short scale) + { + FixedTypeCode r = new FixedTypeCode(); + r.setDigits(digits); + r.setScale(scale); + return r; + } + + /** + * Creates a typecode, representing the IDL interface. + * + * @param id the interface repository id. + * @param name the interface name. + * + * @return the created typecode. + */ + public abstract TypeCode create_interface_tc(String id, String name); + + /** + * Create an instance of a new {@link NVList}. + * + * @param count the initial size of the list. If more elements are added, + * the list automatically expands. + * + * @return the created list. + */ + public abstract NVList create_list(int count); + + /** + * Create a new named value. + * + * @param name the name of the named value + * @param any the content of the named value. + * @param flags the flags of the named value + * + * @return the named value. + */ + public abstract NamedValue create_named_value(String name, Any any, int flags); + + /** + * Send multiple prepared requests one way, do not caring about the answer. + * The messages, containing requests, will be marked, indicating that + * the sender is not expecting to get a reply. + * + * @param requests the prepared array of requests. + * + * @see Request#send_oneway() + */ + public abstract void send_multiple_requests_oneway(Request[] requests); + + /** + * Send multiple prepared requests expecting to get a reply. All requests + * are send in parallel, each in its own separate thread. When the + * reply arrives, it is stored in the agreed fields of the corresponing + * request data structure. If this method is called repeatedly, + * the new requests are added to the set of the currently sent requests, + * but the old set is not discarded. + * + * @param requests the prepared array of requests. + * + * @see #poll_next_response() + * @see #get_next_response() + * @see Request#send_deferred() + */ + public abstract void send_multiple_requests_deferred(Request[] requests); + + /** + * Find if any of the requests that have been previously sent with + * {@link #send_multiple_requests_deferred}, have a response yet. + * + * @return true if there is at least one response to the previously + * sent request, false otherwise. + */ + public abstract boolean poll_next_response(); + + /** + * Get the next instance with a response being received. If all currently + * sent responses not yet processed, this method pauses till at least one of + * them is complete. If there are no requests currently sent, the method + * pauses till some request is submitted and the response is received. + * This strategy is identical to the one accepted by Suns 1.4 ORB + * implementation. + * + * @return the previously sent request that now contains the received + * response. + * + * @throws WrongTransaction If the method was called from the transaction + * scope different than the one, used to send the request. The exception + * can be raised only if the request is implicitly associated with some + * particular transaction. + */ + public abstract Request get_next_response() + throws WrongTransaction; + + /** + * Create a new CDR output stream, where the parameter values can be written + * during the method invocation. + * + * @return a stream to write values into. + */ + public abstract org.omg.CORBA.portable.OutputStream create_output_stream(); + + /** + * This should create the list, initialised with the argument descriptions + * for the given operation definition (CORBA <code>OperationDef</code>). + * The information should be obtained from the interface repository. + * However this method is oficially documented as not implemented at least + * till v1.4 inclusive. + * + * @param operation_definition the operation definition, must be + * CORBA <code>OperationDef</code>. + * + * @return never + * + * @throws NO_IMPLEMENT, always. + */ + public NVList create_operation_list(Object operation_definition) + { + throw new NO_IMPLEMENT(); + } + + /** + * <p>Creates the new policy of the specified type, having the given value. + * This method looks for the policy factory that was previously registered + * during ORB initialization by + * {@link org.omg.PortableInterceptor#ORBInitialiser}. + * + * If the suitable factory is found, this factory creates the requested policy, + * otherwise the PolicyError is thrown. + * </p><p> + * The POA policies should be created by POA, not by this method. + * </p> + * @param type the policy type. + * @param value the policy value, wrapped into Any. + * + * @throws PolicyError if the ORB fails to instantiate the policy object. + * + * @throws NO_IMPLEMENT always (in this class). Overridden in derived classes + * returned by ORB.init(..). + * + * @see org.omg.PortableInterceptor.ORBInitInfoOperations#register_policy_factory + * @see org.omg.PortableInterceptor.PolicyFactoryOperations + */ + public Policy create_policy(int type, Any value) + throws PolicyError + { + throw new NO_IMPLEMENT(); + } + + /** + * Create typecode, defining the sequence of the elements, having + * the given type. + * + * @param bound the maximal length of the sequence, 0 if not restricted. + * + * @param element_type the sequence element type. + * + * @return the typecode. + */ + public abstract TypeCode create_sequence_tc(int bound, TypeCode element_type); + + /** + * Create a TypeCode, representing the CORBA <code>string</code>. + * + * @param bound the maximal length of the string, 0 is unlimited. + * + * @return the corresponding string typecode. + */ + public abstract TypeCode create_string_tc(int bound); + + /** + * Create the typecode, defining the given IDL structure. + * + * The TypeCode object is initialized with the given id, name, and members. + * @param id the Id of this type. + * @param name the name of this type. + * @param members the member list. + * + * @return the typecode. + */ + public abstract TypeCode create_struct_tc(String id, String name, + StructMember[] members + ); + + /** + * Create the typecode, defining the given IDL union. + * + * The TypeCode object is initialized with the given id, name, discriminator + * and members. + * + * @param id the Id of this type. + * @param name the name of this type. + * @param discriminator the union discriminator. + * @param members the member list. + * + * @return the typecode. + */ + public abstract TypeCode create_union_tc(String id, String name, + TypeCode discriminator, + UnionMember[] members + ); + + /** + * Create a TypeCode, representing the CORBA <code>wstring</code>. + * + * @param bound the maximal length of the string, 0 is unlimited. + * + * @return the corresponding string typecode. + */ + public abstract TypeCode create_wstring_tc(int bound); + + /** + * Create a typecode for an abstract interface. The abstract interface + * can be either CORBA object or CORBA value type. + * + * @param id the id of the abstract interface. + * @param name the name of the abstract interface. + * + * @return the created typecode. + */ + public TypeCode create_abstract_interface_tc(String id, String name) + { + GeneralTypeCode t = new GeneralTypeCode(TCKind.tk_abstract_interface); + t.setName(name); + t.setId(id); + return t; + } + + /** + * Create a typecode for a native interface. + * + * @param id the id of the native interface. + * @param name the name of the native interface. + * + * @return the created typecode. + */ + public TypeCode create_native_tc(String id, String name) + { + GeneralTypeCode t = new GeneralTypeCode(TCKind.tk_native); + t.setName(name); + t.setId(id); + return t; + } + + + /** + * Create a typecode which serves as a placeholder for typcode, containing + * recursion. + * + * @param id the id of the recursive typecode, for that this typecode + * serves as a placeholder. + */ + public TypeCode create_recursive_tc(String id) + { + return new RecursiveTypeCode(id); + } + + /** + * Create value box typecode. + */ + public TypeCode create_value_box_tc(String id, String name, + TypeCode boxed_type + ) + { + GeneralTypeCode t = new GeneralTypeCode(TCKind.tk_value_box); + t.setName(name); + t.setId(id); + t.setContentType(boxed_type); + return t; + } + + /** + * Create IDL value type code. + */ + public TypeCode create_value_tc(String id, String name, short type_modifier, + TypeCode concrete_base, ValueMember[] members + ) + { + RecordTypeCode r = new RecordTypeCode(TCKind.tk_value); + r.setId(id); + r.setName(name); + r.setTypeModifier(type_modifier); + r.setConcreteBase_type(concrete_base); + + for (int i = 0; i < members.length; i++) + { + r.add(members [ i ]); + } + + return r; + } + + /** + * This should return the information, related to the current thread. + * The information is needed, for instance, to get the current object + * from the code that serves several objects in parallel threads. + * The {@link Current} is very general interface, with no fields and + * operations defined. This method is not implemented in Suns + * releases at least till v1.5 inclusive. To obtain the + * {@link org.omg.PortableServer.Current}, use + * {@link #resolve_initial_references}, passing "POACurrent". + * + * @deprecated since 1.2, use {@link #resolve_initial_references}. + * + * @return never + * + * @throws NO_IMPLEMENT always. + */ + public Current get_current() + { + throw new NO_IMPLEMENT(); + } + + /** + * This should return the information about the CORBA facilities and + * services, available from this ORB. However this method is oficially + * documented as not implemented at least till v1.5 inclusive. + * + * @param service_type a type of the service being requested. The OMG + * specification currently defines only one value, 1, for security + * related services. + * + * @param service_info a holder, where the returned information should + * be stored. + * + * @return should return true if the service information is available + * from the ORB, but this method never returns. + * + * @throws NO_IMPLEMENT always. + */ + public boolean get_service_information(short service_type, + ServiceInformationHolder service_info + ) + { + throw new NO_IMPLEMENT(); + } + + /** + * Get the default context of this ORB. This is an initial root of all + * contexts. + * + * The default method returns a new context with the empty name and + * no parent context. + * + * @return the default context of this ORB. + * + * @throws NO_IMPLEMENT for the Singleton ORB, returned by + * the parameterless {@link #init()}. + */ + public abstract Context get_default_context(); + + /** + * Return thg typecode, representing the given primitive object type. + * + * @param tcKind the kind of the primitive typecode. + * + * @return the typecode of the primitve typecode. + */ + public abstract TypeCode get_primitive_tc(TCKind tcKind); + + /** + * Returns so-called Singleton ORB, a highly restricted version + * that cannot communicate over network. This ORB is provided + * for the potentially malicious applets with heavy security restrictions. + * + * The returned Singleton ORB can only create typecodes, + * {@link Any}, {@link ContextList}, {@link NVList} and + * {@link org.omg.CORBA.portable.OutputStream} that writes to an + * internal buffer. + * + * All other methods throw the {@link NO_IMPLEMENT} exception, additionally + * printing the error message about the potential attempt to violate + * the security rules. + * + * The implementing ORB class, used in this method, is found as described + * in the header. + * + * @return the working derivative of ORB, implementing the methods + * of this abstract class. + */ + public static ORB init() + { + String orb_cn = getCumulatedProperty(null, RESTRICTED_ORB); + if (orb_cn == null) + return OrbRestricted.Singleton; + else + return createORB(null, orb_cn); + } + + /** + * Creates the working instance of ORB for an applet. + * + * By default the built-in fully functional ORB is returned. The ORB class + * is found as described in the header of this class. + * + * @param applet the applet. The property org.omg.CORBA.ORBClass, + * if present, defines the used ORB implementation class. If this + * property is not present, the ORB class is found as described in the + * class header. + * + * @param props the properties, may be <code>null</code>. + * + * @return a newly created functional derivative of this abstract class. + */ + public static ORB init(Applet applet, Properties props) + { + String ocn = applet.getParameter(FUNCTIONAL_ORB); + String lp = applet.getParameter(LISTENER_PORT); + + if (ocn==null && lp!=null) + ocn = DEFAULT_FOCUSED_ORB; + + ORB orb = createORB(props, ocn); + orb.set_parameters(applet, props); + + return orb; + } + + /** + * Creates the working instance of ORB for a standalone application. + * + * By default the built-in fully functional ORB is returned. The ORB class is + * found as described in the header of this class. + * + * @param args the parameters, passed to the applications + * <code>main(String[] args)</code> method, may be <code>null</code>. The + * parameter -org.omg.CORBA.ORBClass <class name> if present, defines the used + * ORB implementation class. If this property is not present, the ORB class is + * found as described in the class header. + * + * @param props application specific properties, may be <code>null</code>. + * + * @return a newly created functional derivative of this abstract class. + */ + public static ORB init(String[] args, Properties props) + { + String ocn = null; + String lp = null; + + String orbKey = "-" + FUNCTIONAL_ORB; + String lpKey = "-" + LISTENER_PORT; + + if (args != null) + if (args.length >= 2) + { + for (int i = 0; i < args.length - 1; i++) + { + if (args[i].equals(orbKey)) + ocn = args[i + 1]; + if (args[i].equals(lpKey)) + lp = args[i + 1]; + } + } + + if (lp != null && ocn == null) + ocn = DEFAULT_FOCUSED_ORB; + + ORB orb = createORB(props, ocn); + + orb.set_parameters(args, props); + return orb; + } + + /** + * List the initially available CORBA objects (services). + * + * @return a list of services. + * + * @see #resolve_initial_references(String) + */ + public abstract String[] list_initial_services(); + + /** + * Find and return the easily accessible CORBA object, addressed + * by name. The returned object is typically casted to the more + * specific reference using the <code>narrow(Object)</code> method + * of its helper. The method resolves the following string values, + * returning the working objects: + * <table border="1"><tr><th>String</th><th>Object class</th> + * <th>Object use</th></tr> + * + * <tr><td>NameService</td><td>{@link org.omg.CosNaming.NamingContextExt}</td> + * <td>Finds (usually remote) object by its name.</td></tr> + * + * <tr><td>RootPOA</td><td>{@link org.omg.PortableServer.POA}</td> + * <td>Holds the POA tree for this ORB, where since 1.4 all servants + * should be connected.</td></tr> + * + * <tr><td>RootPOAManager</td><td>{@link org.omg.PortableServer.POAManager} + * </td><td>Regulates (suspends/resumes) the root POA + * activity</td></tr> + * + * <tr><td>POACurrent</td><td>{@link org.omg.PortableServer.Current} + * </td><td>Informs the current thread about the Id and POA of the + * object being currently served (the methods of + * <code>Current</code> return different values for + * different threads). + * </td></tr> + * + * <tr><td>CodecFactory</td><td>{@link org.omg.IOP.Codec}</td> + * <td>Encodes/decodes IDL data types into/from byte arrays.</td> + * </tr> + * + * <tr><td>DynAnyFactory</td><td>{@link org.omg.DynamicAny.DynAnyFactory}</td> + * <td>Creates DynAny's.</td> + * </tr> + * + * <tr><td>PICurrent</td><td>{@link org.omg.PortableInterceptor.Current}</td> + * <td>Contains multiple slots where an interceptor can rememeber the + * request - specific values between subsequent + * calls of the interceptor methods.</td> + * </tr> + * + * </table> + * + * @param name the object name. + * @return the object + * @throws org.omg.CORBA.ORBPackage.InvalidName if the given name + * is not associated with the known object. + */ + public abstract Object resolve_initial_references(String name) + throws org.omg.CORBA.ORBPackage.InvalidName; + + /** + * Get the IOR reference string for the given object. + * IOR can be compared with the Internet address for a web page, + * it provides means to locate the CORBA service on the web. + * IOR contains the host address, port number, the object identifier + * (key) inside the server, the communication protocol version, + * supported charsets and so on. + * + * @param forObject the CORBA object + * @return the object IOR representation. + * @see #string_to_object(String) + */ + public abstract String object_to_string(Object forObject); + + /** + * This should perform the implementation dependent unit of work in the + * main thread. + * + * This method is part of the support for the distribute use of the + * single execution thread. + * + * Same as in Suns releases at least till 1.4 inclusive, + * the distribute use of the single thread is not implemented. + * Use multiple threads, provided by jre. + * + * The method returns without action. + */ + public void perform_work() + { + } + + /** + * Checks if the ORB needs the main thread to perform some work. + * The method should return true if the ORB needs the main thread, + * and false if it does not. + * + * This method is part of the support for the distribute use of the + * single execution thread. + * + * Same as in Suns releases at least till 1.4 inclusive, + * the distributed use of the single thread is not implemented. + * Use multiple threads, provided by jre. + * + * @return false, always. + */ + public boolean work_pending() + { + return false; + } + + /** + * <p>Find and return the CORBA object, addressed by the given + * string representation. The object can be (an usually is) + * located on a remote computer, possibly running a different + * (not necessary java) CORBA implementation. The returned + * object is typically casted to the more specific reference + * using the <code>narrow(Object)</code> method of its helper. + * </p><p> + * This function supports the following input formats:<br> + * 1. IOR reference (<b>ior:</b>nnnnn ..), usually computer generated.<br> + * 2. <b>corbaloc:</b>[<b>iiop</b>][version.subversion<b>@</b>]<b>:</b>host[<b>:</b>port]<b>/</b><i>key</i> + * defines similar information as IOR reference, but is more human readable. + * This type of reference may also contain multiple addresses (see + * OMG documentation for complete format).<br> + * 3. <b>corbaloc:rir:/</b><i>name</i> defines internal reference on this + * ORB that is resolved using {@link #resolve_initial_references}, passing + * the given <i>name</i> as parameter.<br> + * 4. <b>corbaname:rir:#</b><i>name</i> states that the given <i>name</i> + * must be resolved using the naming service, default for this ORB.<br> + * 5. <b>corbaname:</b>[<b>iiop</b>][version.subversion<b>@</b>]<b>:</b>host[<b>:</b>port]<b>#</b><i>name</i> + * states that the <i>name</i> must be resolved using the naming service + * that runs on the given host at the given port. The ORB expects to find + * there the {@link org.omg.CosNaming.NamingContext} under the key + * "NameService.<br> + * 7. file://[file name] Read the object definition string from the + * file system<br> + * 8. http://[url] Read the object definition string from the provided + * url.<br> + * 9. ftp://[url] Read the object definition string from the provided + * url.<br> + * + * <p>The default port is always 2809. The default iiop version is 1.0 + * that now may not always be supported, so we would recommend to specify + * the version explicitly.</p> + * <p> + * The examples of the corbaloc and corbaname addresses:<br> + * corbaname:rir:#xobj - ask local naming service for "xobj".<br> + * corbaname:rir:/NameService#xobj - same (long form).<br> + * corbaname:iiop:1.2@localhost:900#xobj - same, assuming that the naming + * service runs at port 900 on the local host and supports iiop 1.2.<br> + * corbaname:iiop:localhost#xobj - same, assuming that the naming + * service runs at port 2809 on the local host and supports iiop 1.0.<br> + * corbaloc::gnu.xxx.yy/Prod/TradingService - the object exists on the + * host gnu.xxx.yy, port 2809 having the key "Prod/TradingService". Its ORB + * supports iiop 1.0.<br> + * corbaloc::gnu.xxx.yy/Prod/TradingService:801 - the object exists on the + * host gnu.xxx.yy, port 801 having the key "Prod/TradingService". Its ORB + * supports iiop 1.0 (iiop keyword ommitted).<br> + * corbaloc:iiop:1.1@gnu.xxx.yy/Prod/TradingService - the object exists on the + * host gnu.xxx.yy, port 801 having the key "Prod/TradingService". Its ORB + * supports iiop 1.1.<br> + * corbaloc:rir:/NameService - the default naming service. + * + * @param IOR the object IOR representation string. + * + * @return the found CORBA object. + * + * @throws BAD_PARAM if the string being parsed is invalid. + * @throws DATA_CONVERSION if the string being parsed contains unsupported + * prefix or protocol. + * + * @see #object_to_string(org.omg.CORBA.Object) + */ + public abstract Object string_to_object(String IOR); + + /** + * Start listening on the input socket. This method + * blocks the current thread until {@link #shutdown(boolean)} + * is called and shutdown process is completed. + */ + public void run() + { + } + + /** + * Shutdown the ORB server. + * + * @param wait_for_completion if true, the current thread is + * suspended untile the shutdown process is complete. + */ + public void shutdown(boolean wait_for_completion) + { + } + + /** + * Destroy this server, releasing the occupied resources. + * The default method returns without action. + */ + public void destroy() + { + } + + /** + * Set the ORB parameters. This method is normally called from + * {@link #init(String[], Properties)}. + * + * @param para the parameters, that were passed as the parameters + * to the <code>main(String[] args)</code> method of the current standalone + * application. + * + * @param props application specific properties that were passed + * as a second parameter in {@link #init(String[], Properties)}). + * Can be <code>null</code>. + */ + protected abstract void set_parameters(String[] para, Properties props); + + /** + * Set the ORB parameters. This method is normally called from + * {@link #init(Applet, Properties)}. + * + * @param app the current applet. + * + * @param props application specific properties, passed as the second + * parameter in {@link #init(Applet, Properties)}. + * Can be <code>null</code>. + */ + protected abstract void set_parameters(Applet app, Properties props); + + /** + * Get the property with the given name, searching in the standard + * places for the ORB properties. + */ + private static String getCumulatedProperty(Properties props, String property) + { + String orb_cn = null; + + if (props != null) + orb_cn = props.getProperty(property, null); + + if (orb_cn == null) + orb_cn = System.getProperty(property, null); + + if (orb_cn == null) + orb_cn = checkFile(property, "user.home", null); + + if (orb_cn == null) + orb_cn = checkFile(property, "java.home", "lib"); + + return orb_cn; + } + + /** + * Check if the property is defined in the existsting file orb.properties. + * + * @param property the property + * @param dir the system property, defining the folder where the + * file could be expected. + * @param subdir subfolder where to look for the file. + * + * @return the property value, null if not found or file does not exist. + */ + private static String checkFile(String property, String dir, String subdir) + { + try + { + File f = new File(dir); + if (!f.exists()) + return null; + + if (subdir != null) + f = new File(f, subdir); + + f = new File(f, "orb.properties"); + + if (!f.exists()) + return null; + + Properties p = new Properties(); + p.load(new BufferedInputStream(new FileInputStream(f))); + + return p.getProperty(property, null); + } + catch (IOException ex) + { + return null; + } + } + + /** + * Create ORB when its name is possibly known. + * + * @param props properties, possibly containing the ORB name. + * @param orbClassName the direct ORB class name, overriding other possible + * locations, or null if not specified. + */ + private static ORB createORB(Properties props, String orbClassName) + { + ORB orb = null; + + if (orbClassName == null) + { + orbClassName = getCumulatedProperty(props, FUNCTIONAL_ORB); + + if (orbClassName == null) + { + String lp = getCumulatedProperty(props, LISTENER_PORT); + if (lp != null) + orbClassName = DEFAULT_FOCUSED_ORB; + else + orbClassName = DEFAULT_FUNCTIONAL_ORB; + } + } + + try + { + orb = (ORB) ObjectCreator.forName(orbClassName).newInstance(); + } + catch (ClassNotFoundException ex) + { + noORB(orbClassName, ex); + } + catch (IllegalAccessException ex) + { + noORB(orbClassName, ex); + } + catch (InstantiationException ex) + { + noORB(orbClassName, ex); + } + + return orb; + } + + /** + * Throw the runtime exception. + * + * @param orb_c the ORB class name. + * @param why the explaining chained exception. + */ + private static void noORB(String orb_c, Throwable why) + { + throw new RuntimeException("The ORB " + orb_c + " cannot be instantiated.", + why + ); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ORBPackage/InconsistentTypeCode.java b/libjava/classpath/org/omg/CORBA/ORBPackage/InconsistentTypeCode.java new file mode 100644 index 000000000..7bb6a702a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ORBPackage/InconsistentTypeCode.java @@ -0,0 +1,79 @@ +/* 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.CORBA.ORBPackage; + +import java.io.Serializable; + +import org.omg.CORBA.UserException; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * The exception is thrown + * in response of the attempt to create the dynamic + * with an unmatching type code. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class InconsistentTypeCode + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID for interoperability. + * Using the version 1.4 UID. + */ + private static final long serialVersionUID = -4393472660722667060L; + + /** + * Constructs a the exception. + */ + public InconsistentTypeCode() + { + } + + /** + * Constructs the exception, explaining the reason of throwing it. + * @param reason a string, explaining, why the exception has been thrown. + */ + public InconsistentTypeCode(String reason) + { + super(reason); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ORBPackage/InvalidName.java b/libjava/classpath/org/omg/CORBA/ORBPackage/InvalidName.java new file mode 100644 index 000000000..5594015cd --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ORBPackage/InvalidName.java @@ -0,0 +1,79 @@ +/* InvalidName.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.CORBA.ORBPackage; + +import java.io.Serializable; + +import org.omg.CORBA.UserException; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * The exception is thrown by + * {@link org.omg.CORBA.ORB#resolve_initial_references(String)} + * in response of passing a name for + * which there is no initial reference. + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class InvalidName + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID for interoperability. + * Using the version 1.4 UID. + */ + private static final long serialVersionUID = 6635923991559230168L; + + /** + * Constructs a the exception. + */ + public InvalidName() + { + } + + /** + * Constructs the exception, explaining the reason of throwing it. + * @param reason a string, explaining, why the exception has been thrown. + */ + public InvalidName(String reason) + { + super(reason); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ORBPackage/package.html b/libjava/classpath/org/omg/CORBA/ORBPackage/package.html new file mode 100644 index 000000000..b0711261d --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ORBPackage/package.html @@ -0,0 +1,46 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html - describes classes in javax.sql package. + 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.CORBA.ORBPackage</title></head> + +<body> +<p>Provides a couple of exceptions, thrown by methods in the {@link org.omg.CORBA.ORB} class.</p> + +</body> +</html> diff --git a/libjava/classpath/org/omg/CORBA/Object.java b/libjava/classpath/org/omg/CORBA/Object.java new file mode 100644 index 000000000..997fab9e8 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/Object.java @@ -0,0 +1,191 @@ +/* Object.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.CORBA; + +/** + * The CORBA object reference. The object can be either local or remote. + * For the local object, the methods of the derived object are called + * like on any other java object. For the remote object, the reference + * points to the stup (proxy), responsible for the remote invocation. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface Object +{ + /** + * Create a request to invoke the method of this object. + * + * @param context a list of additional properties. + * @param operation the name of method to be invoked. + * @param parameters the method parameters. + * @param returns the container for tge method returned value. + * + * @return the created reaquest. + */ + Request _create_request(Context context, String operation, NVList parameters, + NamedValue returns + ); + + /** + * Create a request to invoke the method of this object, specifying + * context list and the list of the expected exception. + * + * @param context a list of additional properties. + * @param operation the name of method to be invoked. + * @param parameters the method parameters. + * @param returns the container for tge method returned value. + * @param exceptions the list of the possible exceptions that the method + * can throw. + * @param ctx_list the list of the context strings that need to be + * resolved and send as a context instance. + * + * @return the created reaquest. + */ + Request _create_request(Context context, String operation, NVList parameters, + NamedValue returns, ExceptionList exceptions, + ContextList ctx_list + ); + + /** + * Duplicate the object reference. This does not make much sense for + * java platform and is just included for the sake of compliance with + * CORBA APIs. + * + * The method may return the object reference itself. + * + * @return as a rule, <code>this</code>. + */ + org.omg.CORBA.Object _duplicate(); + + /** + * Retrieve the domain managers for this object. + * + * @return the domain managers. + */ + DomainManager[] _get_domain_managers(); + + /** + * Get the <code>InterfaceDef</code> for this Object. + */ + org.omg.CORBA.Object _get_interface_def(); + + /** + * Returns the {@link Policy}, applying to this object. + * + * @param a_policy_type a type of policy to be obtained. + * @return a corresponding Policy object. + * + * @throws BAD_PARAM if the policy of the given type is not + * associated with this object, or if it is not supported by this ORB. + */ + Policy _get_policy(int a_policy_type) + throws BAD_PARAM; + + /** + * Get the hashcode this object reference. The same hashcode still + * does not means that the references are the same. From the other + * side, two different references may still refer to the same CORBA + * object. The returned value must not change during the object + * lifetime. + * + * @param maximum the maximal value to return. + * + * @return the hashcode. + */ + int _hash(int maximum); + + /** + * Check if this object can be referenced by the given repository id. + * + * @param repositoryIdentifer the repository id. + * + * @return true if the passed parameter is a repository id of this + * CORBA object. + */ + boolean _is_a(String repositoryIdentifer); + + /** + * Return true if the other object references are equivalent, so far as + * it is possible to determine this easily. + * + * @param other the other object reference. + * + * @return true if both references refer the same object, false + * if they probably can refer different objects. + */ + boolean _is_equivalent(org.omg.CORBA.Object other); + + /** + * Determines if the server object for this reference has already + * been destroyed. + * + * @return true if the object has been destroyed, false otherwise. + */ + boolean _non_existent(); + + /** + * Free resoureces, occupied by this reference. The object implementation + * is not notified, and the other references to the same object are not + * affected. + */ + void _release(); + + /** + * Create a request to invoke the method of this CORBA object. + * + * @param operation the name of the method to invoke. + * + * @return the request. + */ + Request _request(String operation); + + /** + * Returns a new object with the new policies either replacing or + * extending the current policies, depending on the second parameter. + * + * @param policies the policy additions or replacements. + * + * @param how either {@link SetOverrideType#SET_OVERRIDE} to override the + * current policies of {@link SetOverrideType#ADD_OVERRIDE} to replace + * them. + * + * @return the new reference with the changed policies. + */ + Object _set_policy_override(Policy[] policies, SetOverrideType how); +} diff --git a/libjava/classpath/org/omg/CORBA/ObjectHelper.java b/libjava/classpath/org/omg/CORBA/ObjectHelper.java new file mode 100644 index 000000000..fd1211ade --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ObjectHelper.java @@ -0,0 +1,111 @@ +/* ObjectHelper.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.CORBA; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the binding list. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectHelper +{ + /** + * Extract the array of object from the given {@link Any}. + */ + public static org.omg.CORBA.Object extract(Any a) + { + try + { + return ((ObjectHolder) a.extract_Streamable()).value; + } + catch (ClassCastException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("CORBA object expected"); + bad.minor = Minor.Any; + throw bad; + } + } + + /** + * Get the object repository id. + * @return the empty string. + */ + public static String id() + { + return ""; + } + + /** + * Insert the object into the given {@link Any}. + */ + public static void insert(Any a, org.omg.CORBA.Object object) + { + a.insert_Streamable(new ObjectHolder(object)); + } + + /** + * Read the object from the given CDR input stream. + */ + public static org.omg.CORBA.Object read(InputStream istream) + { + return istream.read_Object(); + } + + /** + * Return the object type code. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_objref); + } + + /** + * Write the object into the given CDR output stream. + */ + public static void write(OutputStream ostream, org.omg.CORBA.Object value) + { + ostream.write_Object(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ObjectHolder.java b/libjava/classpath/org/omg/CORBA/ObjectHolder.java new file mode 100644 index 000000000..65eaeae9a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ObjectHolder.java @@ -0,0 +1,133 @@ +/* ObjectHolder.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.CORBA; + +import gnu.CORBA.typecodes.RecordTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for CORBA <code>Object</code> that is mapped into + * java <code>org.omg.CORBA.Object</code>. + * + * The holders have several application areas. The end user usually + * sees them implementing CORBA methods where the primitive type + * is passed by reference. While CORBA (or, for example, C) supports + * this, the java does not and a wrapper class is required. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class ObjectHolder + implements Streamable +{ + /** + * The default type code for this holder if the object type code with + * the zero length string as id. + */ + private static final RecordTypeCode t_object; + + static + { + t_object = new RecordTypeCode(TCKind.tk_objref); + t_object.setId(""); + } + + /** + * The <code>org.omg.CORBA.Object</code> (CORBA <code>Object</code>) value, + * held by this ObjectHolder. + */ + public org.omg.CORBA.Object value; + + /** + * Constructs an instance of ObjectHolder, + * initializing {@link #value} to <code>0</code>. + */ + public ObjectHolder() + { + } + + /** + * Constructs an instance of ObjectHolder, + * initializing {@link #value} to the given <code>org.omg.CORBA.Object</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public ObjectHolder(org.omg.CORBA.Object initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For <code>org.omg.CORBA.Object</code>, the + * functionality is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_Object()}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_Object(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return ObjectHelper.type(); + } + + /** + * Write the {@link #value } field to the given stream. + * For <code>Object</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_Object(Object) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_Object(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/OctetSeqHelper.java b/libjava/classpath/org/omg/CORBA/OctetSeqHelper.java new file mode 100644 index 000000000..e03dba073 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/OctetSeqHelper.java @@ -0,0 +1,143 @@ +/* OctetSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA sequence of <code>byte</code> + * (<code>OctetSeq</code>). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class OctetSeqHelper +{ + /** + * Extract the <code>byte[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link OctetSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link OctetSeqHolder}. + */ + public static byte[] extract(Any a) + { + OctetSeqHolder h = (OctetSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>byte[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link OctetSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, byte[] that) + { + OctetSeqHolder holder = new OctetSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>byte[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static byte[] read(InputStream input) + { + byte[] value = new byte[ input.read_long() ]; + input.read_octet_array(value, 0, value.length); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>OctetSeq</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_octet); + } + + /** + * Writes the <code>byte[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, byte[] value) + { + output.write_long(value.length); + output.write_octet_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/OctetSeqHolder.java b/libjava/classpath/org/omg/CORBA/OctetSeqHolder.java new file mode 100644 index 000000000..8c3e9cb6d --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/OctetSeqHolder.java @@ -0,0 +1,126 @@ +/* OctetSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>OctetSeq</code> that is mapped into + * java <code>byte[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class OctetSeqHolder + implements Streamable +{ + /** + * The <code>byte[]</code> (CORBA <code>OctetSeq</code>) value, + * held by this OctetSeqHolder. + */ + public byte[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_octet); + + /** + * Constructs an instance of OctetSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public OctetSeqHolder() + { + } + + /** + * Constructs an instance of OctetSeqHolder, + * initializing {@link #value} to the given <code>byte[]</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public OctetSeqHolder(byte[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.InputStream#read_octet_array }. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new byte[ input.read_long() ]; + input.read_octet_array(value, 0, value.length); + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.OutputStream#write_octet_array }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + output.write_octet_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/PERSIST_STORE.java b/libjava/classpath/org/omg/CORBA/PERSIST_STORE.java new file mode 100644 index 000000000..99acf543b --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PERSIST_STORE.java @@ -0,0 +1,96 @@ +/* PERSIST_STORE.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.CORBA; + +import java.io.Serializable; + +/** + * Indicates a persistent storage failure like database crash. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class PERSIST_STORE + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -6835478548864681965L; + + /** + * Creates a PERSIST_STORE with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public PERSIST_STORE(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates PERSIST_STORE with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public PERSIST_STORE() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a PERSIST_STORE exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public PERSIST_STORE(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created PERSIST_STORE exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public PERSIST_STORE(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/PRIVATE_MEMBER.java b/libjava/classpath/org/omg/CORBA/PRIVATE_MEMBER.java new file mode 100644 index 000000000..0c055dc46 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PRIVATE_MEMBER.java @@ -0,0 +1,55 @@ +/* PRIVATE_MEMBER.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.CORBA; + +/** + * One of the two constants, defining the visibility scope of + * the {@link ValueMember}. The other constant is + * {@link PUBLIC_MEMBER}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + * + * @see ValueMember#access + */ +public interface PRIVATE_MEMBER +{ + /** + * The flag, specifying that the value member is private. + */ + short value = 0; +} diff --git a/libjava/classpath/org/omg/CORBA/PUBLIC_MEMBER.java b/libjava/classpath/org/omg/CORBA/PUBLIC_MEMBER.java new file mode 100644 index 000000000..9008f7f7a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PUBLIC_MEMBER.java @@ -0,0 +1,55 @@ +/* PUBLIC_MEMBER.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.CORBA; + +/** + * One of the two constants, defining the visibility scope of + * the {@link ValueMember}. The other constant is + * {@link PRIVATE_MEMBER}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + * + * @see ValueMember#access + */ +public interface PUBLIC_MEMBER +{ + /** + * The flag, specifying that the value member is public. + */ + short value = 1; +} diff --git a/libjava/classpath/org/omg/CORBA/ParameterMode.java b/libjava/classpath/org/omg/CORBA/ParameterMode.java new file mode 100644 index 000000000..cdda82547 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ParameterMode.java @@ -0,0 +1,142 @@ +/* ParameterMode.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.CORBA; + +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Defines the parameter modes (the ways in that a method parameter + * is used during invocation). + * + * In CORBA, a method parameter can pass the value (PARAM_IN), + * be used as a placeholder to return the value (PARAM_OUT) or + * both pass the data and be used as a placeholder to return the + * changed value (PARAM_INOUT). + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class ParameterMode + implements Serializable, IDLEntity +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 1521598391932998229L; + + /** + * This value means that the parameter is an IN parameter. + */ + public static final int _PARAM_IN = 0; + + /** + * This value means that the parameter is an OUT parameter. + */ + public static final int _PARAM_OUT = 1; + + /** + * This value means that the parameter is an INOUT parameter. + */ + public static final int _PARAM_INOUT = 2; + + /** + * This value means that the parameter is an IN parameter. + */ + public static final ParameterMode PARAM_IN = new ParameterMode(_PARAM_IN); + + /** + * This value means that the parameter is an OUT parameter. + */ + public static final ParameterMode PARAM_OUT = new ParameterMode(_PARAM_OUT); + + /** + * This value means that the parameter is an INOUT parameter. + */ + public static final ParameterMode PARAM_INOUT = new ParameterMode(_PARAM_INOUT); + + /** + * The value of this parameter mode instance. + */ + private final int value; + + /** + * The conversion table. + */ + private static final ParameterMode[] table = + new ParameterMode[] { PARAM_IN, PARAM_OUT, PARAM_INOUT }; + + /** + * Create an instance of the parameter mode with the given value. + */ + protected ParameterMode(int a_value) + { + value = a_value; + } + + /** + * Return the integer value code for the given parameter mode. + * + * @return 0 for PARAM_IN, 1 for PARAM_OUT, 3 for PARAM_INOUT. + */ + public int value() + { + return value; + } + + /** + * Get a parameter mode instance for the integer parameter mode code. + * + * @param p_mode a parameter mode (0..2). + * + * @return a corresponding parameter mode instance. + * + * @throws BAD_PARAM for the invalid parameter mode code. + */ + public static ParameterMode from_int(int p_mode) + { + try + { + return table [ p_mode ]; + } + catch (ArrayIndexOutOfBoundsException ex) + { + throw new BAD_PARAM("Invalid parameter mode: " + p_mode); + } + } +} diff --git a/libjava/classpath/org/omg/CORBA/ParameterModeHelper.java b/libjava/classpath/org/omg/CORBA/ParameterModeHelper.java new file mode 100644 index 000000000..c0948d4b7 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ParameterModeHelper.java @@ -0,0 +1,116 @@ +/* ParameterModeHelper.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.CORBA; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A helper operations for a method parameter modes. + * A method parameter can pass the value (PARAM_IN), be used as a placeholder + * to return the value (PARAM_OUT) or both pass the data and be used as a + * placeholder to return the changed value (PARAM_INOUT). + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ParameterModeHelper +{ + /** + * Insert the parameter mode into the given Any. + */ + public static void insert(Any any, ParameterMode that) + { + any.insert_Streamable(new ParameterModeHolder(that)); + } + + /** + * Extract the parameter mode from the given Any. + */ + public static ParameterMode extract(Any any) + { + return ((ParameterModeHolder) any.extract_Streamable()).value; + } + + /** + * Get the parameter mode typecode (enumeration, named "ParameterMode"). + * The typecode states that the enumeration can obtain one of + * the following values: PARAM_IN ,PARAM_OUT ,PARAM_INOUT . + */ + public static TypeCode type() + { + String[] members = + new String[] { "PARAM_IN", "PARAM_OUT", "PARAM_INOUT" }; + + return + OrbRestricted.Singleton.create_enum_tc(id(), "ParameterMode", members); + } + + /** + * Get the parameter mode repository id. + * + * @return "IDL:omg.org/CORBA/ParameterMode:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/ParameterMode:1.0"; + } + + /** + * Read the enumeration value (as int) from the CDR intput stream. + * + * @param istream a stream to read from. + */ + public static ParameterMode read(InputStream istream) + { + return ParameterMode.from_int(istream.read_long()); + } + + /** + * Write the enumeration value (as int) to the CDR output stream. + * + * @param ostream a stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream ostream, ParameterMode value) + { + ostream.write_long(value.value()); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ParameterModeHolder.java b/libjava/classpath/org/omg/CORBA/ParameterModeHolder.java new file mode 100644 index 000000000..b6dc8fae7 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ParameterModeHolder.java @@ -0,0 +1,93 @@ +/* ParameterModeHolder.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.CORBA; + +/** + * The holder for ParameterMode. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class ParameterModeHolder + implements org.omg.CORBA.portable.Streamable +{ + /** + * The stored ParameterMode value. + */ + public ParameterMode value; + + /** + * Create the uninitialised instance. + */ + public ParameterModeHolder() + { + } + + /** + * Create the initialised instance. + * @param initialValue + */ + public ParameterModeHolder(ParameterMode initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link #value} by data from the CDR stream. + */ + public void _read(org.omg.CORBA.portable.InputStream in) + { + value = ParameterModeHelper.read(in); + } + + /** + * Get the typecode of the ParameterMode. + */ + public org.omg.CORBA.TypeCode _type() + { + return ParameterModeHelper.type(); + } + + /** + * Write the stored value into the CDR stream. + */ + public void _write(org.omg.CORBA.portable.OutputStream out) + { + ParameterModeHelper.write(out, value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/Policy.java b/libjava/classpath/org/omg/CORBA/Policy.java new file mode 100644 index 000000000..b1fae60bf --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/Policy.java @@ -0,0 +1,55 @@ +/* Policy.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.CORBA; + +import java.io.Serializable; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * The interfaces derived from the class allow an ORB or CORBA service + * access to certain choices (id assignment, threading model and so on) + * that affect they operation. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface Policy + extends IDLEntity, Object, Serializable, PolicyOperations +{ +} diff --git a/libjava/classpath/org/omg/CORBA/PolicyError.java b/libjava/classpath/org/omg/CORBA/PolicyError.java new file mode 100644 index 000000000..98d6079d8 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyError.java @@ -0,0 +1,104 @@ +/* PolicyError.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.CORBA; + +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * The exception is thrown when a policy error occurs. + * A PolicyError exception may include one of the following error reason codes: + * {@link BAD_POLICY}, {@link BAD_POLICY_TYPE}, + * {@link BAD_POLICY_VALUE}, {@link UNSUPPORTED_POLICY}, + * {@link UNSUPPORTED_POLICY_VALUE}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class PolicyError + extends UserException + implements IDLEntity, Serializable +{ + /** + * Holds the exception reason code, one of + * {@link BAD_POLICY}, {@link BAD_POLICY_TYPE}, + * {@link BAD_POLICY_VALUE}, {@link UNSUPPORTED_POLICY}, + * {@link UNSUPPORTED_POLICY_VALUE}. + */ + public short reason; + + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -9196809779974700103L; + + /** + * Constructs an uninitialised instance of the policy error. + */ + public PolicyError() + { + } + + /** + * Constructs the policy error with the given reason code. + * @param a_reason a reason code, one of + * {@link BAD_POLICY}, {@link BAD_POLICY_TYPE}, + * {@link BAD_POLICY_VALUE}, {@link UNSUPPORTED_POLICY}, + * {@link UNSUPPORTED_POLICY_VALUE}. + */ + public PolicyError(short a_reason) + { + reason = a_reason; + } + + /** + * Constructs the policy error with the given reason code and the + * detailed message. + * @param a_details the detailed message. + * @param a_reason a reason code, one of + * {@link BAD_POLICY}, {@link BAD_POLICY_TYPE}, + * {@link BAD_POLICY_VALUE}, {@link UNSUPPORTED_POLICY}, + * {@link UNSUPPORTED_POLICY_VALUE}. + */ + public PolicyError(String a_details, short a_reason) + { + super(a_details); + reason = a_reason; + } +} diff --git a/libjava/classpath/org/omg/CORBA/PolicyErrorCodeHelper.java b/libjava/classpath/org/omg/CORBA/PolicyErrorCodeHelper.java new file mode 100644 index 000000000..75709e801 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyErrorCodeHelper.java @@ -0,0 +1,115 @@ +/* PolicyErrorCodeHelper.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.CORBA; + +import gnu.CORBA.typecodes.PrimitiveTypeCode; +import gnu.CORBA.typecodes.RecordTypeCode; + +import org.omg.CORBA.Any; +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 policy error code as an alias of + * <code>short</code>. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class PolicyErrorCodeHelper + +{ + + /** + * Delegates call to {@link Any#extract_short()}. + */ + public static short extract(Any a) + { + return a.extract_short(); + } + + /** + * Returns policy error code repository id. + * + * @return "IDL:omg.org/CORBA/PolicyErrorCode:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/PolicyErrorCode:1.0"; + } + + /** + * Delegates call to {@link Any#insert_short(short)}. + */ + public static void insert(Any a, short that) + { + a.insert_short(that); + } + + /** + * Delegates call to {@link InputStream#read_short()}. + */ + public static short read(InputStream istream) + { + return istream.read_short(); + } + + /** + * Returns a typecode of the policy error code, stating it is an alias of + * <code>short</code>, named "PolicyErrorCode". + * + * @return a typecode of synchronization scope. + */ + public static TypeCode type() + { + RecordTypeCode r = new RecordTypeCode(TCKind.tk_alias); + r.setName("PolicyErrorCode"); + r.setId(id()); + r.setContentType(new PrimitiveTypeCode(TCKind.tk_short)); + return r; + } + + /** + * Delegates call to {@link OutputStream#write_short(short)}. + */ + public static void write(OutputStream ostream, short value) + { + ostream.write_short(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/PolicyErrorHelper.java b/libjava/classpath/org/omg/CORBA/PolicyErrorHelper.java new file mode 100644 index 000000000..4d949fae4 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyErrorHelper.java @@ -0,0 +1,150 @@ +/* PolicyErrorHelper.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.CORBA; + +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.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the exception {@link PolicyError}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class PolicyErrorHelper +{ + /** + * Create the PolicyError typecode. The typecode defines a structure, named + * "PolicyError", containing the PolicyErrorCode (alias int, see + * {@link PolicyErrorCodeHelper}) field, named "reason". + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 1 ]; + + TypeCode field; + + field = + orb.create_alias_tc("IDL:omg.org/CORBA/PolicyErrorCode:1.0", + "PolicyErrorCode", orb.get_primitive_tc(TCKind.tk_short) + ); + members [ 0 ] = new StructMember("reason", field, null); + return orb.create_exception_tc(id(), "PolicyError", members); + } + + /** + * Insert the PolicyError into the given Any. + * This method uses the PolicyErrorHolder. + * + * @param any the Any to insert into. + * @param that the PolicyError to insert. + */ + public static void insert(Any any, PolicyError that) + { + any.insert_Streamable(new PolicyErrorHolder(that)); + } + + /** + * Extract the PolicyError from given Any. + * This method uses the PolicyErrorHolder. + * + * @throws BAD_OPERATION if the passed Any does not contain PolicyError. + */ + public static PolicyError extract(Any any) + { + try + { + return ((PolicyErrorHolder) any.extract_Streamable()).value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("PolicyError expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the PolicyError repository id. + * + * @return "IDL:omg.org/CORBA/PolicyError:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/PolicyError:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static PolicyError read(InputStream input) + { + // Read the exception repository id. + input.read_string(); + PolicyError value = new PolicyError(); + + value.reason = input.read_short(); + 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, PolicyError value) + { + // Write the exception repository id. + output.write_string(id()); + output.write_short(value.reason); + } +} diff --git a/libjava/classpath/org/omg/CORBA/PolicyErrorHolder.java b/libjava/classpath/org/omg/CORBA/PolicyErrorHolder.java new file mode 100644 index 000000000..c3e8e8237 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyErrorHolder.java @@ -0,0 +1,103 @@ +/* PolicyErrorHolder.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.CORBA; + +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** +* A holder for the exception {@link PolicyError}. + +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public final class PolicyErrorHolder implements Streamable +{ + /** + * The stored PolicyError value. + */ + public PolicyError value; + + /** + * Create the uninitialised instance, leaving the value field + * with default <code>null</code> value. + */ + public PolicyErrorHolder() + { + } + + /** + * Create the initialised instance. + * @param initialValue the value that will be assigned to + * the <code>value</code> field. + */ + public PolicyErrorHolder(PolicyError initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link #value} by data from the CDR stream. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = PolicyErrorHelper.read(input); + } + + /** + * Write the stored value into the CDR stream. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + PolicyErrorHelper.write(output, value); + } + + /** + * Get the typecode of the PolicyError. + */ + public TypeCode _type() + { + return PolicyErrorHelper.type(); + } +} diff --git a/libjava/classpath/org/omg/CORBA/PolicyHelper.java b/libjava/classpath/org/omg/CORBA/PolicyHelper.java new file mode 100644 index 000000000..eb4332f64 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyHelper.java @@ -0,0 +1,159 @@ +/* PolicyHelper.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.CORBA; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.Delegate; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the +* CORBA object {@link Policy}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class PolicyHelper +{ + /** + * Get the type code of the {@link Policy}. + * + * @return interface typecode, named "Policy". + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.create_interface_tc(id(), "Policy"); + } + + /** + * Insert the Policy into the given Any. + * + * @param any the Any to insert into. + * @param that the Policy to insert. + */ + public static void insert(Any any, Policy that) + { + any.insert_Streamable(new PolicyHolder(that)); + } + + /** + * Extract the Policy from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain Policy. + */ + public static Policy extract(Any any) + { + try + { + PolicyHolder h = (PolicyHolder) any.extract_Streamable(); + return h.value; + } + catch (ClassCastException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("Policy expected"); + bad.minor = Minor.Any; + throw bad; + } + } + + /** + * Get the Policy repository id. + * + * @return "IDL:omg.org/CORBA/Policy:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/Policy:1.0"; + } + + /** + * Cast the passed object into the Policy. If the + * object has a different java type, create an instance + * of the _PolicyStub, using the same delegate, as for + * the passed parameter. Hence, unlike java type cast, + * this method may return a different object, than has been passed. + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a Policy. + */ + public static Policy narrow(org.omg.CORBA.Object obj) + { + if (obj == null) + return null; + else if (obj instanceof Policy) + return (Policy) obj; + else + { + // Check for the policy id cannot be performed because + // this helper must read various subclasses of the Policy, + // and the IOR profile currently supports only one id. + + Delegate delegate = ((ObjectImpl) obj)._get_delegate(); + return new _PolicyStub(delegate); + } + } + + /** + * Read the object from the CDR intput stream (IOR profile expected). + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static Policy read(InputStream input) + { + return narrow(input.read_Object()); + } + + /** + * Write the object to the CDR output stream (as IOR profile). + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, Policy value) + { + output.write_Object(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/PolicyHolder.java b/libjava/classpath/org/omg/CORBA/PolicyHolder.java new file mode 100644 index 000000000..cc2cfcfe2 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyHolder.java @@ -0,0 +1,106 @@ +/* PolicyHolder.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.CORBA; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** +* A holder for the object {@link Policy}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public final class PolicyHolder + implements Streamable +{ + /** + * The stored Policy value. + */ + public Policy value; + + /** + * Create the uninitialised instance, leaving the value field + * with default <code>null</code> value. + */ + public PolicyHolder() + { + } + + /** + * Create the initialised instance. + * @param initialValue the value that will be assigned to + * the <code>value</code> field. + */ + public PolicyHolder(Policy initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link #value} by data from the CDR stream. + * Delegates work to {@link PolicyHelper}. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = PolicyHelper.read(input); + } + + /** + * Write the stored value into the CDR stream. + * Delegates work to {@link PolicyHelper}. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + PolicyHelper.write(output, value); + } + + /** + * Get the typecode of the Policy. + * Delegates work to {@link PolicyHelper}. + */ + public org.omg.CORBA.TypeCode _type() + { + return PolicyHelper.type(); + } +} diff --git a/libjava/classpath/org/omg/CORBA/PolicyListHelper.java b/libjava/classpath/org/omg/CORBA/PolicyListHelper.java new file mode 100644 index 000000000..c3ca36369 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyListHelper.java @@ -0,0 +1,139 @@ +/* PolicyListHelper.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.CORBA; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the +* CORBA object {@link Policy}[]. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class PolicyListHelper +{ + /** + * Get the type code of the {@link Policy}[]. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.create_interface_tc(id(), "Policy[]"); + } + + /** + * Insert the Policy[] into the given Any. + * + * @param any the Any to insert into. + * @param that the Policy[] to insert. + */ + public static void insert(Any any, Policy[] that) + { + any.insert_Streamable(new PolicyListHolder(that)); + } + + /** + * Extract the Policy[] from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain Policy[]. + */ + public static Policy[] extract(Any any) + { + try + { + PolicyListHolder holds = (PolicyListHolder) any.extract_Streamable(); + return holds.value; + } + catch (ClassCastException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("Policy[] expected"); + bad.minor = Minor.Any; + throw bad; + } + } + + /** + * Get the Policy[] repository id. + * + * @return "IDL:omg.org/CORBA/PolicyList:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/PolicyList:1.0"; + } + + /** + * Read the sequence of policies from the CDR intput stream. + * The method follows usual CDR standards (an array length as + * CORBA long, followed by the array members, if any). + * The array members are read using {@link PolicyHelper}. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static Policy[] read(InputStream input) + { + Policy[] p = new Policy[ input.read_long() ]; + for (int i = 0; i < p.length; i++) + { + p [ i ] = PolicyHelper.read(input); + } + return p; + } + + /** + * Write the sequence of policies from the CDR intput stream. + * The method follows usual CDR standards (an array length as + * CORBA long, followed by the array members, if any). + * The array members are written using {@link PolicyHelper}. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a policy array to write. + */ + public static void write(OutputStream output, Policy[] value) + { + output.write_long(value.length); + for (int i = 0; i < value.length; i++) + { + PolicyHelper.write(output, value [ i ]); + } + } +} diff --git a/libjava/classpath/org/omg/CORBA/PolicyListHolder.java b/libjava/classpath/org/omg/CORBA/PolicyListHolder.java new file mode 100644 index 000000000..fd3815afa --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyListHolder.java @@ -0,0 +1,106 @@ +/* PolicyListHolder.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.CORBA; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** +* A holder for the object <code>Policy[]</code>. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public final class PolicyListHolder + implements Streamable +{ + /** + * The stored Policy[] value. + */ + public Policy[] value; + + /** + * Create the uninitialised instance, leaving the value field + * with default <code>null</code> value. + */ + public PolicyListHolder() + { + } + + /** + * Create the initialised instance. + * @param initialValue the value that will be assigned to + * the <code>value</code> field. + */ + public PolicyListHolder(Policy[] initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link #value} by data from the CDR stream. + * Uses {@link PolicyListHelper}. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = PolicyListHelper.read(input); + } + + /** + * Write the stored value into the CDR stream. + * Uses {@link PolicyListHelper}. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + PolicyListHelper.write(output, value); + } + + /** + * Get the typecode of the Policy[]. + * Uses {@link PolicyListHelper}. + */ + public org.omg.CORBA.TypeCode _type() + { + return PolicyListHelper.type(); + } +} diff --git a/libjava/classpath/org/omg/CORBA/PolicyOperations.java b/libjava/classpath/org/omg/CORBA/PolicyOperations.java new file mode 100644 index 000000000..141eb1cba --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyOperations.java @@ -0,0 +1,70 @@ +/* PolicyOperation.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.CORBA; + +/** + * Defines the operations that can be applied to the {@link Policy} + * object. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface PolicyOperations +{ + /** + * Return a copy of this Policy. + * + * @return a copy of theis Policy, without any retained relationships + * to the previous domain or object. + */ + Policy copy(); + + /** + * Destroy the policy object. + */ + void destroy(); + + /** + * Return an integer number, corresponding the type of this policy. + * The values, defining the different policy types, are allocated + * by OMG (request AT omg DOT org). + * + * @return the integer policy code. + */ + int policy_type(); +} diff --git a/libjava/classpath/org/omg/CORBA/PolicyTypeHelper.java b/libjava/classpath/org/omg/CORBA/PolicyTypeHelper.java new file mode 100644 index 000000000..dc92d7707 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyTypeHelper.java @@ -0,0 +1,123 @@ +/* PolicyTypeHelper.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.CORBA; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* A helper operations for the policy type. A policy type is an integer +* constant and needs no helper, but the one is included to +* to facilitate the automated code handling. +* +* @specnote In this implementation, this class is not in use. Its "logical" +* place would be {@link ORB}, having the PolicyType type. These parameters +* are declarded as <coe>int</code> in the ORB interface. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class PolicyTypeHelper +{ + /** + * Create the PolicyType typecode (alias of CORBA ulong, named "PolicyType". + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "PolicyType", + orb.get_primitive_tc(TCKind.tk_ulong) + ); + } + + /** + * Insert the int into the given Any. + */ + public static void insert(Any any, int that) + { + any.insert_ulong(that); + } + + /** + * Extract the int from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain int. + */ + public static int extract(Any any) + { + return any.extract_ulong(); + } + + /** + * Get the int repository id. + * + * @return "IDL:omg.org/CORBA/PolicyType:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/PolicyType:1.0"; + } + + /** + * Read the int (policy type) from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static int read(InputStream input) + { + return input.read_ulong(); + } + + /** + * Write the int (policy type) to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, int value) + { + output.write_ulong(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/Principal.java b/libjava/classpath/org/omg/CORBA/Principal.java new file mode 100644 index 000000000..9832f228d --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/Principal.java @@ -0,0 +1,89 @@ +/* Principal.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.CORBA; + +/** + * This class was used to store the client identity in the past. + * The client identity is stored in the form of the <code>byte</code> + * array. + * + * @deprecated by CORBA 2.2. + * + * @author Audrius Meskauskas(AudriusA@Bioinformatics.org) + * + */ +public class Principal +{ + /** + * The field, holding the client identity. + */ + private byte[] m_name; + + /** + * @deprecated + */ + public Principal() + { + } + + /** + * Gets the name of the Principal. + * + * @deprecated by CORBA 2.2 + * + * @return a name of the Pricipal. + */ + public byte[] name() + { + /**@todo Override this org.omg.CORBA.Principal method*/ + return m_name; + } + + /** + * Sets the name of the Principal to the given value. + * + * @deprecated by CORBA 2.2 + * + * @param a_name a value to set the name to. + */ + public void name(byte[] a_name) + { + m_name = a_name; + } +} diff --git a/libjava/classpath/org/omg/CORBA/PrincipalHolder.java b/libjava/classpath/org/omg/CORBA/PrincipalHolder.java new file mode 100644 index 000000000..56cd565aa --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PrincipalHolder.java @@ -0,0 +1,122 @@ +/* PrincipalHolder.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.CORBA; + +import gnu.CORBA.typecodes.PrimitiveTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for storing an instance of {@link Principal}. + * + * @deprecated by CORBA 2.2. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class PrincipalHolder + implements Streamable +{ + /** + * The default type code for this holder. + */ + private static final TypeCode t_any = + new PrimitiveTypeCode(TCKind.tk_Principal); + + /** + * The instance of {@link Principal}, held by this holder. + */ + public Principal value; + + /** + * Constructs an instance of PrincipalHolder, + * initializing {@link #value} to <code>null</code>. + */ + public PrincipalHolder() + { + } + + /** + * Constructs an instance of PrincipalHolder, + * initializing {@link #value} to the passed parameter. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public PrincipalHolder(Principal initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For {@link Principal}, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_Principal}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_Principal(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return t_any; + } + + /** + * Write the {@link #value } field to the given stream. + * For {@link Principal} the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_Principal(Principal)} + * . + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_Principal(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/REBIND.java b/libjava/classpath/org/omg/CORBA/REBIND.java new file mode 100644 index 000000000..48a3ea42f --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/REBIND.java @@ -0,0 +1,99 @@ +/* REBIND.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.CORBA; + +import java.io.Serializable; + +/** + * Raised on the failure of the requested or implied attempt to + * rebind an object reference. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class REBIND + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID (v1.5) for interoperability. + */ + private static final long serialVersionUID = 823920851143467547L; + + /** + * Creates REBIND with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public REBIND(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates REBIND with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public REBIND() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a REBIND exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public REBIND(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created REBIND exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public REBIND(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/RepositoryIdHelper.java b/libjava/classpath/org/omg/CORBA/RepositoryIdHelper.java new file mode 100644 index 000000000..843958b22 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/RepositoryIdHelper.java @@ -0,0 +1,116 @@ +/* RepositoryIdHelper.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.CORBA; + +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 formal helper for the CORBA Repository Id that is identical to the + * narrow string. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class RepositoryIdHelper +{ + /** + * Insert the Repository Id into Any (uses {@link Any#insert_string}). + * + * @param a the Any to insert into. + * @param that the string to insert. + */ + public static void insert(Any a, String that) + { + a.insert_string(that); + } + + /** + * Extract the Repository Id from Any ((uses {@link Any#extract_string}). + * + * @param a the Any to extract from. + */ + public static String extract(Any a) + { + return a.extract_string(); + } + + /** + * Return an string alias typecode, named "RepositoryId" + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "RepositoryId", orb.create_string_tc(0)); + } + + /** + * Return the Repository Id repository id. + * @return "IDL:omg.org/CORBA/RepositoryId:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/RepositoryId: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 (Repository Id) value to write. + */ + public static void write(OutputStream ostream, String value) + { + ostream.write_string(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/Request.java b/libjava/classpath/org/omg/CORBA/Request.java new file mode 100644 index 000000000..cca242d6c --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/Request.java @@ -0,0 +1,242 @@ +/* Request.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.CORBA; + + +/** + * An object, containing the information, needed to invoke the method of + * the local or remote CORBA object. The Request is used in + * Dynamic Invocation Interface (DII) which allows dynamic creation of + * requests. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class Request +{ + /** + * Add the named input parameter that passes value to + * the method being invoked. This is similar to the "passing by value" + * conception. + * + * The created parameter is returned allowing to set the value. + * + * @return the created parameter. + */ + public abstract Any add_in_arg(); + + /** + * Add the input/output parameter that passes value both to and from + * the method being invoked. This is similar to the "passing by reference" + * conception. + * + * The created parameter is returned allowing to set the value. + * + * @return the created parameter. + */ + public abstract Any add_inout_arg(); + + /** + * Add the named input parameter that passes value to + * the method being invoked. This is similar to the "passing by value" + * conception. + * + * The created parameter is returned allowing to set the value. + * + * @param name the parameter name. + * + * @return the created parameter. + */ + public abstract Any add_named_in_arg(String name); + + /** + * Add the named input/output parameter that passes value both to and from + * the method being invoked. This is similar to the "passing by reference" + * conception. + * + * The created parameter is returned allowing to set the value. + * + * @param name the parameter name. + * + * @return the created parameter. + */ + public abstract Any add_named_inout_arg(String name); + + /** + * Add the named output parameter that passes value from + * the method being invoked. Differently from the java + * language, the CORBA IDL method can return multiple values. + * + * The created parameter is returned allowing to set the value. + * + * @param name the parameter name. + * + * @return the created parameter. + */ + public abstract Any add_named_out_arg(String name); + + /** + * Add the output parameter that passes value from + * the method being invoked. Differently from the java + * language, the CORBA IDL method can return multiple values. + * + * The created parameter is returned allowing to set the value. + * + * @return the created parameter. + */ + public abstract Any add_out_arg(); + + /** + * Return the list of all previously added parameters. + * + * @return the list of parameters. + */ + public abstract NVList arguments(); + + /** + * Get the context list object for this request. + * + * @return a list of strings that must be resolved and sent with the + * invocation. + */ + public abstract ContextList contexts(); + + /** + * Get the context, previously set using {@link #ctx(Context)}. + * The context contains the details about this request. + */ + public abstract Context ctx(); + + /** + * Set the context that shuld be later returned by {@link #ctx()}. + * This context contains the details about this request. + * + * @param a_context a context to set. + */ + public abstract void ctx(Context a_context); + + /** + * Returns the container, eclosing an exception that the invoked method + * has thrown. + * + * @return the Environment object, containng the exception. + */ + public abstract Environment env(); + + /** + * List the exceptions that may be thrown by the CORBA object method being + * invoked. + * + * @return the list of exceptions. + */ + public abstract ExceptionList exceptions(); + + /** + * Allow to access the response that has been previously sent using + * {@link #send_deferred()}. + * + * @throws WrongTransaction if the transaction scope mismatches. + */ + public abstract void get_response() + throws WrongTransaction; + + /** + * Submit the request, suspending the current thread until the + * answer is received. + */ + public abstract void invoke(); + + /** + * Get the name of the method being invoked. + * + * @return the name of the method being invoked. + */ + public abstract String operation(); + + /** + * Check if the response is received to the request that was + * previously send using {@link #send_deferred()}. + * + * @return true if the response has been already received, false otherwise. + */ + public abstract boolean poll_response(); + + /** + * Get the value, returned by the method, together with its name. + * + * @return the value, returned by the method. + */ + public abstract NamedValue result(); + + /** + * Get the value, returned by the method. + * + * @return the value, returned by the method. + */ + public abstract Any return_value(); + + /** + * Send a request without suspending the current thread. + * + * Allow later check of the request status by {@link #poll_response()} and + * retrieving the results by {@link #get_response()}. + */ + public abstract void send_deferred(); + + /** + * Send a request and forget about it, not waiting for a response. + * This can be done also for methods that normally are expected + * to return some values. + */ + public abstract void send_oneway(); + + /** + * Set the return type. + * + * @param returns the type of the value, returned in response to this + * request. + */ + public abstract void set_return_type(TypeCode returns); + + /** + * Return the CORBA object on that the method would be invoked. + * + * @return the invocation target. + */ + public abstract org.omg.CORBA.Object target(); +} diff --git a/libjava/classpath/org/omg/CORBA/ServerRequest.java b/libjava/classpath/org/omg/CORBA/ServerRequest.java new file mode 100644 index 000000000..38bb9fe90 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ServerRequest.java @@ -0,0 +1,164 @@ +/* ServerRequest.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.CORBA; + +/** + * This class was expected to be part of the dynamic skeleton interface, + * but it is almost never used in the code, generated by IDL to java compiler. + * The recent tendention is to skip the request step, reading the method + * arguments from the CDR input stream directly. The supplementing class + * {@link DynamicImplementation} has already been deprecated in java 1.2 + * version. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ServerRequest +{ + /** + * Get the context information. + */ + public abstract Context ctx(); + + /** + * Should return the name of the operation (method) being invoked. + * Following the 1.4 specification, it does not, and must be overridden to + * get functionality. + * + * @return the name of the operation being invoked. The object attribute + * access operations are called _get_<attribute_name> + * and _set_<attribute_name>. + * + * @throws NO_IMPLEMENT, always. + */ + public String operation() + { + throw new NO_IMPLEMENT(); + } + + /** + * Should specify the method parameter types and retrieve the + * values that must be passed to the method being called. Following + * the 1.4 specification, it does not, and must be overridden to + * get functionality. + * + * @param args the method parameters. + * + * @throws NO_IMPLEMENT, always. + */ + public void arguments(NVList args) + { + throw new NO_IMPLEMENT(); + } + + /** + * Should specify the return value for the call. Following + * the 1.4 specification, it does not, and must be overridden to + * get functionality. + * + * @param result the return value. + * + * @throws NO_IMPLEMENT, always. + */ + public void set_result(Any result) + { + throw new NO_IMPLEMENT(); + } + + /** + * Should set the exception that has been thrown during + * the method invocation. Following the 1.4 specification, it does not, + * and must be overridden to get functionality. + * + * @param exc the Any, holding the exception. + * + * @throws NO_IMPLEMENT, always. + */ + public void set_exception(Any exc) + { + throw new NO_IMPLEMENT(); + } + + /** + * This method is deprecated, {@link #set_result} (same parameter). + * + * @deprecated since 1.2 + * + * @throws NO_IMPLEMENT, always. + */ + public void result(Any r) + { + throw new NO_IMPLEMENT(); + } + + /** + * This method is deprecated, use {@link #set_exception} (same parameter). + * + * @deprecated since 1.2. + * + * @throws NO_IMPLEMENT, always. + */ + public void except(Any exc) + { + throw new NO_IMPLEMENT(); + } + + /** + * This method is deprecated, use {@link #arguments} (same parameter). + * + * @deprecated since 1.2 + * + * @throws NO_IMPLEMENT, always. + */ + public void params(NVList args) + { + throw new NO_IMPLEMENT(); + } + + /** + * This method is deprecated, use {@link #operation} (same parameter). + * + * @deprecated since 1.2 + * + * @throws NO_IMPLEMENT, always. + */ + public String op_name() + { + throw new NO_IMPLEMENT(); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ServiceDetail.java b/libjava/classpath/org/omg/CORBA/ServiceDetail.java new file mode 100644 index 000000000..a709f7cf0 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ServiceDetail.java @@ -0,0 +1,81 @@ +/* ServiceDetail.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.CORBA; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * An object, representing one of the additional details about the + * particular ORB service. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class ServiceDetail + implements IDLEntity +{ + /** + * The type of the information, defined by this detail. + */ + public int service_detail_type; + + /** + * The binary data, defining the information. + */ + public byte[] service_detail; + + /** + * Create an unitialised instance. + */ + public ServiceDetail() + { + } + + /** + * Create the instance of the service detail, initialising its fields + * to the given values. + * + * @param _service_detail_type the service detail type. + * @param _service_detail the service detail. + */ + public ServiceDetail(int _service_detail_type, byte[] _service_detail) + { + service_detail_type = _service_detail_type; + service_detail = _service_detail; + } +} diff --git a/libjava/classpath/org/omg/CORBA/ServiceDetailHelper.java b/libjava/classpath/org/omg/CORBA/ServiceDetailHelper.java new file mode 100644 index 000000000..4c17a99ce --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ServiceDetailHelper.java @@ -0,0 +1,169 @@ +/* ServiceDetailHelper.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.CORBA; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; +import gnu.CORBA.ServiceDetailHolder; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations on the Service Detail. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ServiceDetailHelper +{ + /** + * The service detail repository id. + */ + private static String _id = "IDL:omg.org/CORBA/ServiceDetail:1.0"; + + /** + * Extract the service detail info from the given {@link Any} + * + * @param a the Any to extract from. + * + * @return the extracted detail. + * + * @throws BAD_OPERATION if the parameter holds something different + * from the ServiceDetail. + */ + public static ServiceDetail extract(Any a) + { + try + { + return ((ServiceDetailHolder) a.extract_Streamable()).value; + } + catch (ClassCastException ex) + { + BAD_OPERATION bad = new BAD_OPERATION(); + bad.initCause(ex); + bad.minor = Minor.Any; + throw bad; + } + } + + /** + * Get the service detail repository id. + * + * @return the service detail repository id, + * <code>IDL:omg.org/CORBA/ServiceDetail:1.0</code>, always. + */ + public static String id() + { + return _id; + } + + /** + * Insert the service detail into the given {@link Any}. + * + * @param a the Any to insert into. + * + * @param that the detail to insert. + */ + public static void insert(Any a, ServiceDetail that) + { + a.insert_Streamable(new ServiceDetailHolder(that)); + } + + /** + * Read the service detail information from the given CDR + * intput stream. First reads the type, then the flexible + * length byte sequence. + * + * @param istream a stram to read from. + * + * @return the loaded service detail. + */ + public static ServiceDetail read(InputStream istream) + { + ServiceDetail value = new ServiceDetail(); + value.service_detail_type = istream.read_ulong(); + + int l = istream.read_long(); + value.service_detail = new byte[ l ]; + istream.read_octet_array(value.service_detail, 0, l); + return value; + } + + /** + * Get the typecode of the service detail, assuming to be it + * a structure with the two fields. + * + * @return the newly created or cached typecode value. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + + StructMember[] members = new StructMember[ 2 ]; + + TypeCode type = + orb.create_alias_tc(_id, "ServiceDetailType", + orb.get_primitive_tc(TCKind.tk_ulong) + ); + members [ 0 ] = new StructMember("service_detail_type", type, null); + + TypeCode data = + orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet)); + members [ 1 ] = new StructMember("service_detail", data, null); + + return orb.create_struct_tc(id(), "ServiceDetail", members); + } + + /** + * Write the service detail data to the given CDR output stream. + * Writes the detail type first, then the detail type data + * as the variable length byte sequence. + * + * @param ostream a stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream ostream, ServiceDetail value) + { + ostream.write_ulong(value.service_detail_type); + ostream.write_long(value.service_detail.length); + ostream.write_octet_array(value.service_detail, 0, + value.service_detail.length + ); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ServiceInformation.java b/libjava/classpath/org/omg/CORBA/ServiceInformation.java new file mode 100644 index 000000000..c4ec7f1da --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ServiceInformation.java @@ -0,0 +1,88 @@ +/* ServiceInformation.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.CORBA; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * Stores information about the CORBA service, available from some ORB. + * + * This class is part of the service information support, but the + * 1.4 API specification states that this support should be not implemented. + * + * @see ORB#get_service_information + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class ServiceInformation + implements IDLEntity +{ + /** + * The array of service details, defining the various aspects of this + * service. + */ + public ServiceDetail[] service_details; + + /** + * The array, defining various options of this service. + */ + public int[] service_options; + + /** + * Create an unitialised instance of the service information. + */ + public ServiceInformation() + { + } + + /** + * Create an instance of the service information, intialised with + * the passed values. + * + * @param _service_options the service options. + * @param _service_details the service details. + */ + public ServiceInformation(int[] _service_options, + ServiceDetail[] _service_details + ) + { + service_options = _service_options; + service_details = _service_details; + } +} diff --git a/libjava/classpath/org/omg/CORBA/ServiceInformationHelper.java b/libjava/classpath/org/omg/CORBA/ServiceInformationHelper.java new file mode 100644 index 000000000..1da4358a6 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ServiceInformationHelper.java @@ -0,0 +1,147 @@ +/* ServiceInformationHelper.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.CORBA; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * Helper operations for the service information. + * + * This class is part of the service information support, but the + * 1.4 API specification states that this support should be not implemented. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ServiceInformationHelper +{ + /** + * The service information repository id. + */ + private static String _id = "IDL:org/omg/CORBA/ServiceInformation:1.0"; + + /** + * Extract the service information from the given Any. + */ + public static ServiceInformation extract(Any a) + { + return read(a.create_input_stream()); + } + + /** + * Get the service information repositroy id. + */ + public static String id() + { + return _id; + } + + /** + * Insert the service information into the given Any. + */ + public static void insert(Any a, ServiceInformation that) + { + OutputStream out = a.create_output_stream(); + a.type(type()); + write(out, that); + a.read_value(out.create_input_stream(), type()); + } + + /** + * Read the service information from the given CDR input stream. + */ + public static ServiceInformation read(InputStream istream) + { + ServiceInformation value = new ServiceInformation(); + value.service_options = LongSeqHelper.read(istream); + + int n = istream.read_ulong(); + value.service_details = new ServiceDetail[ n ]; + + for (int i = 0; i < n; i++) + value.service_details [ i ] = ServiceDetailHelper.read(istream); + return value; + } + + /** + * Get the service information typecode. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + + StructMember[] members = new StructMember[ 2 ]; + TypeCode member; + + member = + orb.create_alias_tc("IDL:omg.org/CORBA/ServiceOptionSeq:1.0", + "ServiceOptionSeq", LongSeqHelper.type() + ); + + members [ 0 ] = new StructMember("service_options", member, null); + + member = ServiceDetailHelper.type(); + member = orb.create_sequence_tc(0, member); + member = + orb.create_alias_tc("IDL:omg.org/CORBA/ServiceDetailSeq:1.0", + "ServiceDetailSeq", member + ); + members [ 1 ] = new StructMember("service_details", member, null); + + return + orb.create_struct_tc(ServiceInformationHelper.id(), + "ServiceInformation", members + ); + } + + /** + * Write the service information to the given CDR output stream. + */ + public static void write(OutputStream ostream, ServiceInformation value) + { + LongSeqHelper.write(ostream, value.service_options); + + ostream.write_ulong(value.service_details.length); + + for (int i = 0; i < value.service_details.length; i++) + ServiceDetailHelper.write(ostream, value.service_details [ i ]); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ServiceInformationHolder.java b/libjava/classpath/org/omg/CORBA/ServiceInformationHolder.java new file mode 100644 index 000000000..7b15d6f1f --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ServiceInformationHolder.java @@ -0,0 +1,101 @@ +/* ServiceInformationHolder.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.CORBA; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for the service information. + * + * This class is part of the service information support, but the + * 1.4 API specification states that this support should be not implemented. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class ServiceInformationHolder + implements Streamable +{ + /** + * A wrapped value. + */ + public ServiceInformation value; + + /** + * Create an unitialised instance. + */ + public ServiceInformationHolder() + { + } + + /** + * Create the instance where the stored service information + * s intialised into the given value. + */ + public ServiceInformationHolder(ServiceInformation initialValue) + { + value = initialValue; + } + + /** + * Read the service information from the given CDR input stream. + */ + public void _read(InputStream in) + { + value = ServiceInformationHelper.read(in); + } + + /** + * Get the typecode of the service information. + */ + public TypeCode _type() + { + return ServiceInformationHelper.type(); + } + + /** + * Write the stored service information into the given + * CDR output stream. + */ + public void _write(OutputStream out) + { + ServiceInformationHelper.write(out, value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/SetOverrideType.java b/libjava/classpath/org/omg/CORBA/SetOverrideType.java new file mode 100644 index 000000000..ebf906cbc --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/SetOverrideType.java @@ -0,0 +1,136 @@ +/* SetOverrideType.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.CORBA; + +import java.io.Serializable; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * Defines the instruction, how the newly specified policies can be + * taken into consideration. The policies can be either + * added to the current policies or replace them. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public class SetOverrideType + implements Serializable, IDLEntity +{ + /** + * Use v 1.4 serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -2761857189425106972L; + + /** + * Add the new policies to the existing policies. + */ + public static final int _ADD_OVERRIDE = 1; + + /** + * Replace the new existing policies by the new policies. + */ + public static final int _SET_OVERRIDE = 0; + + /** + * Add the new policies to the existing policies. + * An instance of SetOverrideType, initialized to _ADD_OVERRIDE. + */ + public static final SetOverrideType ADD_OVERRIDE = + new SetOverrideType(_ADD_OVERRIDE); + + /** + * Replace the new existing policies by the new policies. + * An instance of SetOverrideType, initialized to _SET_OVERRIDE. + */ + public static final SetOverrideType SET_OVERRIDE = + new SetOverrideType(_SET_OVERRIDE); + + private final int _value; + + /** + * No other instances can be created. + */ + protected SetOverrideType(int a_value) + { + _value = a_value; + } + + /** + * Returns the SetOverrideType, matching the given integer constant + * @param kind one of _ADD_OVERRIDE or _SET_OVERRIDE. + * + * @return one of ADD_OVERRIDE or SET_OVERRIDE. + * + * @throws BAD_PARAM if the parameter is not one of these two values. + */ + public static SetOverrideType from_int(int kind) + { + switch (kind) + { + case _ADD_OVERRIDE : + return ADD_OVERRIDE; + + case _SET_OVERRIDE : + return SET_OVERRIDE; + + default : + throw new BAD_PARAM("invalid add/override type " + kind); + } + } + + /** + * Returns a short string representation. + * + * @return either "add" or "replace". + */ + public String toString() + { + return (_value == _ADD_OVERRIDE) ? "add" : "replace"; + } + + /** + * Returns the value, representing stored instruction. + * + * @return one of ADD_OVERRIDE or SET_OVERRIDE + */ + public int value() + { + return _value; + } +} diff --git a/libjava/classpath/org/omg/CORBA/SetOverrideTypeHelper.java b/libjava/classpath/org/omg/CORBA/SetOverrideTypeHelper.java new file mode 100644 index 000000000..84c2a016d --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/SetOverrideTypeHelper.java @@ -0,0 +1,119 @@ +/* SetOverrideTypeHelper.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.CORBA; + +import gnu.CORBA.SetOverrideTypeHolder; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A helper operations for the definition kind. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class SetOverrideTypeHelper +{ + /** + * Insert the definition kind into the given Any. + */ + public static void insert(Any any, SetOverrideType that) + { + any.insert_Streamable(new SetOverrideTypeHolder(that)); + } + + /** + * Extract the definition kind from the given Any. + */ + public static SetOverrideType extract(Any any) + { + return ((SetOverrideTypeHolder) any.extract_Streamable()).value; + } + + /** + * Get the definition kind typecode (enumeration, named "SetOverrideType"). + * The typecode states that the enumeration can obtain one of + * the following values: SET_OVERRIDE ,ADD_OVERRIDE . + */ + public static TypeCode type() + { + String[] members = + new String[] + { + "SET_OVERRIDE" ,"ADD_OVERRIDE" + }; + + return + OrbRestricted.Singleton.create_enum_tc(id(), "SetOverrideType", + members + ); + } + + /** + * Get the definition kind repository id. + * + * @return "IDL:omg.org/CORBA/SetOverrideType:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/SetOverrideType:1.0"; + } + + /** + * Read the enumeration value (as int) from the CDR intput stream. + * + * @param istream a stream to read from.* + */ + public static SetOverrideType read(InputStream istream) + { + return SetOverrideType.from_int(istream.read_long()); + } + + /** + * Write the enumeration value (as int) to the CDR output stream. + * + * @param ostream a stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream ostream, SetOverrideType value) + { + ostream.write_long(value.value()); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ShortHolder.java b/libjava/classpath/org/omg/CORBA/ShortHolder.java new file mode 100644 index 000000000..59bd4cf33 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ShortHolder.java @@ -0,0 +1,127 @@ +/* ShortHolder.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.CORBA; + +import gnu.CORBA.typecodes.PrimitiveTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for CORBA <code>short</code> that is mapped into + * java <code>short</code>. + * + * The holders have several application areas. The end user usually + * sees them implementing CORBA methods where the primitive type + * is passed by reference. While CORBA (or, for example, C) supports + * this, the java does not and a wrapper class is required. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class ShortHolder + implements Streamable +{ + /** + * The default type code for this holder. + */ + private static final TypeCode t_short = + new PrimitiveTypeCode(TCKind.tk_short); + + /** + * The <code>short</code> (CORBA <code>short</code>) value, + * held by this ShortHolder. + */ + public short value; + + /** + * Constructs an instance of ShortHolder, + * initializing {@link #value} to <code>0</code>. + */ + public ShortHolder() + { + } + + /** + * Constructs an instance of ShortHolder, + * initializing {@link #value} to the given <code>short</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public ShortHolder(short initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For <code>short</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_short}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_short(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return t_short; + } + + /** + * Write the {@link #value } field to the given stream. + * For <code>short</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_short(short) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_short(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ShortSeqHelper.java b/libjava/classpath/org/omg/CORBA/ShortSeqHelper.java new file mode 100644 index 000000000..5140bb966 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ShortSeqHelper.java @@ -0,0 +1,143 @@ +/* ShortSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA sequence of <code>short</code> + * (<code>ShortSeq</code>). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class ShortSeqHelper +{ + /** + * Extract the <code>short[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link ShortSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link ShortSeqHolder}. + */ + public static short[] extract(Any a) + { + ShortSeqHolder h = (ShortSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>short[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link ShortSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, short[] that) + { + ShortSeqHolder holder = new ShortSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>short[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static short[] read(InputStream input) + { + short[] value = new short[ input.read_long() ]; + input.read_short_array(value, 0, value.length); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>ShortSeq</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_short); + } + + /** + * Writes the <code>short[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, short[] value) + { + output.write_long(value.length); + output.write_short_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ShortSeqHolder.java b/libjava/classpath/org/omg/CORBA/ShortSeqHolder.java new file mode 100644 index 000000000..b25024e98 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ShortSeqHolder.java @@ -0,0 +1,126 @@ +/* ShortSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>ShortSeq</code> that is mapped into + * java <code>short[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class ShortSeqHolder + implements Streamable +{ + /** + * The <code>short[]</code> (CORBA <code>ShortSeq</code>) value, + * held by this ShortSeqHolder. + */ + public short[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_short); + + /** + * Constructs an instance of ShortSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public ShortSeqHolder() + { + } + + /** + * Constructs an instance of ShortSeqHolder, + * initializing {@link #value} to the given <code>short[]</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public ShortSeqHolder(short[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.InputStream#read_short_array }. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new short[ input.read_long() ]; + input.read_short_array(value, 0, value.length); + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.OutputStream#write_short_array }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + output.write_short_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/StringHolder.java b/libjava/classpath/org/omg/CORBA/StringHolder.java new file mode 100644 index 000000000..ac45c562c --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/StringHolder.java @@ -0,0 +1,128 @@ +/* StringHolder.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.CORBA; + +import gnu.CORBA.typecodes.StringTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for CORBA <code>string</code> that is mapped into + * java <code>String</code>. + * + * The holders have several application areas. The end user usually + * sees them implementing CORBA methods where the primitive type + * is passed by reference. While CORBA (or, for example, C) supports + * this, the java does not and a wrapper class is required. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class StringHolder + implements Streamable +{ + /** + * The default type code for this holder. + */ + private static final StringTypeCode t_string = + new StringTypeCode(TCKind.tk_string); + + /** + * The <code>String</code> (CORBA <code>string</code>) value, + * held by this StringHolder. + */ + public String value; + + /** + * Constructs an instance of StringHolder, + * initializing {@link #value} to <code>null</code>. + */ + public StringHolder() + { + } + + /** + * Constructs an instance of StringHolder, + * initializing {@link #value} to the given <code>String</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public StringHolder(String initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. For <code>string</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_string}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_string(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. The {@link TypeCode#length()} method of the + * returned typecode always returns 0. + */ + public TypeCode _type() + { + return t_string; + } + + /** + * Write the {@link #value } field to the given stream. + * For <code>string</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_string(String) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_string(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/StringSeqHelper.java b/libjava/classpath/org/omg/CORBA/StringSeqHelper.java new file mode 100644 index 000000000..19f27292c --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/StringSeqHelper.java @@ -0,0 +1,145 @@ +/* StringSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA <code>string</code> array. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class StringSeqHelper +{ + /** + * Extract the <code>String[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link StringSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link StringSeqHolder}. + */ + public static String[] extract(Any a) + { + StringSeqHolder h = (StringSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>String[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link StringSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, String[] that) + { + StringSeqHolder holder = new StringSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>String[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static String[] read(InputStream input) + { + String[] value = new String[ input.read_long() ]; + for (int i = 0; i < value.length; i++) + value [ i ] = input.read_string(); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>string[]</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_string); + } + + /** + * Writes the <code>String[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, String[] value) + { + output.write_long(value.length); + + for (int i = 0; i < value.length; i++) + output.write_string(value [ i ]); + } +} diff --git a/libjava/classpath/org/omg/CORBA/StringSeqHolder.java b/libjava/classpath/org/omg/CORBA/StringSeqHolder.java new file mode 100755 index 000000000..1bc3281d3 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/StringSeqHolder.java @@ -0,0 +1,131 @@ +/* StringSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>string[]</code> that is mapped into + * java <code>String[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class StringSeqHolder + implements Streamable +{ + /** + * The <code>String[]</code> (CORBA <code>string[]</code>) value, + * held by this StringSeqHolder. + */ + public String[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_char); + + /** + * Constructs an instance of StringSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public StringSeqHolder() + { + } + + /** + * Constructs an instance of StringSeqHolder, + * initializing {@link #value} to the given <code>String</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public StringSeqHolder(String[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>and then all strings. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new String[ input.read_long() ]; + for (int i = 0; i < value.length; i++) + { + value [ i ] = input.read_string(); + } + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code> and then all strings. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + + for (int i = 0; i < value.length; i++) + { + output.write_string(value [ i ]); + } + } +} diff --git a/libjava/classpath/org/omg/CORBA/StringValueHelper.java b/libjava/classpath/org/omg/CORBA/StringValueHelper.java new file mode 100644 index 000000000..197957a08 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/StringValueHelper.java @@ -0,0 +1,193 @@ +/* StringValueHelper.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.CORBA; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.portable.BoxedValueHelper; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import java.io.Serializable; + +/** + * Provides helper operations for the String value type, treating a + * String as a CORBA value type rather than as a primitive type. The OMG + * specification states this may be convenient in some specific + * cases. The typecode is different, but the reading/writing format in + * this implementation is the same as for the ordinary string. This is + * that Sun's IDL compiler (v1.4) would generate. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public class StringValueHelper + implements BoxedValueHelper +{ + /** + * The String value helper repository Id. + */ + private static final String id = "IDL:omg.org/CORBA/StringValue:1.0"; + + /** + * The String typecode. + */ + private static final TypeCode tString = + OrbRestricted.Singleton.create_string_tc(0); + + /** + * Returns the String Value repository Id. + * @return "IDL:omg.org/CORBA/StringValue:1.0", always. + */ + public String get_id() + { + return id; + } + + /** + * Returns the String Value repository Id. + * @return "IDL:omg.org/CORBA/StringValue:1.0", always. + */ + public static String id() + { + return id; + } + + /** + * Read the string value from the input stream. + * + * @param istream a stream to read from. + * + * @return a string (delegates to read_string()). + */ + public Serializable read_value(InputStream istream) + { + return istream.read_string(); + } + + /** + * Write the given string value into the output stream. + * + * @param ostream a stream to write into. + * @param a_string a string to write. + */ + public void write_value(OutputStream ostream, Serializable a_string) + { + try + { + ostream.write_string((String) a_string); + } + catch (ClassCastException ex) + { + MARSHAL m = new MARSHAL("String expected"); + m.minor = Minor.ClassCast; + throw m; + } + } + + /** + * Extract the string from the given Any. The operation + * requires Any to hold a String value and not a String. + * + * @param an_any an Any to extract from. + * + * @return the extracted string. + */ + public static String extract(Any an_any) + { + if (an_any.type().equal(type())) + { + an_any.type(tString); + return an_any.extract_string(); + } + else + { + BAD_OPERATION bad = new BAD_OPERATION("String value type expected"); + bad.minor = Minor.Any; + throw bad; + } + } + + /** + * Insert the string into the given Any. After the operation, + * the Any will have a String Value typecode and not a + * String typecode. + * + * @param an_any an Any to insert into. + * + * @param that a string to insert. + */ + public static void insert(Any an_any, String that) + { + an_any.insert_string(that); + an_any.type(type()); + } + + /** + * Reads a string as a value type. + * + * @param in a stream to read value from. + */ + public static String read(InputStream in) + { + return in.read_string(); + } + + /** + * Create and return the value box typecode, named "StringValue", with the + * content typecode being unbounded string. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_value_box_tc(id(), "StringValue", tString); + } + + /** + * Writes a string as a value type. + * + * @param out a stream to write value into. + * + * @param a_string a string to write. + */ + public static void write(OutputStream out, String a_string) + { + out.write_string(a_string); + } +} diff --git a/libjava/classpath/org/omg/CORBA/StructMember.java b/libjava/classpath/org/omg/CORBA/StructMember.java new file mode 100644 index 000000000..09245b404 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/StructMember.java @@ -0,0 +1,94 @@ +/* StructMember.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.CORBA; + +import java.io.Serializable; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * The component, describing the member of CORBA IDL <code>struct</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class StructMember + implements IDLEntity, Serializable +{ + /** + * Use 1.4 version serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 2762280796480753206L; + + /** + * The IDL type of the structure member. + */ + public IDLType type_def; + + /** + * The name of the structure member. + */ + public String name; + + /** + * The typecode of the structure member. + */ + public TypeCode type; + + /** + * Creates a structure member with all fields + * left with the default value <code>null</code>. + */ + public StructMember() + { + } + + /** + * Creates a structure member. + * + * @param a_name member name. + * @param a_type member type code. + * @param a_type_def member IDL type definition. + */ + public StructMember(String a_name, TypeCode a_type, IDLType a_type_def) + { + name = a_name; + type = a_type; + type_def = a_type_def; + } +} diff --git a/libjava/classpath/org/omg/CORBA/StructMemberHelper.java b/libjava/classpath/org/omg/CORBA/StructMemberHelper.java new file mode 100644 index 000000000..9a310cffe --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/StructMemberHelper.java @@ -0,0 +1,180 @@ +/* StructMemberHelper.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.CORBA; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; +import gnu.CORBA.TypeCodeHelper; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * Defines a helper operations for StructMember. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class StructMemberHelper +{ + /** + * The cached typecode value, computed once. + */ + private static TypeCode typeCode; + + /** + * This flag is used when creating typecodes for the recursive structures. + */ + private static boolean active; + + /** + * Insert the structure member into the given Any. + */ + public static void insert(Any a, StructMember that) + { + OutputStream out = a.create_output_stream(); + a.type(type()); + write(out, that); + a.read_value(out.create_input_stream(), type()); + } + + /** + * Extract the structure member from the given Any. + */ + public static StructMember extract(Any a) + { + return read(a.create_input_stream()); + } + + /** + * Get a typecode for the StructMember. + */ + public static synchronized TypeCode type() + { + if (typeCode == null) + { + ORB orb = OrbRestricted.Singleton; + + synchronized (TypeCode.class) + { + if (typeCode == null) + { + if (active) + { + return orb.create_recursive_tc(id()); + } + active = true; + + StructMember[] members = new StructMember[ 3 ]; + TypeCode member = null; + + member = orb.create_string_tc(0); + member = + orb.create_alias_tc(IdentifierHelper.id(), "Identifier", + member + ); + members [ 0 ] = new StructMember("name", member, null); + + member = orb.get_primitive_tc(TCKind.tk_TypeCode); + + members [ 1 ] = new StructMember("type", member, null); + members [ 2 ] = + new StructMember("type_def", IDLTypeHelper.type(), null); + typeCode = + orb.create_struct_tc(StructMemberHelper.id(), "StructMember", + members + ); + active = false; + } + } + } + return typeCode; + } + + /** + * Return the StructMember repository id. + * + * @return "IDL:omg.org/CORBA/StructMember:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/StructMember:1.0"; + } + + /** + * Read the StructMember from the input stream. + */ + public static StructMember read(InputStream istream) + { + try + { + StructMember value = new StructMember(); + value.name = istream.read_string(); + value.type = TypeCodeHelper.read(istream); + value.type_def = IDLTypeHelper.read(istream); + return value; + } + catch (UserException ex) + { + MARSHAL m = new MARSHAL(); + m.minor = Minor.UserException; + m.initCause(ex); + throw m; + } + } + + /** + * Write the StructMember to the input stream. + */ + public static void write(OutputStream ostream, StructMember value) + { + try + { + ostream.write_string(value.name); + TypeCodeHelper.write(ostream, value.type); + IDLTypeHelper.write(ostream, value.type_def); + } + catch (UserException ex) + { + MARSHAL m = new MARSHAL(); + m.minor = Minor.UserException; + m.initCause(ex); + throw m; + } + } +} diff --git a/libjava/classpath/org/omg/CORBA/SystemException.java b/libjava/classpath/org/omg/CORBA/SystemException.java new file mode 100644 index 000000000..6c5c5f968 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/SystemException.java @@ -0,0 +1,95 @@ +/* SystemException.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.CORBA; + +import java.io.Serializable; + +/** + * The root class for all CORBA standard exceptions. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class SystemException + extends RuntimeException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. Using the version 1.4 UID. + */ + private static final long serialVersionUID = -8486391734674855519L; + + /** + * The status of the operation that have thrown this exception. + */ + public CompletionStatus completed; + + /** + * <p> + * Contains more details about the exception. The lower 12 bits contain a + * code, defining the reason why exception has been thrown. The higher 20 bits + * hold "Vendor Minor Codeset ID" (VMCID). + * </p> + * <p> + * The Classpath specifice minor exception codes are documented in the headers + * of the corresponding exceptions (for instance, {@link MARSHAL}). + * </p> + * + * The VMCID 0 and 0xfffff are reserved for experimental use. + * + * @see OMGVMCID + */ + public int minor; + + /** + * Constructs an instance of the CORBA standard exception. + * + * @param a_reason a string, explaining the reason why the exceptions has been + * thrown. + * @param a_minor an additional error code (known as the "minor") + * @param a_completed the task completion status. + */ + protected SystemException(String a_reason, int a_minor, + CompletionStatus a_completed) + { + super(a_reason + " Minor: " + Integer.toHexString(a_minor) + " (" + + (a_minor & 0xFFF) + "). Completed: "+a_completed); + minor = a_minor; + completed = a_completed; + } +} diff --git a/libjava/classpath/org/omg/CORBA/TCKind.java b/libjava/classpath/org/omg/CORBA/TCKind.java new file mode 100644 index 000000000..62b905367 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TCKind.java @@ -0,0 +1,504 @@ +/* TCKind.java -- java to IDL mapping constants. + 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.CORBA; + + +/** + * The basic constants, used in java to IDL mapping. + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public class TCKind +{ + /** + * The integer constant, indicating IDL data type + * <code>null</code>. + */ + public static final int _tk_null = 0; + + /** + * The integer constant, indicating IDL data type + * <code>void</code>. + */ + public static final int _tk_void = 1; + + /** + * The integer constant, indicating IDL data type + * <code>short</code>. + */ + public static final int _tk_short = 2; + + /** + * The integer constant, indicating IDL data type + * <code>long</code>. + */ + public static final int _tk_long = 3; + + /** + * The integer constant, indicating IDL data type + * <code>ushort</code>. + */ + public static final int _tk_ushort = 4; + + /** + * The integer constant, indicating IDL data type + * <code>ulong</code>. + */ + public static final int _tk_ulong = 5; + + /** + * The integer constant, indicating IDL data type + * <code>float</code>. + */ + public static final int _tk_float = 6; + + /** + * The integer constant, indicating IDL data type + * <code>double</code>. + */ + public static final int _tk_double = 7; + + /** + * The integer constant, indicating IDL data type + * <code>boolean</code>. + */ + public static final int _tk_boolean = 8; + + /** + * The integer constant, indicating IDL data type + * <code>char</code>. + */ + public static final int _tk_char = 9; + + /** + * The integer constant, indicating IDL data type + * <code>octet</code>. + */ + public static final int _tk_octet = 10; + + /** + * The integer constant, indicating IDL data type + * <code>any</code>. + */ + public static final int _tk_any = 11; + + /** + * The integer constant, indicating IDL data type + * <code>TypeCode</code>. + */ + public static final int _tk_TypeCode = 12; + + /** + * The integer constant, indicating IDL data type + * <code>Principal</code>. + */ + public static final int _tk_Principal = 13; + + /** + * The integer constant, indicating IDL data type + * <code>objref</code>. + */ + public static final int _tk_objref = 14; + + /** + * The integer constant, indicating IDL data type + * <code>struct</code>. + */ + public static final int _tk_struct = 15; + + /** + * The integer constant, indicating IDL data type + * <code>union</code>. + */ + public static final int _tk_union = 16; + + /** + * The integer constant, indicating IDL data type + * <code>enum</code>. + */ + public static final int _tk_enum = 17; + + /** + * The integer constant, indicating IDL data type + * <code>string</code>. + */ + public static final int _tk_string = 18; + + /** + * The integer constant, indicating IDL data type + * <code>sequence</code>. + */ + public static final int _tk_sequence = 19; + + /** + * The integer constant, indicating IDL data type + * <code>array</code>. + */ + public static final int _tk_array = 20; + + /** + * The integer constant, indicating IDL data type + * <code>alias</code>. + */ + public static final int _tk_alias = 21; + + /** + * The integer constant, indicating IDL data type + * <code>except</code>. + */ + public static final int _tk_except = 22; + + /** + * The integer constant, indicating IDL data type + * <code>longlong</code>. + */ + public static final int _tk_longlong = 23; + + /** + * The integer constant, indicating IDL data type + * <code>ulonglong</code>. + */ + public static final int _tk_ulonglong = 24; + + /** + * The integer constant, indicating IDL data type + * <code>longdouble</code>. + */ + public static final int _tk_longdouble = 25; + + /** + * The integer constant, indicating IDL data type + * <code>wchar</code>. + */ + public static final int _tk_wchar = 26; + + /** + * The integer constant, indicating IDL data type + * <code>wstring</code>. + */ + public static final int _tk_wstring = 27; + + /** + * The integer constant, indicating IDL data type + * <code>fixed</code>. + */ + public static final int _tk_fixed = 28; + + /** + * The integer constant, indicating IDL data type + * <code>value</code>. + */ + public static final int _tk_value = 29; + + /** + * The integer constant, indicating IDL data type + * <code>value_box</code>. + */ + public static final int _tk_value_box = 30; + + /** + * The integer constant, indicating IDL data type + * <code>native</code>. + */ + public static final int _tk_native = 31; + + /** + * The integer constant, indicating IDL data type + * <code>abstract_interface</code>. + */ + public static final int _tk_abstract_interface = 32; + + /** + * The TCKind constant, indicating IDL data type + * <code>null</code> + */ + public static final TCKind tk_null = new TCKind(_tk_null); + + /** + * The TCKind constant, indicating IDL data type + * <code>void</code> + */ + public static final TCKind tk_void = new TCKind(_tk_void); + + /** + * The TCKind constant, indicating IDL data type + * <code>short</code> + */ + public static final TCKind tk_short = new TCKind(_tk_short); + + /** + * The TCKind constant, indicating IDL data type + * <code>long</code> + */ + public static final TCKind tk_long = new TCKind(_tk_long); + + /** + * The TCKind constant, indicating IDL data type + * <code>ushort</code> + */ + public static final TCKind tk_ushort = new TCKind(_tk_ushort); + + /** + * The TCKind constant, indicating IDL data type + * <code>ulong</code> + */ + public static final TCKind tk_ulong = new TCKind(_tk_ulong); + + /** + * The TCKind constant, indicating IDL data type + * <code>float</code> + */ + public static final TCKind tk_float = new TCKind(_tk_float); + + /** + * The TCKind constant, indicating IDL data type + * <code>double</code> + */ + public static final TCKind tk_double = new TCKind(_tk_double); + + /** + * The TCKind constant, indicating IDL data type + * <code>boolean</code> + */ + public static final TCKind tk_boolean = new TCKind(_tk_boolean); + + /** + * The TCKind constant, indicating IDL data type + * <code>char</code> + */ + public static final TCKind tk_char = new TCKind(_tk_char); + + /** + * The TCKind constant, indicating IDL data type + * <code>octet</code> + */ + public static final TCKind tk_octet = new TCKind(_tk_octet); + + /** + * The TCKind constant, indicating IDL data type + * <code>any</code> + */ + public static final TCKind tk_any = new TCKind(_tk_any); + + /** + * The TCKind constant, indicating IDL data type + * <code>TypeCode</code> + */ + public static final TCKind tk_TypeCode = new TCKind(_tk_TypeCode); + + /** + * The TCKind constant, indicating IDL data type + * <code>Principal</code> + */ + public static final TCKind tk_Principal = new TCKind(_tk_Principal); + + /** + * The TCKind constant, indicating IDL data type + * <code>objref</code> + */ + public static final TCKind tk_objref = new TCKind(_tk_objref); + + /** + * The TCKind constant, indicating IDL data type + * <code>struct</code> + */ + public static final TCKind tk_struct = new TCKind(_tk_struct); + + /** + * The TCKind constant, indicating IDL data type + * <code>union</code> + */ + public static final TCKind tk_union = new TCKind(_tk_union); + + /** + * The TCKind constant, indicating IDL data type + * <code>enum</code> + */ + public static final TCKind tk_enum = new TCKind(_tk_enum); + + /** + * The TCKind constant, indicating IDL data type + * <code>string</code> + */ + public static final TCKind tk_string = new TCKind(_tk_string); + + /** + * The TCKind constant, indicating IDL data type + * <code>sequence</code> + */ + public static final TCKind tk_sequence = new TCKind(_tk_sequence); + + /** + * The TCKind constant, indicating IDL data type + * <code>array</code> + */ + public static final TCKind tk_array = new TCKind(_tk_array); + + /** + * The TCKind constant, indicating IDL data type + * <code>alias</code> + */ + public static final TCKind tk_alias = new TCKind(_tk_alias); + + /** + * The TCKind constant, indicating IDL data type + * <code>except</code> + */ + public static final TCKind tk_except = new TCKind(_tk_except); + + /** + * The TCKind constant, indicating IDL data type + * <code>longlong</code> + */ + public static final TCKind tk_longlong = new TCKind(_tk_longlong); + + /** + * The TCKind constant, indicating IDL data type + * <code>ulonglong</code> + */ + public static final TCKind tk_ulonglong = new TCKind(_tk_ulonglong); + + /** + * The TCKind constant, indicating IDL data type + * <code>longdouble</code> + */ + public static final TCKind tk_longdouble = new TCKind(_tk_longdouble); + + /** + * The TCKind constant, indicating IDL data type + * <code>wchar</code> + */ + public static final TCKind tk_wchar = new TCKind(_tk_wchar); + + /** + * The TCKind constant, indicating IDL data type + * <code>wstring</code> + */ + public static final TCKind tk_wstring = new TCKind(_tk_wstring); + + /** + * The TCKind constant, indicating IDL data type + * <code>fixed</code> + */ + public static final TCKind tk_fixed = new TCKind(_tk_fixed); + + /** + * The TCKind constant, indicating IDL data type + * <code>value</code> + */ + public static final TCKind tk_value = new TCKind(_tk_value); + + /** + * The TCKind constant, indicating IDL data type + * <code>value_box</code> + */ + public static final TCKind tk_value_box = new TCKind(_tk_value_box); + + /** + * The TCKind constant, indicating IDL data type + * <code>native</code> + */ + public static final TCKind tk_native = new TCKind(_tk_native); + + /** + * The TCKind constant, indicating IDL data type + * <code>abstract_interface</code> + */ + public static final TCKind tk_abstract_interface = + new TCKind(_tk_abstract_interface); + + /** + * The kind value for this instance. + */ + private final int _value; + + /** + * The array of all tk_... instances, sorted by the kind number. + * + * As long as the kind numbers make the continuos sequence, starting from 0, + * the members can be found just by direct indexing. + */ + private static final TCKind[] tk = + new TCKind[] + { + tk_null, tk_void, tk_short, tk_long, tk_ushort, tk_ulong, tk_float, + tk_double, tk_boolean, tk_char, tk_octet, tk_any, tk_TypeCode, + tk_Principal, tk_objref, tk_struct, tk_union, tk_enum, tk_string, + tk_sequence, tk_array, tk_alias, tk_except, tk_longlong, tk_ulonglong, + tk_longdouble, tk_wchar, tk_wstring, tk_fixed, tk_value, tk_value_box, + tk_native, tk_abstract_interface + }; + + /** + * Creates a new TCKind instance with the given integer constant value. + * @deprecated it is recommended to use {@link #from_int(int)} that + * reuses existing TCKind object instead of allocating the new instance. + * @param kind one of the <code>_tk_..</code> constants. + */ + protected TCKind(int kind) + { + _value = kind; + } + + /** + * Returns the integer value, corresponding this instance of TCKind. + * @return the <code>_tk_..</code> value, matching this instance. + */ + public int value() + { + return _value; + } + + /** + * Return a TCKind object, matching the given integer code. + * @param _tk_nnn the TCKind code, one of <code>_tk_..</code> constants. + * @return the matching instance of TCKind, on of tk_.. constants. + * @throws BAD_PARAM if the given integer constant is not one of the + * valid <code>_tk_..</code> constants. + */ + public static TCKind from_int(int _tk_nnn) + { + try { + return tk[_tk_nnn]; + } + catch (ArrayIndexOutOfBoundsException aex) { + throw new BAD_PARAM("Invalid _tk_ code "+_tk_nnn); + } + } + +} diff --git a/libjava/classpath/org/omg/CORBA/TIMEOUT.java b/libjava/classpath/org/omg/CORBA/TIMEOUT.java new file mode 100644 index 000000000..bdeae7b19 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TIMEOUT.java @@ -0,0 +1,98 @@ +/* TIMEOUT.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.CORBA; + +import java.io.Serializable; + +/** + * Raised when no delivery has been made during the specified timeout duration. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class TIMEOUT + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID (v1.5) for interoperability. + */ + private static final long serialVersionUID = 4674850648191359518L; + + /** + * Creates TIMEOUT with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public TIMEOUT(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates TIMEOUT with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public TIMEOUT() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a TIMEOUT exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public TIMEOUT(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created TIMEOUT exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public TIMEOUT(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/TRANSACTION_MODE.java b/libjava/classpath/org/omg/CORBA/TRANSACTION_MODE.java new file mode 100644 index 000000000..fc72d3c67 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TRANSACTION_MODE.java @@ -0,0 +1,99 @@ +/* TRANSACTION_MODE.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.CORBA; + +import java.io.Serializable; + +/** + * Raised when the TransactionPolicy in the IOR is not the same as the current + * transaction mode. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class TRANSACTION_MODE + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID (v1.5) for interoperability. + */ + private static final long serialVersionUID = 681236728492128745L; + + /** + * Creates TRANSACTION_MODE with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public TRANSACTION_MODE(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates TRANSACTION_MODE with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public TRANSACTION_MODE() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a TRANSACTION_MODE exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public TRANSACTION_MODE(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created TRANSACTION_MODE exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public TRANSACTION_MODE(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/TRANSACTION_REQUIRED.java b/libjava/classpath/org/omg/CORBA/TRANSACTION_REQUIRED.java new file mode 100644 index 000000000..6cfc6182a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TRANSACTION_REQUIRED.java @@ -0,0 +1,96 @@ +/* TRANSACTION_REQUIRED.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.CORBA; + +import java.io.Serializable; + +/** + * Means that request carried a null transaction context, but an + * active transaction is required. + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class TRANSACTION_REQUIRED + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -1900254548742148576L; + + /** + * Creates a TRANSACTION_REQUIRED with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public TRANSACTION_REQUIRED(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates TRANSACTION_REQUIRED with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public TRANSACTION_REQUIRED() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a TRANSACTION_REQUIRED exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public TRANSACTION_REQUIRED(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created TRANSACTION_REQUIRED exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public TRANSACTION_REQUIRED(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java b/libjava/classpath/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java new file mode 100644 index 000000000..14edc2cb7 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java @@ -0,0 +1,97 @@ +/* TRANSACTION_ROLLEDBACK.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.CORBA; + +import java.io.Serializable; + +/** + * Means that transaction associated with the request has already + * been rolled back or marked to roll back. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class TRANSACTION_ROLLEDBACK + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -343903462439281571L; + + /** + * Creates a TRANSACTION_ROLLEDBACK with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public TRANSACTION_ROLLEDBACK(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates TRANSACTION_ROLLEDBACK with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public TRANSACTION_ROLLEDBACK() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a TRANSACTION_ROLLEDBACK exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public TRANSACTION_ROLLEDBACK(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created TRANSACTION_ROLLEDBACK exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public TRANSACTION_ROLLEDBACK(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/TRANSACTION_UNAVAILABLE.java b/libjava/classpath/org/omg/CORBA/TRANSACTION_UNAVAILABLE.java new file mode 100644 index 000000000..13ce17ebe --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TRANSACTION_UNAVAILABLE.java @@ -0,0 +1,99 @@ +/* TRANSACTION_UNAVAILABLE.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.CORBA; + +import java.io.Serializable; + +/** + * Raised in response to the abnormal termination of the transaction + * service. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class TRANSACTION_UNAVAILABLE + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID (v1.5) for interoperability. + */ + private static final long serialVersionUID = 6340246200933309385L; + + /** + * Creates TRANSACTION_UNAVAILABLE with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public TRANSACTION_UNAVAILABLE(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates TRANSACTION_UNAVAILABLE with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public TRANSACTION_UNAVAILABLE() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a TRANSACTION_UNAVAILABLE exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public TRANSACTION_UNAVAILABLE(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created TRANSACTION_UNAVAILABLE exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public TRANSACTION_UNAVAILABLE(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/TRANSIENT.java b/libjava/classpath/org/omg/CORBA/TRANSIENT.java new file mode 100644 index 000000000..081eabf3a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TRANSIENT.java @@ -0,0 +1,97 @@ +/* TRANSIENT.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the ORB cannot <i>reach</i> the object. It is not an + * indication that this object does not exist. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class TRANSIENT + extends SystemException + implements Serializable +{ + /** + * Creates a TRANSIENT with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public TRANSIENT(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 8168539547719791425L; + + /** + * Creates TRANSIENT with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public TRANSIENT() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a TRANSIENT exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public TRANSIENT(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created TRANSIENT exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public TRANSIENT(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/TypeCode.java b/libjava/classpath/org/omg/CORBA/TypeCode.java new file mode 100644 index 000000000..6a72f5a1d --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TypeCode.java @@ -0,0 +1,271 @@ +/* TypeCode.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.CORBA; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * An information about a CORBA data type. + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class TypeCode + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID for interoperability. + * Using the version 1.4 UID. + */ + private static final long serialVersionUID = -6521025782489515676L; + + /** + * For value types that support inheritance this method returns the + * of the ancestor type code. + * + * @return the ancestor TypeCode. + * + * @throws BadKind for all typecodes except the value type typecodes. + */ + public abstract TypeCode concrete_base_type() + throws BadKind; + + /** + * For sequences, arrays, aliases and value boxes, returns the IDL type for + * the members of the object. + * @return a TypeCode of the memebers of this type. + * @throws BadKind for types other than + * sequences, arrays, aliases and value boxes. + */ + public abstract TypeCode content_type() + throws BadKind; + + /** + * For unions, returs the index of the default member. + * @return the index of the default member, -1 if there is + * no default member. + * @throws BadKind if this type is not + * a union. + */ + public abstract int default_index() + throws BadKind; + + /** + * Returs definition of member labels for untions + * @return a TypeCode, describing all non-default member labels. + * @throws BadKind if this type is not a + * union. + */ + public abstract TypeCode discriminator_type() + throws BadKind; + + /** + * Test two types for equality. + * + * @param other the other type to compere with + * @return true if the types are interchangeable. + */ + public abstract boolean equal(TypeCode other); + + /** + * Following the current 1.4 API specifcation, this should just throw + * NO_IMPLEMENT. + * @throws org.omg.CORBA.NO_IMPLEMENT, always. + */ + public abstract boolean equivalent(TypeCode other); + + /** + * For the fixed type, returns the number of digits. + * @return the number of digits for the fixed type + * @throws BadKind if this is not a fixed + * type. + */ + public abstract short fixed_digits() + throws BadKind; + + /** + * Returns the scale for the fixed type. The returned value can be either + * positive (the number of digits to the right of the decimal point) or + * negative (adds zeros to the left of the decimal point). + * @return the scale. + * @throws BadKind if this is not a fixed + * type. + */ + public abstract short fixed_scale() + throws BadKind; + + /** + * Returns a version of this instance without the optional memeber and + * member name fields. + * @return the truncated version. + */ + public abstract TypeCode get_compact_typecode(); + + /** + * Returns the RepositoryId globally identifying the type, defined by + * this TypeCode. + * @return tje RepositoryId. In some cases, it may be an empty string. + * @throws BadKind if the type is other than + * reference, structure, union, enumeration, alias, exception, valuetype, + * boxed valuetype and also native and abstract interfaces. + */ + public abstract String id() + throws BadKind; + + /** + * Return the kind of this type code object. + * @return one of the <code>TCKind.t_..</code> fields. + */ + public abstract TCKind kind(); + + /** + * Returns the number of elements in the type. For arrays, this + * method returns the length of the array. For strings and sequences, + * it returns the bound of the type, zero indicating the unbounded + * type. + * + * @return length or bound + * + * @throws BadKind for types other than + * string, sequence and array. + */ + public abstract int length() + throws BadKind; + + /** + * Returns the number of type memebers. + * + * @return the number of memebers + * @throws BadKind for types other than + * structure, union, enumeration or exception. + */ + public abstract int member_count() + throws BadKind; + + /** + * Retrieves the label of the union member at the given index. + * For the default member, this label is the zero octet. + * + * @param index the index of the union memeber. + * + * @return the label + * + * @throws BadKind if this is not a union + * type. + * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is out of + * valid bounds. + */ + public abstract Any member_label(int index) + throws BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; + + /** + * Retrieves the simple name of the member identified by the given index. + * + * @param index the index of the memeber. + * + * @return the member name that in some cases can be an empty string. + * + * @throws BadKind for types other than + * structure, union or enumeration. + * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is out of + * valid bounds. + */ + public abstract String member_name(int index) + throws BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; + + /** + * Retrieves the member type of the member identified by the given index. + * + * @param index the index of the memeber. + * + * @return the member type. + * + * @throws BadKind for types other than + * structure, union, enumeration or exception. + * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is out of + * valid bounds. + */ + public abstract TypeCode member_type(int index) + throws BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; + + /** + * Returns the visibility scope of the member at the given index. + * This operation can only be invoked on non-boxed value types. + * + * @param index the index of the member + * + * @return either PRIVATE_MEMBER.value or PUBLIC_MEMBER.value + * + * @throws BadKind if this is not a non boxed + * value type. + * + * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is out of + * valid bounds. + */ + public abstract short member_visibility(int index) + throws BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; + + /** + * Retrieves the simple name identifying this TypeCode object + * within its enclosing scope. + * @return the name, can be an empty string. + * @throws BadKind for typer other than + * reference, structure, union, enumeration, alias, exception, + * valuetype, boxed valuetype, native, and abstract interface + */ + public abstract String name() + throws BadKind; + + /** + * Returns a constant indicating the modifier of the value type. + * + * @return one of the following constants: + * VM_NONE.value, VM_ABSTRACT.value, VM_CUSTOM.value, or + * VM_TRUNCATABLE.value, + * + * @throws BadKind for all types other than value type. + */ + public abstract short type_modifier() + throws BadKind; +} diff --git a/libjava/classpath/org/omg/CORBA/TypeCodeHolder.java b/libjava/classpath/org/omg/CORBA/TypeCodeHolder.java new file mode 100644 index 000000000..0a3c4e370 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TypeCodeHolder.java @@ -0,0 +1,123 @@ +/* TypeCodeHolder.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.CORBA; + +import gnu.CORBA.typecodes.PrimitiveTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for CORBA <code>TypeCode</code> that is mapped into + * java <code>TypeCode</code>. + * + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class TypeCodeHolder + implements Streamable +{ + /** + * The default type code for this holder. + */ + private static final TypeCode t_TypeCode = + new PrimitiveTypeCode(TCKind.tk_TypeCode); + + /** + * The <code>TypeCode</code> (CORBA <code>TypeCode</code>) value, + * held by this TypeCodeHolder. + */ + public TypeCode value; + + /** + * Constructs an instance of TypeCodeHolder, + * initializing {@link #value} to <code>null</code>. + */ + public TypeCodeHolder() + { + } + + /** + * Constructs an instance of TypeCodeHolder, + * initializing {@link #value} to the given <code>TypeCode</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public TypeCodeHolder(TypeCode initial_value) + { + value = initial_value; + } + + /** + * Fill in the {@link #value} field by reading the required data + * from the given stream. For <code>TypeCode</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.InputStream#read_TypeCode}. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = input.read_TypeCode(); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return t_TypeCode; + } + + /** + * Write the {@link #value} field to the given stream. + * For <code>TypeCode</code>, the functionality + * is delegated to + * {@link org.omg.CORBA.portable.OutputStream#write_TypeCode(TypeCode) }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_TypeCode(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/TypeCodePackage/BadKind.java b/libjava/classpath/org/omg/CORBA/TypeCodePackage/BadKind.java new file mode 100644 index 000000000..2da316e26 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TypeCodePackage/BadKind.java @@ -0,0 +1,76 @@ +/* BadKind.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.CORBA.TypeCodePackage; + +import java.io.Serializable; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +/** + * This exception is thrown when an inappropriate operation is invoked on + * a {@link org.omg.CORBA.TypeCode} object. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class BadKind + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1030443154456771956L; + + /** + * Constructs a the exception. + */ + public BadKind() + { + } + + /** + * Constructs the exception, explaining the reason of throwing it. + * @param reason a string, explaining, why the exception has been thrown. + */ + public BadKind(String reason) + { + super(reason); + } +} diff --git a/libjava/classpath/org/omg/CORBA/TypeCodePackage/Bounds.java b/libjava/classpath/org/omg/CORBA/TypeCodePackage/Bounds.java new file mode 100644 index 000000000..fda440f16 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TypeCodePackage/Bounds.java @@ -0,0 +1,79 @@ +/* Bounds.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.CORBA.TypeCodePackage; + +import java.io.Serializable; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +/** + * The {@link org.omg.CORBA.TypeCode#member_name(int) }, + * {@link org.omg.CORBA.TypeCode#member_type(int) } and + * {@link org.omg.CORBA.TypeCode#member_label(int) } raise Bounds when + * the parameter is larger than the index of the last member, + * constituting the type. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class Bounds + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -5418177951071152101L; + + /** + * Constructs a the exception. + */ + public Bounds() + { + } + + /** + * Constructs the exception, explaining the reason of throwing it. + * @param reason a string, explaining, why the exception has been thrown. + */ + public Bounds(String reason) + { + super(reason); + } +} diff --git a/libjava/classpath/org/omg/CORBA/TypeCodePackage/package.html b/libjava/classpath/org/omg/CORBA/TypeCodePackage/package.html new file mode 100644 index 000000000..f8c476e6f --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TypeCodePackage/package.html @@ -0,0 +1,46 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html - describes classes in javax.sql package. + 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.CORBA.TypeCodePackage</title></head> + +<body> +<p>Provides a couple of exceptions, thrown by methods in the <code>TypeCode</code> class.</p> + +</body> +</html> diff --git a/libjava/classpath/org/omg/CORBA/ULongLongSeqHelper.java b/libjava/classpath/org/omg/CORBA/ULongLongSeqHelper.java new file mode 100644 index 000000000..b13f33cdf --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ULongLongSeqHelper.java @@ -0,0 +1,143 @@ +/* ULongLongSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA sequence of <code>long</code> + * (<code>ULongLongSeq</code>). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class ULongLongSeqHelper +{ + /** + * Extract the <code>long[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link ULongLongSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link ULongLongSeqHolder}. + */ + public static long[] extract(Any a) + { + ULongLongSeqHolder h = (ULongLongSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>long[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link ULongLongSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, long[] that) + { + ULongLongSeqHolder holder = new ULongLongSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>long[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static long[] read(InputStream input) + { + long[] value = new long[ input.read_long() ]; + input.read_ulonglong_array(value, 0, value.length); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>ULongLongSeq</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_ulong); + } + + /** + * Writes the <code>long[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, long[] value) + { + output.write_long(value.length); + output.write_ulonglong_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ULongLongSeqHolder.java b/libjava/classpath/org/omg/CORBA/ULongLongSeqHolder.java new file mode 100644 index 000000000..cd9c02310 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ULongLongSeqHolder.java @@ -0,0 +1,126 @@ +/* ULongLongSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>ULongLongSeq</code> that is mapped into + * java <code>long[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class ULongLongSeqHolder + implements Streamable +{ + /** + * The <code>long[]</code> (CORBA <code>ULongLongSeq</code>) value, + * held by this ULongLongSeqHolder. + */ + public long[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_ulonglong); + + /** + * Constructs an instance of ULongLongSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public ULongLongSeqHolder() + { + } + + /** + * Constructs an instance of ULongLongSeqHolder, + * initializing {@link #value} to the given <code>long[]</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public ULongLongSeqHolder(long[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.InputStream#read_ulonglong_array }. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new long[ input.read_long() ]; + input.read_ulonglong_array(value, 0, value.length); + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.OutputStream#write_ulonglong_array }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + output.write_ulonglong_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ULongSeqHelper.java b/libjava/classpath/org/omg/CORBA/ULongSeqHelper.java new file mode 100644 index 000000000..186350b2c --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ULongSeqHelper.java @@ -0,0 +1,143 @@ +/* ULongSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA sequence of <code>int</code> + * (<code>ULongSeq</code>). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class ULongSeqHelper +{ + /** + * Extract the <code>int[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link ULongSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link ULongSeqHolder}. + */ + public static int[] extract(Any a) + { + ULongSeqHolder h = (ULongSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>int[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link ULongSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, int[] that) + { + ULongSeqHolder holder = new ULongSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>int[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static int[] read(InputStream input) + { + int[] value = new int[ input.read_long() ]; + input.read_ulong_array(value, 0, value.length); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>ULongSeq</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_long); + } + + /** + * Writes the <code>int[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, int[] value) + { + output.write_long(value.length); + output.write_ulong_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ULongSeqHolder.java b/libjava/classpath/org/omg/CORBA/ULongSeqHolder.java new file mode 100644 index 000000000..35d9a4384 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ULongSeqHolder.java @@ -0,0 +1,126 @@ +/* ULongSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>ULongSeq</code> that is mapped into + * java <code>int[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class ULongSeqHolder + implements Streamable +{ + /** + * The <code>int[]</code> (CORBA <code>ULongSeq</code>) value, + * held by this ULongSeqHolder. + */ + public int[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_ulong); + + /** + * Constructs an instance of ULongSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public ULongSeqHolder() + { + } + + /** + * Constructs an instance of ULongSeqHolder, + * initializing {@link #value} to the given <code>int[]</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public ULongSeqHolder(int[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.InputStream#read_ulong_array }. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new int[ input.read_long() ]; + input.read_ulong_array(value, 0, value.length); + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.OutputStream#write_ulong_array }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + output.write_ulong_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/UNKNOWN.java b/libjava/classpath/org/omg/CORBA/UNKNOWN.java new file mode 100644 index 000000000..37b627aa3 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UNKNOWN.java @@ -0,0 +1,95 @@ +/* UNKNOWN.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.CORBA; + +import java.io.Serializable; + +/** + * Means that the operation implementation has thrown a non-CORBA exception. + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class UNKNOWN + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -3556426185741898205L; + + /** + * Creates a UNKNOWN with the default minor code of 0, + * completion state COMPLETED_NO and the given explaining message. + * @param message the explaining message. + */ + public UNKNOWN(String message) + { + super(message, 0, CompletionStatus.COMPLETED_NO); + } + + /** + * Creates UNKNOWN with the default minor code of 0 and a + * completion state COMPLETED_NO. + */ + public UNKNOWN() + { + super("", 0, CompletionStatus.COMPLETED_NO); + } + + /** Creates a UNKNOWN exception with the specified minor + * code and completion status. + * @param minor additional error code. + * @param completed the method completion status. + */ + public UNKNOWN(int minor, CompletionStatus completed) + { + super("", minor, completed); + } + + /** + * Created UNKNOWN exception, providing full information. + * @param reason explaining message. + * @param minor additional error code (the "minor"). + * @param completed the method completion status. + */ + public UNKNOWN(String reason, int minor, CompletionStatus completed) + { + super(reason, minor, completed); + } +} diff --git a/libjava/classpath/org/omg/CORBA/UNSUPPORTED_POLICY.java b/libjava/classpath/org/omg/CORBA/UNSUPPORTED_POLICY.java new file mode 100644 index 000000000..e07f9e08b --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UNSUPPORTED_POLICY.java @@ -0,0 +1,56 @@ +/* UNSUPPORTED_POLICY.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.CORBA; + +/** + * Holds a single constant, specifying, that + * while the requested {@link Policy} is valid, it is not supported by + * this ORB. One of the PolicyErrorCodes, others being + * {@link UNSUPPORTED_POLICY_VALUE}, {@link BAD_POLICY}, + * {@link BAD_POLICY_TYPE}, {@link BAD_POLICY_VALUE}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface UNSUPPORTED_POLICY +{ + /** + * States that while the requested {@link Policy} is valid, + * it is not supported by this ORB. + */ + short value = 1; +} diff --git a/libjava/classpath/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.java b/libjava/classpath/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.java new file mode 100644 index 000000000..6da7238b7 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.java @@ -0,0 +1,56 @@ +/* UNSUPPORTED_POLICY_VALUE.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.CORBA; + +/** + * Holds a single constant, specifying, that + * while the requested {@link Policy} value is valid, it is not + * supported by this ORB. One of the PolicyErrorCodes, others being + * {@link UNSUPPORTED_POLICY}, {@link BAD_POLICY}, {@link BAD_POLICY_TYPE} , + * {@link BAD_POLICY_VALUE}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface UNSUPPORTED_POLICY_VALUE +{ + /** + * States that while the requested {@link Policy} value is valid, + * it is not supported by this ORB. + */ + short value = 4; +} diff --git a/libjava/classpath/org/omg/CORBA/UShortSeqHelper.java b/libjava/classpath/org/omg/CORBA/UShortSeqHelper.java new file mode 100644 index 000000000..0fcd4739f --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UShortSeqHelper.java @@ -0,0 +1,143 @@ +/* UShortSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA sequence of <code>short</code> + * (<code>UShortSeq</code>). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class UShortSeqHelper +{ + /** + * Extract the <code>short[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link UShortSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link UShortSeqHolder}. + */ + public static short[] extract(Any a) + { + UShortSeqHolder h = (UShortSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>short[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link UShortSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, short[] that) + { + UShortSeqHolder holder = new UShortSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>short[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static short[] read(InputStream input) + { + short[] value = new short[ input.read_long() ]; + input.read_ushort_array(value, 0, value.length); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>UShortSeq</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_short); + } + + /** + * Writes the <code>short[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, short[] value) + { + output.write_long(value.length); + output.write_ushort_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/UShortSeqHolder.java b/libjava/classpath/org/omg/CORBA/UShortSeqHolder.java new file mode 100644 index 000000000..3eb83c524 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UShortSeqHolder.java @@ -0,0 +1,126 @@ +/* UShortSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>UShortSeq</code> that is mapped into + * java <code>short[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class UShortSeqHolder + implements Streamable +{ + /** + * The <code>short[]</code> (CORBA <code>UShortSeq</code>) value, + * held by this UShortSeqHolder. + */ + public short[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_ushort); + + /** + * Constructs an instance of UShortSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public UShortSeqHolder() + { + } + + /** + * Constructs an instance of UShortSeqHolder, + * initializing {@link #value} to the given <code>short[]</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public UShortSeqHolder(short[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.InputStream#read_ushort_array }. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new short[ input.read_long() ]; + input.read_ushort_array(value, 0, value.length); + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.OutputStream#write_ushort_array }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + output.write_ushort_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/UnionMember.java b/libjava/classpath/org/omg/CORBA/UnionMember.java new file mode 100644 index 000000000..69e424cdb --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UnionMember.java @@ -0,0 +1,103 @@ +/* UnionMember.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.CORBA; + +import java.io.Serializable; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * The component, describing the member of CORBA IDL <code>union</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class UnionMember + implements IDLEntity, Serializable +{ + /** + * Use 1.4 version serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 5506049694216071974L; + + /** + * The label of the union member. + */ + public Any label; + + /** + * The IDL type of the union member. + */ + public IDLType type_def; + + /** + * The name of the union member. + */ + public String name; + + /** + * The typecode of the union member. + */ + public TypeCode type; + + /** + * Creates a union member with all fields + * left with the default value <code>null</code>. + */ + public UnionMember() + { + } + + /** + * Creates a union member. + * + * @param a_name member name. + * @param a_label member label. + * @param a_type member type code. + * @param a_type_def member IDL type definition. + */ + public UnionMember(String a_name, Any a_label, TypeCode a_type, + IDLType a_type_def + ) + { + name = a_name; + label = a_label; + type = a_type; + type_def = a_type_def; + } +} diff --git a/libjava/classpath/org/omg/CORBA/UnionMemberHelper.java b/libjava/classpath/org/omg/CORBA/UnionMemberHelper.java new file mode 100644 index 000000000..d0622e8a9 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UnionMemberHelper.java @@ -0,0 +1,182 @@ +/* UnionMemberHelper.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.CORBA; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; +import gnu.CORBA.TypeCodeHelper; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A helper operations for the union member. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class UnionMemberHelper +{ + /** + * The cached typecode value (computed once). + */ + private static TypeCode typeCode; + + /** + * Used in creating recursive unions. + */ + private static boolean active; + + /** + * Inset the union member into the given Any. + */ + public static void insert(Any a, UnionMember that) + { + OutputStream out = a.create_output_stream(); + a.type(type()); + write(out, that); + a.read_value(out.create_input_stream(), type()); + } + + /** + * Extract the union member from the given Any. + */ + public static UnionMember extract(Any a) + { + return read(a.create_input_stream()); + } + + /** + * Create and return the typecode for this union member. + */ + public static synchronized TypeCode type() + { + if (typeCode == null) + { + synchronized (TypeCode.class) + { + if (typeCode == null) + { + if (active) + { + return OrbRestricted.Singleton.create_recursive_tc(id()); + } + active = true; + + ORB orb = OrbRestricted.Singleton; + + StructMember[] members = new StructMember[ 4 ]; + TypeCode member; + member = orb.create_string_tc(0); + member = + orb.create_alias_tc(IdentifierHelper.id(), "Identifier", + member + ); + members [ 0 ] = new StructMember("name", member, null); + member = orb.get_primitive_tc(TCKind.tk_any); + members [ 1 ] = new StructMember("label", member, null); + member = orb.create_string_tc(0); + member = orb.get_primitive_tc(TCKind.tk_TypeCode); + members [ 2 ] = new StructMember("type", member, null); + member = IDLTypeHelper.type(); + members [ 3 ] = new StructMember("type_def", member, null); + typeCode = + orb.create_struct_tc(UnionMemberHelper.id(), "UnionMember", + members + ); + active = false; + } + } + } + return typeCode; + } + + /** + * Return the UnionMember repository id. + * + * @return "IDL:omg.org/CORBA/UnionMember:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/UnionMember:1.0"; + } + + /** + * Read the union member from the given stream. + */ + public static UnionMember read(InputStream istream) + { + try + { + UnionMember value = new UnionMember(); + value.name = istream.read_string(); + value.label = istream.read_any(); + value.type = TypeCodeHelper.read(istream); + value.type_def = IDLTypeHelper.read(istream); + return value; + } + catch (UserException ex) + { + MARSHAL m = new MARSHAL(); + m.minor = Minor.UserException; + m.initCause(ex); + throw m; + } + } + + /** + * Write the union member to the given stream. + */ + public static void write(OutputStream ostream, UnionMember value) + { + try + { + ostream.write_string(value.name); + ostream.write_any(value.label); + TypeCodeHelper.write(ostream, value.type); + IDLTypeHelper.write(ostream, value.type_def); + } + catch (UserException ex) + { + MARSHAL m = new MARSHAL(); + m.minor = Minor.UserException; + m.initCause(ex); + throw m; + } + } +} diff --git a/libjava/classpath/org/omg/CORBA/UnknownUserException.java b/libjava/classpath/org/omg/CORBA/UnknownUserException.java new file mode 100644 index 000000000..170f2d5d2 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UnknownUserException.java @@ -0,0 +1,87 @@ +/* UnknownUserException.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.CORBA; + +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * A wrapper against an unknown user exception that has been thrown + * on remote side and returned by the server. The instance of this + * class is returned by {@link Request#env()}. + * + * @see Environment#exception() + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class UnknownUserException + extends UserException + implements IDLEntity, Serializable +{ + /** + * The Any, holding the actual exception, that has been thrown + * by the server. + */ + public Any except; + + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 3106202258203879281L; + + /** + * Create an unitialised instance of the unknown user exception. + */ + public UnknownUserException() + { + } + + /** + * Create the instance of the unknow user exception, initialised + * to the given value. + * + * @param an_exception the exception, that has actually been thrown + * by the server. + */ + public UnknownUserException(Any an_exception) + { + except = an_exception; + } +} diff --git a/libjava/classpath/org/omg/CORBA/UnknownUserExceptionHelper.java b/libjava/classpath/org/omg/CORBA/UnknownUserExceptionHelper.java new file mode 100644 index 000000000..086641e5c --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UnknownUserExceptionHelper.java @@ -0,0 +1,149 @@ +/* UnknownUserExceptionHelper.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.CORBA; + +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.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the exception {@link UnknownUserException}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class UnknownUserExceptionHelper +{ + /** + * Create the UnknownUserException typecode (structure, + * named "UnknownUserException", containing a single field of + * type {@link Any}, named "except". + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 1 ]; + + TypeCode field; + + field = orb.get_primitive_tc(TCKind.tk_any); + members [ 0 ] = new StructMember("except", field, null); + return + orb.create_exception_tc(id(), "UnknownUserException", members); + } + + /** + * Insert the UnknownUserException into the given Any. + * This method uses the UnknownUserExceptionHolder. + * + * @param any the Any to insert into. + * @param that the UnknownUserException to insert. + */ + public static void insert(Any any, UnknownUserException that) + { + any.insert_Streamable(new UnknownUserExceptionHolder(that)); + } + + /** + * Extract the UnknownUserException from given Any. + * This method uses the UnknownUserExceptionHolder. + * + * @throws BAD_OPERATION if the passed Any does not contain + * UnknownUserException. + */ + public static UnknownUserException extract(Any any) + { + try + { + return ((UnknownUserExceptionHolder) any.extract_Streamable()).value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("UnknownUserException expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the UnknownUserException repository id. + * + * @return "IDL:omg.org/CORBA/UnknownUserException:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/UnknownUserException:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static UnknownUserException read(InputStream input) + { + // Read the exception repository id. + input.read_string(); + UnknownUserException value = new UnknownUserException(); + + value.except = input.read_any(); + 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, UnknownUserException value) + { + // Write the exception repository id. + output.write_string(id()); + output.write_any(value.except); + } +} diff --git a/libjava/classpath/org/omg/CORBA/UnknownUserExceptionHolder.java b/libjava/classpath/org/omg/CORBA/UnknownUserExceptionHolder.java new file mode 100644 index 000000000..816cdeeba --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UnknownUserExceptionHolder.java @@ -0,0 +1,103 @@ +/* UnknownUserExceptionHolder.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.CORBA; + +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** +* A holder for the exception {@link UnknownUserException}. + +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public final class UnknownUserExceptionHolder implements Streamable +{ + /** + * The stored UnknownUserException value. + */ + public UnknownUserException value; + + /** + * Create the unitialised instance, leaving the value field + * with default <code>null</code> value. + */ + public UnknownUserExceptionHolder() + { + } + + /** + * Create the initialised instance. + * @param initialValue the value that will be assigned to + * the <code>value</code> field. + */ + public UnknownUserExceptionHolder(UnknownUserException initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link #value} by data from the CDR stream. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = UnknownUserExceptionHelper.read(input); + } + + /** + * Write the stored value into the CDR stream. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + UnknownUserExceptionHelper.write(output, value); + } + + /** + * Get the typecode of the UnknownUserException. + */ + public TypeCode _type() + { + return UnknownUserExceptionHelper.type(); + } +} diff --git a/libjava/classpath/org/omg/CORBA/UserException.java b/libjava/classpath/org/omg/CORBA/UserException.java new file mode 100644 index 000000000..edbd76e86 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UserException.java @@ -0,0 +1,74 @@ +/* UserException.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.CORBA; + +import java.io.Serializable; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * The root class for CORBA IDL-defined user exceptions. + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class UserException + extends Exception + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID for interoperability. + * Using the version 1.4 UID. + */ + private static final long serialVersionUID = -6594940734566091244L; + + /** + * Constructs a the exception. + */ + protected UserException() + { + } + + /** + * Constructs the exception, explaining the reason of throwing it. + * @param reason a string, explaining, why the exception has been thrown. + */ + protected UserException(String reason) + { + super(reason); + } +} diff --git a/libjava/classpath/org/omg/CORBA/VM_ABSTRACT.java b/libjava/classpath/org/omg/CORBA/VM_ABSTRACT.java new file mode 100644 index 000000000..ffaeed879 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/VM_ABSTRACT.java @@ -0,0 +1,52 @@ +/* VM_ABSTRACT.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.CORBA; + +/** + * Specifies that the object is an abstract interface. One of the possible + * values, returned by {@link TypeCode#type_modifier()}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface VM_ABSTRACT +{ + /** + * States the abstract interface in a typecode. + */ + short value = 2; +} diff --git a/libjava/classpath/org/omg/CORBA/VM_CUSTOM.java b/libjava/classpath/org/omg/CORBA/VM_CUSTOM.java new file mode 100644 index 000000000..40c64feaf --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/VM_CUSTOM.java @@ -0,0 +1,53 @@ +/* VM_CUSTOM.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.CORBA; + +/** + * Indicates a custom marshalled value type. One of the possible + * values, returned by {@link TypeCode#type_modifier()}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface VM_CUSTOM +{ + /** + * States that the code used to represent a custom + * marshalled value type in a typecode. + */ + short value = 1; +} diff --git a/libjava/classpath/org/omg/CORBA/VM_NONE.java b/libjava/classpath/org/omg/CORBA/VM_NONE.java new file mode 100644 index 000000000..f8ef8b51c --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/VM_NONE.java @@ -0,0 +1,52 @@ +/* VM_NONE.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.CORBA; + +/** + * One of the possible values, returned by {@link TypeCode#type_modifier()}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface VM_NONE +{ + /** + * States that the code used to represent the one of + * the values of a value type in a typecode. + */ + short value = 0; +} diff --git a/libjava/classpath/org/omg/CORBA/VM_TRUNCATABLE.java b/libjava/classpath/org/omg/CORBA/VM_TRUNCATABLE.java new file mode 100644 index 000000000..6b70770be --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/VM_TRUNCATABLE.java @@ -0,0 +1,53 @@ +/* VM_TRUNCATABLE.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.CORBA; + +/** + * Indicates a truncatable value type. One of the possible + * values, returned by {@link TypeCode#type_modifier()}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface VM_TRUNCATABLE +{ + /** + * States that the code used to represent a truncatable + * value type in a typecode. + */ + short value = 3; +} diff --git a/libjava/classpath/org/omg/CORBA/ValueBaseHelper.java b/libjava/classpath/org/omg/CORBA/ValueBaseHelper.java new file mode 100644 index 000000000..4fdb452b3 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ValueBaseHelper.java @@ -0,0 +1,137 @@ +/* ValueBaseHelper.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.CORBA; + +import gnu.CORBA.CDR.Vio; +import gnu.CORBA.typecodes.RecordTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.ValueBase; + +import java.io.ObjectOutputStream; +import java.io.Serializable; + +/** + * A helper operations for the value base type ({@link ValueBase}). + * + * @since 1.3 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ValueBaseHelper +{ + /** + * Extract the value type from the given Any. + * + * @param a the Any to extract from. + * + * @return the extracted value type. + */ + public static Serializable extract(Any a) + { + return a.extract_Value(); + } + + /** + * Return the value base helper repository id. + * + * @return IDL:omg.org/CORBA/ValueBase:1.0, always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/ValueBase:1.0"; + } + + /** + * Insert the value base that is Serializable into + * the given Any. + * + * @param a the Any to insert into. + * @param that the value base to insert. + */ + public static void insert(Any a, Serializable that) + { + a.insert_Value(that); + } + + /** + * Read the value base from the given input stream. + * + * @param input a stream to read from. + * + * @return the loaded value. + * + * @throws MARSHAL if the reading has failed due any reason. + */ + public static Serializable read(InputStream input) + { + return Vio.read(input); + } + + /** + * Get the typecode of the value type. + * @return the typecode of the value type + */ + public static TypeCode type() + { + RecordTypeCode r = new RecordTypeCode(TCKind.tk_value); + return r; + } + + /** + * Write the value base into the given stream. + * + * If the passed value implements the {@link CustomMarshal}, + * the helper uses {@link CustomMarshal#marshal} + * to write the content in a user defined way. Otherwise, + * this implementation initialises the {@link ObjectOutputStream} + * and writes through it. + * + * @param output a stream to write to. + * + * @param value a value to write. + * + * @throws MARSHAL if the writing failed due any reason. + */ + public static void write(OutputStream output, Serializable value) + { + Vio.write(output, value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ValueBaseHolder.java b/libjava/classpath/org/omg/CORBA/ValueBaseHolder.java new file mode 100644 index 000000000..ed9f1af5c --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ValueBaseHolder.java @@ -0,0 +1,110 @@ +/* ValueBaseHolder.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.CORBA; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; +import org.omg.CORBA.portable.ValueBase; + +import java.io.Serializable; + +/** + * A holder to store a {@link ValueBase} that is handled as + * {@link Serializable} here. + * + * @since 1.3 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class ValueBaseHolder + implements Streamable +{ + /** + * A stored value of the value base type. + */ + public Serializable value; + + /** + * Create an unitialised instance. + */ + public ValueBaseHolder() + { + } + + /** + * Create an instance, initialised into the given value. + * + * @param initial an initial value. + */ + public ValueBaseHolder(Serializable initial) + { + value = initial; + } + + /** + * Read fill in the value field by reading an instance from the + * given input stream. Uses {@link ValueBaseHelper} + * + * @param input a stream to read from. + */ + public void _read(InputStream input) + { + value = ValueBaseHelper.read(input); + } + + /** + * Get the typecode of the stored instance. Uses {@link ValueBaseHelper} + */ + public TypeCode _type() + { + return ValueBaseHelper.type(); + } + + /** + * Write the stored instance to the given output stream. + * Uses {@link ValueBaseHelper} + * + * @param output a stream to write to. + */ + public void _write(OutputStream output) + { + ValueBaseHelper.write(output, value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/ValueMember.java b/libjava/classpath/org/omg/CORBA/ValueMember.java new file mode 100644 index 000000000..9323c86f9 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ValueMember.java @@ -0,0 +1,124 @@ +/* ValueMember.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.CORBA; + +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * The class, defining properties of the value member. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class ValueMember + implements Serializable, IDLEntity +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -2507594168537449114L; + + /** + * The typedef that represents the IDL type of the value member. + */ + public IDLType type_def; + + /** + * The repository ID of the value for that this member is defined + */ + public String defined_in; + + /** + * The repository ID of this value member itself. + */ + public String id; + + /** The name of the value member. */ + public String name; + + /** + * The version of the value in which this member is defined. + */ + public String version; + + /** The type of of this value member. */ + public TypeCode type; + + /** + * The type of access (public, private) of this value member. + * This field can be equal to either {@link PUBLIC_MEMBER#value} or + * {@link PRIVATE_MEMBER#value}. + */ + public short access; + + /** + * Create the value member with all fields initialised to default values + * (0 and <code>null</code>). + */ + public ValueMember() + { + } + + /** + * Create the value member, specifying the field values. + * + * @param a_name name. + * @param an_id id . + * @param is_defined_in id of the value where the member is defined. + * @param a_version version. + * @param a_type tye. + * @param a_type_def {@link IDLType} (typeded). + * @param an_access accessibility scope. Can be equal to either + * {@link PUBLIC_MEMBER#value} or {@link PRIVATE_MEMBER#value}. + */ + public ValueMember(String a_name, String an_id, String is_defined_in, + String a_version, TypeCode a_type, IDLType a_type_def, + short an_access + ) + { + name = a_name; + id = an_id; + defined_in = is_defined_in; + version = a_version; + type = a_type; + type_def = a_type_def; + access = an_access; + } +} diff --git a/libjava/classpath/org/omg/CORBA/ValueMemberHelper.java b/libjava/classpath/org/omg/CORBA/ValueMemberHelper.java new file mode 100644 index 000000000..b62f04d3c --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ValueMemberHelper.java @@ -0,0 +1,210 @@ +/* ValueMemberHelper.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.CORBA; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; +import gnu.CORBA.TypeCodeHelper; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the value member. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ValueMemberHelper +{ + /** + * The cached typecode value, computed once. + */ + private static TypeCode typeCode = null; + + /** + * Used when creating typecodes with recursive value members. + */ + private static boolean active = false; + + /** + * Insert the value member into the given Any. + */ + public static void insert(Any a, ValueMember that) + { + OutputStream out = a.create_output_stream(); + a.type(type()); + write(out, that); + a.read_value(out.create_input_stream(), type()); + } + + /** + * Extract the value member from the given Any. + */ + public static ValueMember extract(Any a) + { + return read(a.create_input_stream()); + } + + /** + * Create a typecode for this value member. + */ + public static synchronized TypeCode type() + { + if (typeCode == null) + { + synchronized (TypeCode.class) + { + if (typeCode == null) + { + ORB orb = OrbRestricted.Singleton; + + if (active) + { + return orb.create_recursive_tc(id()); + } + active = true; + + StructMember[] members = new StructMember[ 7 ]; + TypeCode member; + member = orb.create_string_tc(0); + member = + orb.create_alias_tc(IdentifierHelper.id(), "Identifier", + member + ); + members [ 0 ] = new StructMember("name", member, null); + member = orb.create_string_tc(0); + member = + orb.create_alias_tc(RepositoryIdHelper.id(), "RepositoryId", + member + ); + members [ 1 ] = new StructMember("id", member, null); + member = orb.create_string_tc(0); + member = + orb.create_alias_tc(RepositoryIdHelper.id(), "RepositoryId", + member + ); + members [ 2 ] = new StructMember("defined_in", member, null); + member = orb.create_string_tc(0); + member = + orb.create_alias_tc(VersionSpecHelper.id(), "VersionSpec", + member + ); + members [ 3 ] = new StructMember("version", member, null); + member = orb.create_string_tc(0); + member = orb.get_primitive_tc(TCKind.tk_TypeCode); + members [ 4 ] = new StructMember("type", member, null); + member = IDLTypeHelper.type(); + members [ 5 ] = new StructMember("type_def", member, null); + member = orb.get_primitive_tc(TCKind.tk_short); + member = + orb.create_alias_tc(VisibilityHelper.id(), "Visibility", + member + ); + members [ 6 ] = new StructMember("access", member, null); + typeCode = + orb.create_struct_tc(ValueMemberHelper.id(), "ValueMember", + members + ); + active = false; + } + } + } + return typeCode; + } + + /** + * Return the ValueMember repository id. + * + * @return "IDL:omg.org/CORBA/ValueMember:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/ValueMember:1.0"; + } + + /** + * Reads the value member from the given stream. + */ + public static ValueMember read(InputStream istream) + { + try + { + ValueMember value = new ValueMember(); + value.name = istream.read_string(); + value.id = istream.read_string(); + value.defined_in = istream.read_string(); + value.version = istream.read_string(); + value.type = TypeCodeHelper.read(istream); + value.type_def = IDLTypeHelper.read(istream); + value.access = istream.read_short(); + return value; + } + catch (UserException ex) + { + MARSHAL m = new MARSHAL(); + m.minor = Minor.UserException; + m.initCause(ex); + throw m; + } + } + + /** + * Writes the value member to the given stream. + */ + public static void write(OutputStream ostream, ValueMember value) + { + try + { + ostream.write_string(value.name); + ostream.write_string(value.id); + ostream.write_string(value.defined_in); + ostream.write_string(value.version); + TypeCodeHelper.write(ostream, value.type); + IDLTypeHelper.write(ostream, value.type_def); + ostream.write_short(value.access); + } + catch (UserException ex) + { + MARSHAL m = new MARSHAL(); + m.minor = Minor.UserException; + m.initCause(ex); + throw m; + } + } +} diff --git a/libjava/classpath/org/omg/CORBA/VersionSpecHelper.java b/libjava/classpath/org/omg/CORBA/VersionSpecHelper.java new file mode 100644 index 000000000..b6e57f1d7 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/VersionSpecHelper.java @@ -0,0 +1,116 @@ +/* VersionSpecHelper.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.CORBA; + +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 formal helper for the CORBA VersionSpec that is identical to the + * narrow string. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class VersionSpecHelper +{ + /** + * Insert the VersionSpec 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 VersionSpec 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 string alias typecode, named "VersionSpec". + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "VersionSpec", orb.create_string_tc(0)); + } + + /** + * Return the VersionSpec repository id. + * @return "IDL:omg.org/CORBA/VersionSpec:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/VersionSpec: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 (VersionSpec) value to write. + */ + public static void write(OutputStream ostream, String value) + { + ostream.write_string(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/VisibilityHelper.java b/libjava/classpath/org/omg/CORBA/VisibilityHelper.java new file mode 100644 index 000000000..7fd5d91a7 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/VisibilityHelper.java @@ -0,0 +1,118 @@ +/* VisibilityHelper.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.CORBA; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A helper operations for a Visibility that is mapped into java and CORBA + * <code>short</code>. The Visibility normally takes one of the two values, + * {@link PUBLIC_MEMBER#value} or {@link PRIVATE_MEMBER#value}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class VisibilityHelper +{ + /** + * Insert the Visibility into the given Any. + * Uses {@link Any#insert_short}. + */ + public static void insert(Any any, short that) + { + any.insert_short(that); + } + + /** + * Extract the Visibility from the given Any. + * Uses {@link Any#extract_short}. + */ + public static short extract(Any any) + { + return any.extract_short(); + } + + /** + * Return an alias of short, named "Visibility". + */ + public static TypeCode type() + { + TypeCode tshort = + OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_short); + return + OrbRestricted.Singleton.create_alias_tc(id(), "Visibility", tshort); + } + + /** + * Get the Visibility repository id. + * + * @return "IDL:omg.org/CORBA/Visibility:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/Visibility:1.0"; + } + + /** + * Read the visibility value (as short) from the CDR intput stream. + * + * Uses {@link InputStream#read_short()}. + * + * @param istream a stream to read from. + */ + public static short read(InputStream istream) + { + return istream.read_short(); + } + + /** + * Write the visibility value (as short) to the CDR output stream. + * + * USes {@link OutputStream#write_short(short)}. + * + * @param ostream a stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream ostream, short value) + { + ostream.write_short(value); + } +} diff --git a/libjava/classpath/org/omg/CORBA/WCharSeqHelper.java b/libjava/classpath/org/omg/CORBA/WCharSeqHelper.java new file mode 100644 index 000000000..fe4d41650 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/WCharSeqHelper.java @@ -0,0 +1,143 @@ +/* WCharSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA sequence of <code>char</code> + * (<code>WCharSeq</code>). + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class WCharSeqHelper +{ + /** + * Extract the <code>char[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link WCharSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link WCharSeqHolder}. + */ + public static char[] extract(Any a) + { + WCharSeqHolder h = (WCharSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>char[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link WCharSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, char[] that) + { + WCharSeqHolder holder = new WCharSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>char[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static char[] read(InputStream input) + { + char[] value = new char[ input.read_long() ]; + input.read_wchar_array(value, 0, value.length); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>WCharSeq</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_char); + } + + /** + * Writes the <code>char[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, char[] value) + { + output.write_long(value.length); + output.write_wchar_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/WCharSeqHolder.java b/libjava/classpath/org/omg/CORBA/WCharSeqHolder.java new file mode 100644 index 000000000..a1b04d1ef --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/WCharSeqHolder.java @@ -0,0 +1,126 @@ +/* WCharSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>WCharSeq</code> that is mapped into + * java <code>char[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class WCharSeqHolder + implements Streamable +{ + /** + * The <code>char[]</code> (CORBA <code>WCharSeq</code>) value, + * held by this WCharSeqHolder. + */ + public char[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_wchar); + + /** + * Constructs an instance of WCharSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public WCharSeqHolder() + { + } + + /** + * Constructs an instance of WCharSeqHolder, + * initializing {@link #value} to the given <code>char[]</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public WCharSeqHolder(char[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.InputStream#read_wchar_array }. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new char[ input.read_long() ]; + input.read_wchar_array(value, 0, value.length); + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code>) and then calls the + * {@link org.omg.CORBA.portable.OutputStream#write_wchar_array }. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + output.write_wchar_array(value, 0, value.length); + } +} diff --git a/libjava/classpath/org/omg/CORBA/WStringSeqHelper.java b/libjava/classpath/org/omg/CORBA/WStringSeqHelper.java new file mode 100644 index 000000000..ea8eac627 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/WStringSeqHelper.java @@ -0,0 +1,149 @@ +/* WStringSeqHelper.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with + * CORBA <code>wstring</code> array. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class WStringSeqHelper +{ + /** + * Extract the <code>String[]</code> from the + * given {@link Any}. This implementation expects the + * {@link Any} to hold the instance of {@link WStringSeqHolder} + * that is returned by {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws ClassCastException if the Any contains something other than the + * the {@link WStringSeqHolder}. + */ + public static String[] extract(Any a) + { + WStringSeqHolder h = (WStringSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id, delegating functionality to + * the {@link #type()}.id(). + */ + public static String id() + { + try + { + return type().id(); + } + catch (BadKind ex) + { + // Should never happen under correct work. + throw new Error("Please report this bug.", ex); + } + } + + /** + * Insert into the given <code>String[]</code> into the + * given {@link Any}. This implementation first creates + * a {@link WStringSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, String[] that) + { + WStringSeqHolder holder = new WStringSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>String[]</code> from the CORBA input stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static String[] read(InputStream input) + { + String[] value = new String[ input.read_long() ]; + for (int i = 0; i < value.length; i++) + { + value [ i ] = input.read_wstring(); + } + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the CORBA <code>wstring[]</code>. + * The length of the sequence is left with the initial + * value 0. + */ + public static TypeCode type() + { + return new ArrayTypeCode(TCKind.tk_string); + } + + /** + * Writes the <code>String[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, String[] value) + { + output.write_long(value.length); + + for (int i = 0; i < value.length; i++) + { + output.write_wstring(value [ i ]); + } + } +} diff --git a/libjava/classpath/org/omg/CORBA/WStringSeqHolder.java b/libjava/classpath/org/omg/CORBA/WStringSeqHolder.java new file mode 100755 index 000000000..b909210f3 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/WStringSeqHolder.java @@ -0,0 +1,131 @@ +/* WStringSeqHolder.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.CORBA; + +import gnu.CORBA.typecodes.ArrayTypeCode; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A sequence holder for CORBA <code>wstring[]</code> that is mapped into + * java <code>String[]</code>. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class WStringSeqHolder + implements Streamable +{ + /** + * The <code>String[]</code> (CORBA <code>wstring[]</code>) value, + * held by this WStringSeqHolder. + */ + public String[] value; + + /** + * The type code for this holder. Each holder has a different instance. + */ + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_wchar); + + /** + * Constructs an instance of WStringSeqHolder, + * initializing {@link #value} to <code>null</code>. + */ + public WStringSeqHolder() + { + } + + /** + * Constructs an instance of WStringSeqHolder, + * initializing {@link #value} to the given <code>String</code>. + * + * @param initial_value a value that will be assigned to the + * {@link #value} field. + */ + public WStringSeqHolder(String[] initial_value) + { + value = initial_value; + typecode.setLength(value.length); + } + + /** + * Fill in the {@link #value } field by reading the required data + * from the given stream. This method first reads the array size + * (as CORBA <code>long</code>and then all strings. + * + * @param input the input stream to read from. + */ + public void _read(InputStream input) + { + value = new String[ input.read_long() ]; + for (int i = 0; i < value.length; i++) + { + value [ i ] = input.read_wstring(); + } + typecode.setLength(value.length); + } + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + public TypeCode _type() + { + return typecode; + } + + /** + * Write the {@link #value } field to the given stream. + * This method first writes the array size + * (as CORBA <code>long</code> and then all strings. + * + * @param output the output stream to write into. + */ + public void _write(OutputStream output) + { + output.write_long(value.length); + + for (int i = 0; i < value.length; i++) + { + output.write_wstring(value [ i ]); + } + } +} diff --git a/libjava/classpath/org/omg/CORBA/WStringValueHelper.java b/libjava/classpath/org/omg/CORBA/WStringValueHelper.java new file mode 100644 index 000000000..a2b67ffec --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/WStringValueHelper.java @@ -0,0 +1,193 @@ +/* WStringValueHelper.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.CORBA; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.portable.BoxedValueHelper; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import java.io.Serializable; + +/** + * Provides helper operations for the Wide String value type, treating a + * Wide String as a CORBA value type rather than as a primitive type. The OMG + * specification states this may be convenient in some specific + * cases. The typecode is different, but the reading/writing format in + * this implementation is the same as for the ordinary wide string. This is + * that Sun's IDL compiler (v1.4) would generate. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public class WStringValueHelper + implements BoxedValueHelper +{ + /** + * The Wide String value helper repository Id. + */ + private static final String id = "IDL:omg.org/CORBA/WStringValue:1.0"; + + /** + * The Wide String typecode. + */ + private static final TypeCode twString = + OrbRestricted.Singleton.create_wstring_tc(0); + + /** + * Returns the String Value repository Id. + * @return "IDL:omg.org/CORBA/WStringValue:1.0", always. + */ + public String get_id() + { + return id; + } + + /** + * Returns the String Value repository Id. + * @return "IDL:omg.org/CORBA/WStringValue:1.0", always. + */ + public static String id() + { + return id; + } + + /** + * Read the wide string value from the input stream. + * + * @param istream a stream to read from. + * + * @return a string (delegates to read_wstring()). + */ + public Serializable read_value(InputStream istream) + { + return istream.read_wstring(); + } + + /** + * Write the given wide string value into the output stream. + * + * @param ostream a stream to write into. + * @param a_string a string to write. + */ + public void write_value(OutputStream ostream, Serializable a_string) + { + try + { + ostream.write_wstring((String) a_string); + } + catch (ClassCastException ex) + { + MARSHAL m = new MARSHAL("String expected"); + m.minor = Minor.ClassCast; + throw m; + } + } + + /** + * Extract the wide string from the given Any. The operation + * requires Any to hold a String value and not a String. + * + * @param an_any an Any to extract from. + * + * @return the extracted string. + */ + public static String extract(Any an_any) + { + if (an_any.type().equal(type())) + { + an_any.type(twString); + return an_any.extract_wstring(); + } + else + { + BAD_OPERATION bad = new BAD_OPERATION("WString value type expected"); + bad.minor = Minor.Any; + throw bad; + } + } + + /** + * Insert the wide string into the given Any. After the operation, + * the Any will have a Wide String Value typecode and not a + * String or WString typecode. + * + * @param an_any an Any to insert into. + * + * @param that a string to insert. + */ + public static void insert(Any an_any, String that) + { + an_any.insert_wstring(that); + an_any.type(type()); + } + + /** + * Reads a wide string as a value type. + * + * @param in a stream to read value from. + */ + public static String read(InputStream in) + { + return in.read_wstring(); + } + + /** + * Create and return the value box typecode, named "WStringValue", with the + * content typecode being unbounded string. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_value_box_tc(id(), "WStringValue", twString); + } + + /** + * Writes a wide string as a value type. + * + * @param out a stream to write value into. + * + * @param a_string a string to write. + */ + public static void write(OutputStream out, String a_string) + { + out.write_wstring(a_string); + } +} diff --git a/libjava/classpath/org/omg/CORBA/WrongTransaction.java b/libjava/classpath/org/omg/CORBA/WrongTransaction.java new file mode 100644 index 000000000..fc869a267 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/WrongTransaction.java @@ -0,0 +1,70 @@ +/* WrongTransaction.java -- Exception thrown due to out-of-bounds parameter + 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.CORBA; + +/** + * Thrown when the transaction scope mismatches. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class WrongTransaction + extends UserException +{ + + /** + * Constructs a default <code>WrongTransaction</code> exception, with + * no detail message. + */ + public WrongTransaction() + { + super(); + } + + /** + * Constructs a <code>WrongTransaction</code> exception using the specified + * message as the reason for throwing it. + * + * @param reason the reason, why the exception has been thrown. + */ + public WrongTransaction(String reason) + { + super(reason); + } + +} diff --git a/libjava/classpath/org/omg/CORBA/WrongTransactionHelper.java b/libjava/classpath/org/omg/CORBA/WrongTransactionHelper.java new file mode 100644 index 000000000..2854faaa0 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/WrongTransactionHelper.java @@ -0,0 +1,142 @@ +/* WrongTransactionHelper.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.CORBA; + +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 WrongTransaction}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class WrongTransactionHelper +{ + /** + * Create the WrongTransaction typecode (structure, + * named "WrongTransaction"), no fields. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 0 ]; + return orb.create_exception_tc(id(), "WrongTransaction", members); + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the WrongTransaction into the given Any. + * + * @param any the Any to insert into. + * @param that the WrongTransaction to insert. + */ + public static void insert(Any any, WrongTransaction that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the WrongTransaction from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain WrongTransaction. + */ + public static WrongTransaction extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (WrongTransaction) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("WrongTransaction expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the WrongTransaction repository id. + * + * @return "IDL:omg.org/CORBA/WrongTransaction:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/CORBA/WrongTransaction:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static WrongTransaction read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + WrongTransaction value = new WrongTransaction(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, WrongTransaction value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/CORBA/WrongTransactionHolder.java b/libjava/classpath/org/omg/CORBA/WrongTransactionHolder.java new file mode 100644 index 000000000..db47b5dfc --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/WrongTransactionHolder.java @@ -0,0 +1,103 @@ +/* WrongTransactionHolder.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.CORBA; + +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for the exception {@link WrongTransaction}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class WrongTransactionHolder implements Streamable +{ + /** + * The stored WrongTransaction value. + */ + public WrongTransaction value; + + /** + * Create the unitialised instance, leaving the value field + * with default <code>null</code> value. + */ + public WrongTransactionHolder() + { + } + + /** + * Create the initialised instance. + * @param initialValue the value that will be assigned to + * the <code>value</code> field. + */ + public WrongTransactionHolder(WrongTransaction initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link #value} by data from the CDR stream. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = WrongTransactionHelper.read(input); + } + + /** + * Write the stored value into the CDR stream. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + WrongTransactionHelper.write(output, value); + } + + /** + * Get the typecode of the WrongTransaction. + */ + public TypeCode _type() + { + return WrongTransactionHelper.type(); + } +} diff --git a/libjava/classpath/org/omg/CORBA/_IDLTypeStub.java b/libjava/classpath/org/omg/CORBA/_IDLTypeStub.java new file mode 100644 index 000000000..89f95d3c6 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/_IDLTypeStub.java @@ -0,0 +1,199 @@ +/* _IDLTypeStub.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.CORBA; + +import gnu.CORBA.Minor; +import gnu.CORBA.TypeCodeHelper; + +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.Delegate; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; + +import java.io.Serializable; + +/** + * The stub for the IDL type. This stub can be used to access the + * remote IDL type object, if its IOR is known. To create the + * working instance with the known IOR, pass {@link gnu.CORBA.IorDelegate} + * to the constructor. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class _IDLTypeStub + extends ObjectImpl + implements IDLType, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 9150293942452453626L; + + /** + * Create the instance of the IDL type stub without + * the set delegate. The delegate must be set anyway before calling + * any remote method. + */ + public _IDLTypeStub() + { + } + + /** + * Create an instance with the given delegate. + * + * @see gnu.CORBA.IorDelegate + */ + public _IDLTypeStub(Delegate delegate) + { + _set_delegate(delegate); + } + + /** + * Get the typecode of the remote IDL type object. The method is + * written following OMG specification, treating the typecode + * as a read only attribute rather than a method. This means, + * the operation name is "_get_type". + * + * @return a typecode, returned by the remote IDL type object. + */ + public TypeCode type() + { + InputStream in = null; + try + { + OutputStream out = _request("_get_type", true); + in = _invoke(out); + return TypeCodeHelper.read(in); + } + catch (ApplicationException ex) + { + in = ex.getInputStream(); + throw new org.omg.CORBA.MARSHAL(ex.getId()); + } + catch (RemarshalException rex) + { + return type(); + } + catch (UserException ex) + { + MARSHAL m = new MARSHAL(); + m.minor = Minor.UserException; + m.initCause(ex); + throw m; + } + finally + { + _releaseReply(in); + } + } + + /** + * Get the definition kind of the remote IDL type object. The method is + * written following OMG specification, treating the typecode + * as a read only attribute rather than a method. This means, + * the operation name is "_get_def_kind". + * + * @return a definition kind, returned by remote IDL type object. + */ + public DefinitionKind def_kind() + { + InputStream in = null; + try + { + OutputStream out = _request("_get_def_kind", true); + in = _invoke(out); + return DefinitionKindHelper.read(in); + } + catch (ApplicationException ex) + { + in = ex.getInputStream(); + throw new org.omg.CORBA.MARSHAL(ex.getId()); + } + catch (RemarshalException rex) + { + return def_kind(); + } + finally + { + _releaseReply(in); + } + } + + /** + * Destroy the remote IDL type object. + */ + public void destroy() + { + InputStream in = null; + try + { + OutputStream out = _request("destroy", true); + in = _invoke(out); + } + catch (ApplicationException ex) + { + in = ex.getInputStream(); + throw new org.omg.CORBA.MARSHAL(ex.getId()); + } + catch (RemarshalException rex) + { + destroy(); + } + finally + { + _releaseReply(in); + } + } + + /** + * Return the array of repository ids of the IDL type. + * + * @return "IDL:omg.org/CORBA/IDLType:1.0" and + * "IDL:omg.org/CORBA/IRObject:1.0", always. + */ + public String[] _ids() + { + return new String[] + { + "IDL:omg.org/CORBA/IDLType:1.0", "IDL:omg.org/CORBA/IRObject:1.0" + }; + } +} diff --git a/libjava/classpath/org/omg/CORBA/_PolicyStub.java b/libjava/classpath/org/omg/CORBA/_PolicyStub.java new file mode 100644 index 000000000..ebff735dc --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/_PolicyStub.java @@ -0,0 +1,174 @@ +/* _PolicyStub.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.CORBA; + +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.Delegate; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; + +import java.io.Serializable; + +/** + * The Policy stub (proxy), used on the client side. + * The {@link Policy} methods contain the code for remote + * invocaton. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class _PolicyStub + extends ObjectImpl + implements Policy, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 2453656196708903849L; + + /** + * Create the Policy stub. To get the stub working, + * you must later set the delegate with + * {@link ObjectImpl#_set_delegate(Delegate)}. + */ + public _PolicyStub() + { + } + + /** + * Create the naming context stub with the given delegate. + */ + public _PolicyStub(Delegate delegate) + { + _set_delegate(delegate); + } + + /** + * Return the array of repository ids for this object. + */ + public String[] _ids() + { + return new String[] { PolicyHelper.id() }; + } + + /** {@inheritDoc} */ + public void destroy() + { + InputStream input = null; + try + { + OutputStream output = _request("destroy", true); + input = _invoke(output); + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + destroy(); + } + finally + { + _releaseReply(input); + } + } + + /** {@inheritDoc} */ + public Policy copy() + { + InputStream input = null; + try + { + OutputStream output = _request("copy", true); + input = _invoke(output); + return PolicyHelper.read(input); + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + return copy(); + } + finally + { + _releaseReply(input); + } + } + + /** {@inheritDoc} */ + public int policy_type() + { + InputStream input = null; + try + { + OutputStream output = _request("policy_type", true); + input = _invoke(output); + + int returns = input.read_long(); + + return returns; + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + return policy_type(); + } + finally + { + _releaseReply(input); + } + } +} diff --git a/libjava/classpath/org/omg/CORBA/package.html b/libjava/classpath/org/omg/CORBA/package.html new file mode 100644 index 000000000..3815b19b0 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/package.html @@ -0,0 +1,122 @@ +<!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.CORBA</title></head> + +<body> +This package provides the support of <a href="http://www.CORBA.org">CORBA</a>; +see <a href="#overview">overview</a> of the implemented functionality. +<p> +CORBA a system that applications use to work over networks. CORBA messages +are binary, not text oriented. They practically cary no "data wrapping" +information like XML <opening> </closing> tags. Hence CORBA +objects easier exchange large amounts of binary data. CORBA can work +in such data-intensive application areas as telecommunications or radio +broadcasting. Java programs connect to CORBA objects without care +about what platform they run on, where they exist in the network, or what +language they were written in. The remote CORBA objects appear to the +programmer as the ordinary Java objects and can be passed as +parameters in both remote or local method invocations. +</p><p> +The CORBA processing unit is divided into {@link org.omg.CORBA.Object} +that is exposed to the client and the servant +({@link org.omg.PortableServer.Servant} where the method, invoked on +object, is finally delegated. It can be multiple objects per servant or +multiple servants per object. The servant for particular object or +even particular call can be dynamically chosen at run time using +{@link org.omg.PortableServer.ServantManager}. +</p><p> +All stages of both local and remote invocations on CORBA objects can be +monitored and modified using {@link org.omg.PortableInterceptor.Interceptor}. +The interceptors can add an extra data to the CORBA message (these data +can be later accessed by other interceptor on remote side). +</p> +<a name="overview"> +<h4>Overview of the currently implemented CORBA functionality</h4> +The CORBA implementation in the Classpath project is now a working +prototype. +<ul> +<li>This prototype is interoperable with Sun's implementation v 1.4, +transferring object references, primitive types, narrow and wide strings, +arrays, structures and trees between these two platforms. +</li> +<li>The prototype provides interoperable support for the Abstract interface + and Value types. Those appear in 1.3, being a feature of CORBA 2.3. +</li> +<li>The remote exceptions are also transferred and handled as expected. +</li> +<li>The support for parsing stringified object references (IORs), both +Big and Little Endian encoded, is implemented. +</li> +<li>The redirection commands works, LOCATION_FORWARD_PERM changing the +target address until the application is restarted and LOCATION_FORWARD +redirecting for the current session only. +</li> +<li>Both Little and Big Endian encoded messages are accepted. The encoding +of the sent messages is the same as used in the stringified IOR reference +of that object or Big Endian, if no such data available. +</li> +<li>You can use both request-oriented (based on {@link org.omg.CORBA.Request} +and stream-oriented (based on {@link org.omg.CORBA.portable.ObjectImpl} +invocation models. The current release includes the working examples, +demonstrating the client-server communication using both methods. +</li> +<li>These examples also show, how to use the Classpath naming service. +</li> +<li>The IDL compiler is not yet written (and not even started), but as a + side effect of the required compatibility, the implementation seems +accepting the output of the Sun's idlj. +</li> +<li>The Portable Object Adapter is already released. For details on POA, +see the {@link org.omg.PortableServer} package.</li> +<li>We provide the implementation of the {@link org.omg.DynamicAny} +package. ORB returns the working DynAnyFactory that produces working +DynAny's as defined in OMG specification.</li> +<li>The Portable Interceptor is also complete. See +{@link org.omg.PortableInterceptor} package for details how to register +and use CORBA interceptors. +<li>All GNU Classpath classes in omg.org namespace are newly written using + the OMG .pdf document (Version 3.0.3, formal/04-03-12). +</li> +</ul> + + @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +</body> +</html> + diff --git a/libjava/classpath/org/omg/CORBA/portable/ApplicationException.java b/libjava/classpath/org/omg/CORBA/portable/ApplicationException.java new file mode 100644 index 000000000..83a8aa8d1 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/ApplicationException.java @@ -0,0 +1,97 @@ +/* ApplicationException.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.CORBA.portable; + +import java.io.Serializable; + +/** + * This expection is thrown if the application throws an exception, + * defined as a part of its remote method definition. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public class ApplicationException + extends Exception + implements Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -2088103024111528125L; + + /** + * The input from where the exception parameters can be read. + */ + private final org.omg.CORBA.portable.InputStream m_input; + + /** + * The CORBA repository Id of the exception. + */ + private final String m_id; + + /** + * Creates an exception. + * + * @param id the CORBA repository Id of the exception. + * @param input the input from where the exception parameters can be read. + */ + public ApplicationException(String id, + org.omg.CORBA.portable.InputStream input + ) + { + m_id = id; + m_input = input; + } + + /** + * Get the CORBA repository Id of the exception. + */ + public String getId() + { + return m_id; + } + + /** + * Get the input stream from where the exception parameters can be read. + */ + public org.omg.CORBA.portable.InputStream getInputStream() + { + return m_input; + } +} diff --git a/libjava/classpath/org/omg/CORBA/portable/ApplicationException.jbx b/libjava/classpath/org/omg/CORBA/portable/ApplicationException.jbx new file mode 100644 index 000000000..0113ff3e0 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/ApplicationException.jbx @@ -0,0 +1,6 @@ +[PropertyInfo] +[IconNames] + + + + diff --git a/libjava/classpath/org/omg/CORBA/portable/BoxedValueHelper.java b/libjava/classpath/org/omg/CORBA/portable/BoxedValueHelper.java new file mode 100644 index 000000000..47c2b9106 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/BoxedValueHelper.java @@ -0,0 +1,79 @@ +/* BoxedValueHelper.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.CORBA.portable; + +import java.io.Serializable; + +/** + * Provides a helper operations for the boxed value type. + * A boxed value type is a value type with no inheritance, no methods + * and with a single state member. No additional properties can + * be defined. It is an error to box value types. + * + * The value type may have its own helper, implementing + * this interface. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface BoxedValueHelper +{ + /** + * Get the repository id of this value type. + * + * @return a repository id. + */ + String get_id(); + + /** + * Read this value type from the CDR stream. + * + * @param istream is a stream to read from. + * + * @return a loaded value type. + */ + Serializable read_value(InputStream istream); + + /** + * Write this value type to the CDR stream. + * + * @param ostream a stream to write to. + * @param value a value to write. + */ + void write_value(OutputStream ostream, Serializable value); +} diff --git a/libjava/classpath/org/omg/CORBA/portable/CustomValue.java b/libjava/classpath/org/omg/CORBA/portable/CustomValue.java new file mode 100644 index 000000000..dc46e8e25 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/CustomValue.java @@ -0,0 +1,57 @@ +/* CustomValue.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.CORBA.portable; + +import org.omg.CORBA.CustomMarshal; + +/** + * If the value type provides the user defined methods for reading + * and writing its content, it must implement this interface for reading + * and writing the content in a user-defined default way. This is done by + * implementing the {@link CustomMarshal#marshal} and + * {@link CustomMarshal#unmarshal}. The user must provide the supporting code. + * + * @see StreamableValue for specifying the IDL compiler generated IO methods. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface CustomValue + extends ValueBase, CustomMarshal +{ +} diff --git a/libjava/classpath/org/omg/CORBA/portable/Delegate.java b/libjava/classpath/org/omg/CORBA/portable/Delegate.java new file mode 100644 index 000000000..33812abe2 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/Delegate.java @@ -0,0 +1,436 @@ +/* Delegate.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.CORBA.portable; + +import gnu.java.lang.CPStringBuilder; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.Context; +import org.omg.CORBA.ContextList; +import org.omg.CORBA.DomainManager; +import org.omg.CORBA.ExceptionList; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.NVList; +import org.omg.CORBA.NamedValue; +import org.omg.CORBA.ORB; +import org.omg.CORBA.Policy; +import org.omg.CORBA.Request; +import org.omg.CORBA.SetOverrideType; + +/** + * Specifies a vendor specific implementation of the + * {@link org.omg.CORBA.Object} methods. The calls to these + * methods are forwarded to the object delegate that can be + * replaced, if needed. The first parameter is the actual + * CORBA object to that the operation must be applied. + * + * Some methods in this class are not abstract, but no implemented, + * thowing the {@link NO_IMPLEMENT}. This, however, does not mean that + * they are not implemented in the derived classes as well. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class Delegate +{ + /** + * Explains the reason of throwing the NO_IMPLEMENT. + */ + private static final String WHY = + "Following 1.4 API, this Delegate method must not be implemented. Override."; + + /** + * Create a request to invoke the method of this object. + * + * @param target the CORBA object, to that this operation must be applied. + * @param context a list of additional properties. + * @param operation the name of method to be invoked. + * @param parameters the method parameters. + * @param returns the container for tge method returned value. + * + * @return the created reaquest. + */ + public abstract Request create_request(org.omg.CORBA.Object target, + Context context, String operation, + NVList parameters, NamedValue returns + ); + + /** + * Create a request to invoke the method of this object, specifying + * context list and the list of the expected exception. + * + * @param target the CORBA object, to that this operation must be applied. + * @param context a list of additional properties. + * @param operation the name of method to be invoked. + * @param parameters the method parameters. + * @param returns the container for tge method returned value. + * @param exceptions the list of the possible exceptions that the method + * can throw. + * @param ctx_list the list of the context strings that need to be + * resolved and send as a context instance. + * + * @return the created reaquest. + */ + public abstract Request create_request(org.omg.CORBA.Object target, + Context context, String operation, + NVList parameters, NamedValue returns, + ExceptionList exceptions, + ContextList ctx_list + ); + + /** + * Duplicate the object reference. This does not make much sense for + * java platform and is just included for the sake of compliance with + * CORBA APIs. + * + * @param target the CORBA object, to that this operation must be applied. + * + * The method may return the object reference itself. + * + * @return as a rule, <code>this</code>. + */ + public abstract org.omg.CORBA.Object duplicate(org.omg.CORBA.Object target); + + /** + * Retrieve the domain managers for this object. + * + * @param target the CORBA object, to that this operation must be applied. + * + * @return the domain managers. + * + * @throws NO_IMPLEMENT, always (following the 1.4 specification). + */ + public DomainManager[] get_domain_managers(org.omg.CORBA.Object target) + { + throw new NO_IMPLEMENT(WHY); + } + + /** + * + * @param target the CORBA object, to that this operation must be applied. + * + * Get the <code>InterfaceDef</code> for this Object. + */ + public abstract org.omg.CORBA.Object get_interface_def(org.omg.CORBA.Object target); + + /** + * Returns the {@link Policy}, applying to this object. + * + * @param target the CORBA object, to that this operation must be applied. + * @param a_policy_type a type of policy to be obtained. + * @return a corresponding Policy object. + * + * @throws NO_IMPLEMENT, always (following the 1.4 specification). + */ + public Policy get_policy(org.omg.CORBA.Object target, int a_policy_type) + throws BAD_PARAM + { + throw new NO_IMPLEMENT(WHY); + } + + /** + * Get the hashcode this object reference. The same hashcode still + * does not means that the references are the same. From the other + * side, two different references may still refer to the same CORBA + * object. The returned value must not change during the object + * lifetime. + * + * @param target the CORBA object, to that this operation must be applied. + * @param maximum the maximal value to return. + * + * @return the hashcode. + */ + public abstract int hash(org.omg.CORBA.Object target, int maximum); + + /** + * Check if this object can be referenced by the given repository id. + * + * @param target the CORBA object, to that this operation must be applied. + * @param repositoryIdentifer the repository id. + * + * @return true if the passed parameter is a repository id of this + * CORBA object. + */ + public abstract boolean is_a(org.omg.CORBA.Object target, + String repositoryIdentifer + ); + + /** + * Return true if the other object references are equivalent, so far as + * it is possible to determine this easily. + * + * @param target the CORBA object, to that this operation must be applied. + * @param other the other object reference. + * + * @return true if both references refer the same object, false + * if they probably can refer different objects. + * + */ + public abstract boolean is_equivalent(org.omg.CORBA.Object target, + org.omg.CORBA.Object other + ); + + /** + * Returns true if the object is local. + * + * @param self the object to check. + * + * @return false, always (following 1.4 specs). Override to get + * functionality. + */ + public boolean is_local(org.omg.CORBA.Object self) + { + return false; + } + + /** + * Determines if the server object for this reference has already + * been destroyed. + * + * @param target the CORBA object, to that this operation must be applied. + * + * @return true if the object has been destroyed, false otherwise. + */ + public abstract boolean non_existent(org.omg.CORBA.Object target); + + /** + * Compares two objects for equality. The default implementations + * delegated call to {@link java.lang.Object#equals(java.lang.Object)}. + * + * @param self this CORBA object. + * @param other the other CORBA object. + * + * @return true if the objects are equal. + */ + public boolean equals(org.omg.CORBA.Object self, java.lang.Object other) + { + return self==other; + } + + /** + * Return the hashcode for this CORBA object. The default implementation + * delegates call to {@link #hash(org.omg.CORBA.Object, int)}, passing Integer.MAX_VALUE as an + * argument. + * + * @param target the object, for that the hash code must be computed. + * + * @return the hashcode. + */ + public int hashCode(org.omg.CORBA.Object target) + { + return hash(target, Integer.MAX_VALUE); + } + + /** + * Invoke the operation. + * + * @param target the invocation target. + * @param output the stream, containing the written arguments. + * + * @return the stream, from where the input parameters could be read. + * + * @throws ApplicationException if the application throws an exception, + * defined as a part of its remote method definition. + * + * @throws RemarshalException if reading(remarshalling) fails. + * + * @throws NO_IMPLEMENT, always (following the 1.4 specification). + */ + public InputStream invoke(org.omg.CORBA.Object target, + org.omg.CORBA.portable.OutputStream output + ) + throws ApplicationException, RemarshalException + { + throw new NO_IMPLEMENT(WHY); + } + + /** + * Provides the reference to ORB. + * + * @param target the object reference. + * + * @return the associated ORB. + * + * @throws NO_IMPLEMENT, always (following the 1.4 specification). + */ + public ORB orb(org.omg.CORBA.Object target) + { + throw new NO_IMPLEMENT(WHY); + } + + /** + * Free resoureces, occupied by this reference. The object implementation + * is not notified, and the other references to the same object are not + * affected. + * + * @param target the CORBA object, to that this operation must be applied. + */ + public abstract void release(org.omg.CORBA.Object target); + + /** + * Release the reply stream back to ORB after finishing reading the data + * from it. + * + * @param target the CORBA object, to that this operation must be applied. + * @param input the stream, normally returned by {@link #invoke} or + * {@link ApplicationException#getInputStream()}, can be null. + * + * The default method returns without action. + */ + public void releaseReply(org.omg.CORBA.Object target, + org.omg.CORBA.portable.InputStream input + ) + { + } + + /** + * Create a request to invoke the method of this CORBA object. + * + * @param target the CORBA object, to that this operation must be applied. + * @param operation the name of the method to invoke. + * + * @return the request. + */ + public abstract Request request(org.omg.CORBA.Object target, String operation); + + /** + * Create a request to invoke the method of this CORBA object. + * + * @param target the CORBA object, to that this operation must be applied. + * @param operation the name of the method to invoke. + * @param response_expected specifies if this is one way message or the + * response to the message is expected. + * + * @return the stream where the method arguments should be written. + */ + public org.omg.CORBA.portable.OutputStream request(org.omg.CORBA.Object target, + String operation, + boolean response_expected + ) + { + throw new NO_IMPLEMENT(WHY); + } + + /** + * This method is always called after invoking the operation on the + * local servant. + * + * The default method returns without action. + * + * @param self the object. + * @param servant the servant. + */ + public void servant_postinvoke(org.omg.CORBA.Object self, + ServantObject servant + ) + { + } + + /** + * Returns a servant that should be used for this request. + * The servant can also be casted to the expected type, calling the + * required method directly. + * + * @param self the object + * @param operation the operation + * @param expectedType the expected type of the servant. + * + * This implementation always returns null; override for different + * behavior. + * + * @return the servant or null if the servant is not an expected type + * of the method is not supported, for example, due security reasons. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + public ServantObject servant_preinvoke(org.omg.CORBA.Object self, + String operation, Class expectedType + ) + { + return null; + } + + /** + * Returns a new object with the new policies either replacing or + * extending the current policies, depending on the second parameter. + * + * @param target the CORBA object, to that this operation must be applied. + * @param policies the policy additions or replacements. + * @param how either {@link SetOverrideType#SET_OVERRIDE} to override the + * current policies of {@link SetOverrideType#ADD_OVERRIDE} to replace + * them. + * + * @throws NO_IMPLEMENT, always (following the 1.4 specification). + * + * @return the new reference with the changed policies. + */ + public org.omg.CORBA.Object set_policy_override(org.omg.CORBA.Object target, + Policy[] policies, + SetOverrideType how + ) + { + throw new NO_IMPLEMENT(WHY); + } + + /** + * Return a string representation of the passed object. + * + * @param self the CORBA object, to that the string representation must be + * returned. By default, the call is delegated to + * {@link java.lang.Object#toString()}. + * + * @return the string representation. + */ + public String toString(org.omg.CORBA.Object self) + { + if (self instanceof ObjectImpl) + { + ObjectImpl x = (ObjectImpl) self; + CPStringBuilder b = new CPStringBuilder(x.getClass().getName()); + b.append(": ["); + for (int i = 0; i < x._ids().length; i++) + { + b.append(x._ids() [ i ]); + b.append(" "); + } + b.append("]"); + return b.toString(); + } + else + return self.getClass().getName(); + } +} diff --git a/libjava/classpath/org/omg/CORBA/portable/IDLEntity.java b/libjava/classpath/org/omg/CORBA/portable/IDLEntity.java new file mode 100644 index 000000000..1e67a8835 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/IDLEntity.java @@ -0,0 +1,50 @@ +/* IDLEntity.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.CORBA.portable; + +import java.io.Serializable; + +/** + * Indicates that this class has a corresponding Helper class. + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface IDLEntity + extends Serializable +{ +} diff --git a/libjava/classpath/org/omg/CORBA/portable/IndirectionException.java b/libjava/classpath/org/omg/CORBA/portable/IndirectionException.java new file mode 100644 index 000000000..7fa46a1f6 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/IndirectionException.java @@ -0,0 +1,77 @@ +/* IndirectionException.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.CORBA.portable; + +import java.io.Serializable; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +/** + * This exception is thrown when reading from the ORBs input streams + * certain specific data layouts (object recursive references to itself). + * These layouts are not supported by this CORBA implementation. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public class IndirectionException + extends SystemException + implements Serializable +{ + /** + * Use v 1.4 serialVersionUID for interoperability. + */ + private static final long serialVersionUID = -1923858944380721643L; + + /** + * The stream offset, indicating, where the error has occured. + */ + public int offset; + + /** + * Create the indirection exception. + * + * @param an_offset the stream offset, indicating the error position. + */ + public IndirectionException(int an_offset) + { + super("Indirection exception", 0, CompletionStatus.COMPLETED_NO); + offset = an_offset; + } +} diff --git a/libjava/classpath/org/omg/CORBA/portable/InputStream.java b/libjava/classpath/org/omg/CORBA/portable/InputStream.java new file mode 100644 index 000000000..aee540d01 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/InputStream.java @@ -0,0 +1,287 @@ +/* InputStream.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.CORBA.portable; + +import java.math.BigDecimal; + +import org.omg.CORBA.Any; +import org.omg.CORBA.Context; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.ORB; +import org.omg.CORBA.Object; +import org.omg.CORBA.Principal; +import org.omg.CORBA.TypeCode; + +/** + * This class is used to read CORBA IDL data types. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class InputStream + extends java.io.InputStream +{ + /** + * Return the Object Request Broker that has created this stream. + * @return the ORB. This must be overridden, as the default + * method always returns null. + */ + public ORB orb() + { + return null; + } + + /** + * This should read the CORBA context, but following the 1.4 API + * specification, it must not be implemented. + * + * @throws NO_IMPLEMENT, always. + */ + public Context read_Context() + { + throw new NO_IMPLEMENT(); + } + + /** + * Read a CORBA (not java) object + * @return an object. + */ + public abstract org.omg.CORBA.Object read_Object(); + + /** + * Read a CORBA <code>char</code>. + * @return a value, corresponding the value of the CORBA <code>char</code>. + */ + public abstract char read_char(); + + /** + * Read a CORBA <code>double</code>. + * @return a value, corresponding the value of the CORBA <code>double</code>. + */ + public abstract double read_double(); + + /** + * Read a CORBA <code>float</code>. + * @return a value, corresponding the value of the CORBA <code>float</code>. + */ + public abstract float read_float(); + + /** + * Read a and array of CORBA float. + */ + public abstract void read_float_array(float[] value, int offset, int length); + + /** + * Read a CORBA <code>long</code> that is mapped into java <code>int</code>. + * @return an integer, corresponding the CORBA <code>long</code>. + */ + public abstract int read_long(); + + /** + * Read a CORBA <code>long long</code> that is mapped into java <code> + * long</code>. + * @return a value, corresponding the CORBA <code>long long</code> + */ + public abstract long read_longlong(); + + /** + * Read an array of CORBA <code>long long</code> + */ + public abstract void read_longlong_array(long[] value, int offset, int length); + + /** + * Read a CORBA <code>octed</code> that is mapped into java <code>byte</code>. + * @return a byte, corresponding the CORBA <code>octet</code>. + */ + public abstract byte read_octet(); + + /** + * Read a and array of CORBA octets that are mapped into java array of + * bytes. + */ + public abstract void read_octet_array(byte[] value, int offset, int length); + + /** + * Read a CORBA <code>short</code>. + * @return a value, corresponding the value of the CORBA <code>short</code>. + */ + public abstract short read_short(); + + public abstract void read_short_array(short[] value, int offset, int length); + + /** + * Read a CORBA unsigned long that is mapped into java <code>int</code>. + * @return an integer, matching the CORBA unsigned <code>long</code>. + */ + public abstract int read_ulong(); + + /** + * Read an array of CORBA unsigned long. + */ + public abstract void read_ulong_array(int[] value, int offset, int length); + + /** + * Should read from the stream, but following specification it does not. + * @throws java.io.IOException + * @throws NO_IMPLEMENT, always. + */ + public int read() + throws java.io.IOException + { + throw new NO_IMPLEMENT(); + } + + /** + * Read a TypeCode. + * @return a TypeCode. + */ + public abstract TypeCode read_TypeCode(); + + /** + * Read a CORBA <code>boolean</code>. + * @return a value, corresponding the value of the CORBA <code>boolean</code>. + */ + public abstract boolean read_boolean(); + + /** + * Read a and array of CORBA boolean values. + */ + public abstract void read_boolean_array(boolean[] value, int offset, + int length + ); + + /** + * Read a and array of CORBA characters. + */ + public abstract void read_char_array(char[] value, int offset, int length); + + /** + * Read a and array of CORBA doubles. + */ + public abstract void read_double_array(double[] value, int offset, int length); + + /** + * Read a and array of CORBA longs. + */ + public abstract void read_long_array(int[] value, int offset, int length); + + /** + * Read a CORBA <code>string</code> that is mapped into java + * <code>String</code>. + * @return a value, corresponding the value of the CORBA + * <code>string</code>. + */ + public abstract String read_string(); + + /** + * Read a and array of CORBA unsigned longs. + */ + public abstract long read_ulonglong(); + + /** + * Read a and array of CORBA unsigned longs. + */ + public abstract void read_ulonglong_array(long[] value, int offset, int length); + + /** + * Read a CORBA unsigned short that is mapped into java <code>short</code>. + * @return a value of the CORBA unsigned <code>short</code>. + */ + public abstract short read_ushort(); + + /** + * Read a and array of CORBA unsigned shorts. + */ + public abstract void read_ushort_array(short[] value, int offset, int length); + + /** + * Read a CORBA object that is an instance of the class, passed + * as an argument. This method is not abstract, but following the + * specifications it must not be implemented. + * + * @param klass a CORBA class + * @throws NO_IMPLEMENT, always. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + public Object read_Object(Class klass) + { + throw new NO_IMPLEMENT(); + } + + /** + * Read a CORBA <code>Any</code>. + * @return an <code>Any</code>. + */ + public abstract Any read_any(); + + /** + * Read a CORBA <code>fixed</code>. This method is not abstract, + * but following the specifications it must not be implemented. + * + * @throws NO_IMPLEMENT, always. + */ + public BigDecimal read_fixed() + { + throw new NO_IMPLEMENT(); + } + + /** + * Read a CORBA <code>wchar</code> that is mapped into java <code>char</code>. + * @return a value, corresponding the value of the CORBA <code>wchar</code>. + */ + public abstract char read_wchar(); + + public abstract void read_wchar_array(char[] value, int offset, int length); + + /** + * Read a CORBA <code>wstring</code> that is mapped into + * java <code>String</code>. + * @return a string, corresponding CORBA <code>wstring</code>. + */ + public abstract String read_wstring(); + + /** + * Read a CORBA <code>Principal</code>. + * @deprecated by CORBA 2.2 + * @return a Principal. + */ + public Principal read_Principal() + { + throw new NO_IMPLEMENT(); + } +} diff --git a/libjava/classpath/org/omg/CORBA/portable/InvokeHandler.java b/libjava/classpath/org/omg/CORBA/portable/InvokeHandler.java new file mode 100644 index 000000000..d4381204a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/InvokeHandler.java @@ -0,0 +1,66 @@ +/* InvokeHandler.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.CORBA.portable; + +import org.omg.CORBA.SystemException; + +/** + * Provides the dispatching mechanism for incoming call. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface InvokeHandler +{ + /** + * Invoke the object method. + * + * @param method the name of the method to invoke. + * @param input the input stream to read parameters from. + * @param handler the response handler, used for creating the reply. + * + * @return the output stream, returned by {@link ResponseHandler}. + * The response values are already written to that stream. + * + * @throws SystemException if invocation has failed due CORBA system exception. + */ + OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream input, + ResponseHandler handler + ) + throws SystemException; +} diff --git a/libjava/classpath/org/omg/CORBA/portable/ObjectImpl.java b/libjava/classpath/org/omg/CORBA/portable/ObjectImpl.java new file mode 100644 index 000000000..c7ee707f3 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/ObjectImpl.java @@ -0,0 +1,401 @@ +/* ObjectImpl.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.CORBA.portable; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.Context; +import org.omg.CORBA.ContextList; +import org.omg.CORBA.DomainManager; +import org.omg.CORBA.ExceptionList; +import org.omg.CORBA.NVList; +import org.omg.CORBA.NamedValue; +import org.omg.CORBA.ORB; +import org.omg.CORBA.Policy; +import org.omg.CORBA.Request; +import org.omg.CORBA.SetOverrideType; + +/** + * The basic implementation of the CORBA Object. The most of the methods + * delegate the functionality to the {@link Delegate} that can be replaced + * by {@link #_set_delegate(Delegate)}. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectImpl + implements org.omg.CORBA.Object +{ + /** + * The delegate, responsible for the method implementations. + */ + transient Delegate delegate; + + /** + * Create a request to invoke the method of this object, specifying + * context list and the list of the expected exception. + * + * @param context a list of additional properties. + * @param operation the name of method to be invoked. + * @param parameters the method parameters. + * @param returns the container for tge method returned value. + * @param exceptions the list of the possible exceptions that the method + * can throw. + * @param ctx_list the list of the context strings that need to be + * resolved and send as a context instance. + * + * @return the created reaquest. + */ + public Request _create_request(Context context, String operation, + NVList parameters, NamedValue returns, + ExceptionList exceptions, ContextList ctx_list + ) + { + return delegate.create_request(this, context, operation, parameters, + returns, exceptions, ctx_list + ); + } + + /** + * Create a request to invoke the method of this object. + * + * @param context a list of additional properties. + * @param operation the name of method to be invoked. + * @param parameters the method parameters. + * @param returns the container for tge method returned value. + * + * @return the created reaquest. + */ + public Request _create_request(Context context, String operation, + NVList parameters, NamedValue returns + ) + { + return delegate.create_request(this, context, operation, parameters, returns); + } + + /** + * Duplicate the object reference. This does not make much sense for + * java platform and is just included for the sake of compliance with + * CORBA APIs. + * + * The method may return the object reference itself. + * + * @return as a rule, <code>this</code>. + */ + public org.omg.CORBA.Object _duplicate() + { + return delegate.duplicate(this); + } + + /** + * Get vendor specific delegate, responsible for the implemented + * functionality. + */ + public Delegate _get_delegate() + { + return delegate; + } + + /** + * Retrieve the domain managers for this object. + * + * @return the domain managers. + */ + public DomainManager[] _get_domain_managers() + { + return delegate.get_domain_managers(this); + } + + /** + * Get the <code>InterfaceDef</code> for this Object. + */ + public org.omg.CORBA.Object _get_interface_def() + { + return delegate.get_interface_def(this); + } + + /** + * Returns the {@link Policy}, applying to this object. + * + * @param a_policy_type a type of policy to be obtained. + * @return a corresponding Policy object. + * + * @throws BAD_PARAM if the policy of the given type is not + * associated with this object, or if it is not supported by this ORB. + */ + public Policy _get_policy(int a_policy_type) + { + return delegate.get_policy(this, a_policy_type); + } + + /** + * Get the array of interface repository ids, defining this object. + */ + public abstract String[] _ids(); + + /** + * Get the hashcode this object reference. The same hashcode still + * does not means that the references are the same. From the other + * side, two different references may still refer to the same CORBA + * object. The returned value must not change during the object + * lifetime. + * + * @param max the maximal value to return. + * + * @return the hashcode. + */ + public int _hash(int max) + { + return delegate.hash(this, max); + } + + /** + * Invoke the operation. + * + * @param output the stream, containing the written arguments. + * + * @return the stream, from where the input parameters could be read. + * + * @throws ApplicationException if the application throws an exception, + * defined as a part of its remote method definition. + * + * @throws RemarshalException if reading(remarshalling) fails. + */ + public InputStream _invoke(OutputStream output) + throws org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException + { + return delegate.invoke(this, output); + } + + /** + * Check if this object can be referenced by the given repository id. + * + * @param idl_id the repository id. + * + * @return true if the passed parameter is a repository id of this + * CORBA object. + */ + public boolean _is_a(String idl_id) + { + return delegate.is_a(this, idl_id); + } + + /** + * Return true if the other object references are equivalent, so far as + * it is possible to determine this easily. + * + * @param other the other object reference. + * + * @return true if both references refer the same object, false + * if they probably can refer different objects. Uses direct + * comparison if the delegate has not been set. + */ + public boolean _is_equivalent(org.omg.CORBA.Object other) + { + return (delegate == null) ? this == other + : delegate.is_equivalent(this, other); + } + + /** + * Returns true if the object is local. + * + * @return false, always (following 1.4 specs). Override to get + * functionality. + */ + public boolean _is_local() + { + return delegate.is_local(this); + } + + /** + * Determines if the server object for this reference has already + * been destroyed. + * + * @return true if the object has been destroyed, false otherwise. + */ + public boolean _non_existent() + { + return delegate.non_existent(this); + } + + /** + * Provides the reference to ORB. + * + * @return the associated ORB. + */ + public ORB _orb() + { + return delegate.orb(this); + } + + /** + * Free resoureces, occupied by this reference. The object implementation + * is not notified, and the other references to the same object are not + * affected. + */ + public void _release() + { + delegate.release(this); + } + + /** + * Release the reply stream back to ORB after finishing reading the data + * from it. + * + * @param stream the stream, normally returned by {@link #_invoke} or + * {@link ApplicationException#getInputStream()}, can be null. + */ + public void _releaseReply(InputStream stream) + { + if (delegate != null) + delegate.releaseReply(this, stream); + } + + /** + * Create a request to invoke the method of this CORBA object. + * + * @param method the name of the method to invoke. + * + * @return the request. + */ + public Request _request(String method) + { + return delegate.request(this, method); + } + + /** + * Create a request to invoke the method of this CORBA object. + * + * @param method the name of the method to invoke. + * @param response_expected specifies if this is one way message or the + * response to the message is expected. + * + * @return the stream where the method arguments should be written. + */ + public org.omg.CORBA.portable.OutputStream _request(String method, + boolean response_expected + ) + { + return delegate.request(this, method, response_expected); + } + + /** + * This method is always called after invoking the operation on the + * local servant. + * + * The default method returns without action. + * + * @param servant the servant. + */ + public void _servant_postinvoke(ServantObject servant) + { + delegate.servant_postinvoke(this, servant); + } + + /** + * Returns a servant that should be used for this request. + * The servant can also be casted to the expected type, calling the + * required method directly. + * + * @param method the operation + * @param expected_type the expected type of the servant. + * + * This implementation always returns null; override for different + * behavior. + * + * @return the servant or null if the servant is not an expected type + * of the method is not supported, for example, due security reasons. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + public ServantObject _servant_preinvoke(String method, Class expected_type) + { + return delegate.servant_preinvoke(this, method, expected_type); + } + + /** + * Set the delegate, responsible for the implemented functionality. + * + * @param a_delegate a delegate, responsible for the implemented + * functionality. + */ + public void _set_delegate(Delegate a_delegate) + { + delegate = a_delegate; + } + + /** + * Returns a new object with the new policies either replacing or + * extending the current policies, depending on the second parameter. + * + * @param policies the policy additions or replacements. + * @param how either {@link SetOverrideType#SET_OVERRIDE} to override the + * current policies of {@link SetOverrideType#ADD_OVERRIDE} to replace + * them. + */ + public org.omg.CORBA.Object _set_policy_override(Policy[] policies, + SetOverrideType how + ) + { + return delegate.set_policy_override(this, policies, how); + } + + /** + * Check if this object is equal to another object. + * + * @param other the other object to compare. + * + * @return true if the objects are equal. + */ + public boolean equals(java.lang.Object other) + { + if (delegate == null) + return this == other; + else + return delegate.equals(this, other); + } + + /** + * Return the string representation of the passed object. + * + * @return the string representation. + */ + public String toString() + { + return delegate.toString(this); + } +} diff --git a/libjava/classpath/org/omg/CORBA/portable/OutputStream.java b/libjava/classpath/org/omg/CORBA/portable/OutputStream.java new file mode 100644 index 000000000..f40be2365 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/OutputStream.java @@ -0,0 +1,283 @@ +/* OutputStream.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.CORBA.portable; + +import org.omg.CORBA.Any; +import org.omg.CORBA.Context; +import org.omg.CORBA.ContextList; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.ORB; +import org.omg.CORBA.Principal; +import org.omg.CORBA.TypeCode; + +import java.io.IOException; + +import java.math.BigDecimal; + +/** + * This class is used to write CORBA IDL data types. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class OutputStream + extends java.io.OutputStream +{ + /** + * Returns an input stream with the same buffer. + * @return an input stream + */ + public abstract InputStream create_input_stream(); + + /** + * Return the Object Request Broker that has created this stream. + * @return the ORB. This must be overridden, as the default + * method always returns null. + */ + public ORB orb() + { + return null; + } + + /** + * Should write an byte (lower 8 bits) to the output stream, but, + * following specification, it does not and + * must be overridden to get a functionality. + * + * @param n an integer to write. + * + * @throws NO_IMPLEMENT, always. + * @throws IOException in overriden methods. + */ + public void write(int n) + throws IOException + { + throw new NO_IMPLEMENT(); + } + + /** + * Should write a CORBA context to the output stream, but, + * following the 1.4 specification, it does not and + * must be overridden to get a functionality. + * + * @throws NO_IMPLEMENT, always. + */ + public void write_Context(Context context, ContextList contexts) + { + throw new NO_IMPLEMENT(); + } + + /** + * Write CORBA (not java) Object. + */ + public abstract void write_Object(org.omg.CORBA.Object x); + + /** + * Should write a principal to the output stream, but, + * following specification, it does not and + * must be overridden to get a functionality. + * + * @deprecated by CORBA 2.2 + * + * @param principal a Principal to write + * + * @throws NO_IMPLEMENT, always. + */ + public void write_Principal(Principal principal) + { + throw new NO_IMPLEMENT(); + } + + /** + * Write TypeCode. + */ + public abstract void write_TypeCode(TypeCode x); + + /** + * Write CORBA <code>Any</code>. + */ + public abstract void write_any(Any x); + + /** + * Write CORBA <code>boolean</code>. + */ + public abstract void write_boolean(boolean x); + + /** + * Write CORBA <code>booelan[]</code>. + */ + public abstract void write_boolean_array(boolean[] x, int ofs, int len); + + /** + * Write CORBA <code>char</code>. + */ + public abstract void write_char(char x); + + /** + * Write CORBA <code>char[]</code>. + */ + public abstract void write_char_array(char[] chars, int offset, int length); + + /** + * Write CORBA <code>double</code>. + */ + public abstract void write_double(double x); + + /** + * Write CORBA <code>double[]</code>. + */ + public abstract void write_double_array(double[] x, int ofs, int len); + + /** + * Should write a BigDecimal number, but, following specification, + * it does not and must be overridden to get a functionality. + * + * @param fixed a number to write + * @throws NO_IMPLEMENT, always. + */ + public void write_fixed(BigDecimal fixed) + { + throw new NO_IMPLEMENT(); + } + + /** + * Write CORBA <code>float</code>. + */ + public abstract void write_float(float x); + + /** + * Write CORBA <code>float[]</code>. + */ + public abstract void write_float_array(float[] x, int ofs, int len); + + /** + * Write CORBA <code>long</code> that is mapped into java <code>int</code>. + */ + public abstract void write_long(int x); + + /** + * Write CORBA <code>long[]</code>. + */ + public abstract void write_long_array(int[] x, int ofs, int len); + + /** + * Write CORBA <code>long long</code> that is mapped into + * java <code>long</code>. + */ + public abstract void write_longlong(long x); + + /** + * Write CORBA <code>long long []</code>. + */ + public abstract void write_longlong_array(long[] x, int ofs, int len); + + /** + * Write CORBA <code>octed</code> that is mapped into java <code>byte</code> + */ + public abstract void write_octet(byte x); + + /** + * Write CORBA <code>octet[]</code>. + */ + public abstract void write_octet_array(byte[] x, int ofs, int len); + + /** + * Write CORBA <code>short</code>. + */ + public abstract void write_short(short x); + + /** + * Write CORBA <code>short[]</code>. + */ + public abstract void write_short_array(short[] x, int ofs, int len); + + /** + * Write CORBA <code>string</code>. + */ + public abstract void write_string(String x); + + /** + * Write unsigned CORBA <code>long</code> that is mapped into + * java <code>int</code>. + */ + public abstract void write_ulong(int x); + + /** + * Write array of CORBA unsigned longs. + */ + public abstract void write_ulong_array(int[] x, int ofs, int len); + + /** + * Write unsigned CORBA <code>long long </code> that is mapped into + * java <code>long</code>. + */ + public abstract void write_ulonglong(long x); + + /** + * Write array of unsigned CORBA long-longs. + */ + public abstract void write_ulonglong_array(long[] x, int ofs, int len); + + /** + * Write unsigned CORBA <code>short</code> that is mapped into + * java <code>short</code>. + */ + public abstract void write_ushort(short x); + + /** + * Write array of unsigned CORBA shorts. + */ + public abstract void write_ushort_array(short[] x, int ofs, int len); + + /** + * Write CORBA <code>wchar</code> that is mapped into + * java <code>char</code>. + */ + public abstract void write_wchar(char x); + + /** + * Write array of CORBA wchars. + */ + public abstract void write_wchar_array(char[] chars, int offset, int length); + + /** + * Write CORBA <code>wstring</code> that is mapped into + * java <code>string</code>. + */ + public abstract void write_wstring(String x); +} diff --git a/libjava/classpath/org/omg/CORBA/portable/RemarshalException.java b/libjava/classpath/org/omg/CORBA/portable/RemarshalException.java new file mode 100644 index 000000000..14836ea14 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/RemarshalException.java @@ -0,0 +1,59 @@ +/* RemarshalException.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.CORBA.portable; + +import java.io.Serializable; + +/** + * This is exception is potentially thrown by the _invoke() + * method of the object implementation, requiring to write the method + * parameters repeatedly. The parameters must be re-written as long as this + * exception is thrown. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public final class RemarshalException + extends Exception + implements Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -7025491253080954918L; +} diff --git a/libjava/classpath/org/omg/CORBA/portable/ResponseHandler.java b/libjava/classpath/org/omg/CORBA/portable/ResponseHandler.java new file mode 100644 index 000000000..1715b01b3 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/ResponseHandler.java @@ -0,0 +1,58 @@ +/* ResponseHandler.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.CORBA.portable; + +/** + * The interface, able to return streams, where the reply data can be + * marshalled. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface ResponseHandler +{ + /** + * Create a stream, suitable for writing a user exception. + */ + org.omg.CORBA.portable.OutputStream createExceptionReply(); + + /** + * Create a stream for writing an ordinary reply (not an exception). + */ + org.omg.CORBA.portable.OutputStream createReply(); +} diff --git a/libjava/classpath/org/omg/CORBA/portable/ServantObject.java b/libjava/classpath/org/omg/CORBA/portable/ServantObject.java new file mode 100644 index 000000000..253defc0a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/ServantObject.java @@ -0,0 +1,61 @@ +/* ServantObject.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.CORBA.portable; + + +/** + * Together with supporting methods in {@link ObjectImpl} and {@link Delegate}, + * provides mechanism for direct calls of clients, running on the same + * virtual machine (collocated). + * + * @see ObjectImpl#_servant_preinvoke(String, Class) + * @see ObjectImpl#_servant_postinvoke(ServantObject) + * @see Delegate#servant_preinvoke(org.omg.CORBA.Object, String, Class) + * @see Delegate#servant_postinvoke(org.omg.CORBA.Object, ServantObject) + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public class ServantObject +{ + /** + * The real servant, that can be casted to the expected type, later + * invoking the methods directly. + */ + public java.lang.Object servant; +} diff --git a/libjava/classpath/org/omg/CORBA/portable/Streamable.java b/libjava/classpath/org/omg/CORBA/portable/Streamable.java new file mode 100644 index 000000000..c59ee2a02 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/Streamable.java @@ -0,0 +1,70 @@ +/* Streamable.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.CORBA.portable; + +import org.omg.CORBA.TypeCode; + +/** + * The base class for the Holder classess of IDL types. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface Streamable +{ + /** + * Fill in the value field for this holder by reading the required data + * from the given stream. + * + * @param input the input stream to read from. + */ + void _read(InputStream input); + + /** + * Returns the TypeCode, corresponding the CORBA type that is stored + * using this holder. + */ + TypeCode _type(); + + /** + * Write the value field to the given stream. + * + * @param output the output stream to write into. + */ + void _write(OutputStream output); +} diff --git a/libjava/classpath/org/omg/CORBA/portable/StreamableValue.java b/libjava/classpath/org/omg/CORBA/portable/StreamableValue.java new file mode 100644 index 000000000..13dbad210 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/StreamableValue.java @@ -0,0 +1,57 @@ +/* StreamableValue.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.CORBA.portable; + +import java.io.Serializable; + +/** + * If the value type does not provide the user defined methods for reading + * and writing its content, it must implement this interface for reading + * and writing the content in a default way. This is done by implementing + * the {@link Streamable#_read} and {@link Streamable#_write}. IDL compiler + * should generate the implementation of this interface automatically. + * + * @see CustomValue for specifying the user-defined io methods. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface StreamableValue + extends Streamable, Serializable, ValueBase, IDLEntity +{ +} diff --git a/libjava/classpath/org/omg/CORBA/portable/UnknownException.java b/libjava/classpath/org/omg/CORBA/portable/UnknownException.java new file mode 100644 index 000000000..a9b754b21 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/UnknownException.java @@ -0,0 +1,76 @@ +/* UnknownException.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.CORBA.portable; + +import java.io.Serializable; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +/** + * The wrapper of the arbitrary exception into the System exception. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public class UnknownException + extends SystemException + implements Serializable +{ + /** + * Use serialVersionUID (1.4) for interoperability. + */ + private static final long serialVersionUID = 1725238280802233450L; + + /** + * The original exception. + */ + public Throwable originalEx; + + /** + * Create a new unknown exception, wrapping a reason. + * + * @param reason an exception that has caused this unknown exception. + */ + public UnknownException(Throwable reason) + { + super("" + reason, 0, CompletionStatus.COMPLETED_MAYBE); + + originalEx = reason; + } +} diff --git a/libjava/classpath/org/omg/CORBA/portable/ValueBase.java b/libjava/classpath/org/omg/CORBA/portable/ValueBase.java new file mode 100644 index 000000000..167f532ac --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/ValueBase.java @@ -0,0 +1,74 @@ +/* ValueBase.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.CORBA.portable; + + +/** + * ValueBase is the basic interface for all CORBA value data types. A value + * type is something between CORBA structure and CORBA object. Like CORBA + * object, it can have methods, supporting some IDL-defined interface. + * However, like structures, they are local and passed by value, + * not by IOR reference. + * + * Unlike CORBA objects, values are not connected to any ORB by + * default; they hanlde the implemented functionality locally. The classes, + * required to implement that functionality, should either be pre-defined + * or they can be downloaded from the certain URL, defined as CodeBase. + * + * The value types can have both public and private members. They support + * inheritance. Value types can also be abstract. + * + * For transferring the value type data via stream, it must implement either + * {@link CustomValue} or {@link StreamableValue}. + * + * @since 1.3 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ValueBase + extends IDLEntity +{ + /** + * Get the truncatable repository ids. + * + * @return the array of repository ids, defining the base types, to that + * basic types this value base can be truncated. + */ + String[] _truncatable_ids(); +} diff --git a/libjava/classpath/org/omg/CORBA/portable/ValueFactory.java b/libjava/classpath/org/omg/CORBA/portable/ValueFactory.java new file mode 100644 index 000000000..aaffe8684 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/ValueFactory.java @@ -0,0 +1,62 @@ +/* ValueFactory.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.CORBA.portable; + +import java.io.Serializable; + +/** + * An interface for reading an instance of the value type + * from the input stream. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public interface ValueFactory +{ + /** + * Read the value type. The method is responsible both + * for creating a new instance of the value type and + * reading the content of this nstance from the stream. + * + * @param from_stream a stream to read from. + * + * @return a created value type, intialised with the data from + * the stream. + */ + Serializable read_value(org.omg.CORBA_2_3.portable.InputStream from_stream); +} diff --git a/libjava/classpath/org/omg/CORBA/portable/package.html b/libjava/classpath/org/omg/CORBA/portable/package.html new file mode 100644 index 000000000..8104136e0 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/portable/package.html @@ -0,0 +1,50 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html - describes classes in org.omg.CORBA.portable package + 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.CORBA.portable</title></head> + +<body> +<p>This package defines CDR streams, +used for communications between orbs, normally via network. +It also declares mechanisms, enabling the code, provided by one vendor, to run on the +{@link org.omg.CORBA.ORB}, implemented by another vendor.</p> + +@author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +</body> +</html> |