diff options
Diffstat (limited to 'libjava/classpath/org/omg/CORBA')
98 files changed, 2879 insertions, 431 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 00000000000..ea234e620c8 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ACTIVITY_COMPLETED.java @@ -0,0 +1,102 @@ +/* ACTIVITY_COMPLETED.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; + +/** + * 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 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 reason 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 00000000000..c0c72b524b1 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/ACTIVITY_REQUIRED.java @@ -0,0 +1,100 @@ +/* ACTIVITY_REQUIRED.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; + +/** + * 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 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 reason 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/AnyHolder.java b/libjava/classpath/org/omg/CORBA/AnyHolder.java index 0055fdd7482..10f828aabe5 100644 --- a/libjava/classpath/org/omg/CORBA/AnyHolder.java +++ b/libjava/classpath/org/omg/CORBA/AnyHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -55,7 +55,7 @@ public final class AnyHolder /** * The default type code for this holder. */ - private static final TypeCode t_any = new primitiveTypeCode(TCKind.tk_any); + private static final TypeCode t_any = new PrimitiveTypeCode(TCKind.tk_any); /** * The instance of {@link Any} (not the "any value"), held by this holder. diff --git a/libjava/classpath/org/omg/CORBA/AnySeqHelper.java b/libjava/classpath/org/omg/CORBA/AnySeqHelper.java index 5c45bb3d83b..8ebae7a193f 100644 --- a/libjava/classpath/org/omg/CORBA/AnySeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/AnySeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -130,7 +130,7 @@ public abstract class AnySeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_any); + return new ArrayTypeCode(TCKind.tk_any); } /** diff --git a/libjava/classpath/org/omg/CORBA/AnySeqHolder.java b/libjava/classpath/org/omg/CORBA/AnySeqHolder.java index 905e05c8b03..b18a1457b15 100644 --- a/libjava/classpath/org/omg/CORBA/AnySeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/AnySeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class AnySeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_any); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_any); /** * Constructs an instance of AnySeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/BAD_OPERATION.java b/libjava/classpath/org/omg/CORBA/BAD_OPERATION.java index 26b3406658f..2649f2a6dc4 100755 --- a/libjava/classpath/org/omg/CORBA/BAD_OPERATION.java +++ b/libjava/classpath/org/omg/CORBA/BAD_OPERATION.java @@ -41,8 +41,76 @@ package org.omg.CORBA; import java.io.Serializable; /** - * Means that the object exists but does not support the operation that - * was invoked on it. + * 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) */ @@ -50,14 +118,15 @@ public class BAD_OPERATION extends SystemException implements Serializable { - /** - * Use serialVersionUID for interoperability. + /** + * 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. + * Creates a BAD_OPERATION with the default minor code of 0, completion state + * COMPLETED_NO and the given explaining message. + * * @param reasom the explaining message. */ public BAD_OPERATION(String message) @@ -66,16 +135,18 @@ public class BAD_OPERATION } /** - * Creates BAD_OPERATION with the default minor code of 0 and a - * completion state 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. + /** + * Creates a BAD_OPERATION exception with the specified minor code and + * completion status. + * * @param minor additional error code. * @param completed the method completion status. */ @@ -86,6 +157,7 @@ public class BAD_OPERATION /** * Created BAD_OPERATION exception, providing full information. + * * @param reason explaining message. * @param minor additional error code (the "minor"). * @param completed the method completion status. 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 00000000000..ba8a0df3248 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/BAD_QOS.java @@ -0,0 +1,99 @@ +/* BAD_QOS.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; + +/** + * 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 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 reason 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/BooleanHolder.java b/libjava/classpath/org/omg/CORBA/BooleanHolder.java index eddc62933a9..73cfeb29613 100644 --- a/libjava/classpath/org/omg/CORBA/BooleanHolder.java +++ b/libjava/classpath/org/omg/CORBA/BooleanHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,7 +62,7 @@ public final class BooleanHolder * The default type code for this holder. */ private static final TypeCode t_boolean = - new primitiveTypeCode(TCKind.tk_boolean); + new PrimitiveTypeCode(TCKind.tk_boolean); /** * The <code>boolean</code> (CORBA <code>boolean</code>) value, diff --git a/libjava/classpath/org/omg/CORBA/BooleanSeqHelper.java b/libjava/classpath/org/omg/CORBA/BooleanSeqHelper.java index d1fde8b7726..41f93d10d73 100644 --- a/libjava/classpath/org/omg/CORBA/BooleanSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/BooleanSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class BooleanSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_boolean); + return new ArrayTypeCode(TCKind.tk_boolean); } /** diff --git a/libjava/classpath/org/omg/CORBA/BooleanSeqHolder.java b/libjava/classpath/org/omg/CORBA/BooleanSeqHolder.java index ac8224f92e6..bdec3b79273 100644 --- a/libjava/classpath/org/omg/CORBA/BooleanSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/BooleanSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class BooleanSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_boolean); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_boolean); /** * Constructs an instance of BooleanSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/ByteHolder.java b/libjava/classpath/org/omg/CORBA/ByteHolder.java index 0cfd8f03cba..c440822e58c 100644 --- a/libjava/classpath/org/omg/CORBA/ByteHolder.java +++ b/libjava/classpath/org/omg/CORBA/ByteHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,7 +62,7 @@ public final class ByteHolder * The default type code for this holder. */ private static final TypeCode t_octet = - new primitiveTypeCode(TCKind.tk_octet); + new PrimitiveTypeCode(TCKind.tk_octet); /** * The <code>byte</code> (CORBA <code>octet</code>) 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 00000000000..41ccaf49248 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/CODESET_INCOMPATIBLE.java @@ -0,0 +1,103 @@ +/* CODESET_INCOMPATIBLE.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; + +/** + * 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 cannot 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 sets are too + * different to communicate anyway without the massive data loss. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public 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 reason 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/CharHolder.java b/libjava/classpath/org/omg/CORBA/CharHolder.java index 67eb2ee8741..b8d0a3d6a31 100644 --- a/libjava/classpath/org/omg/CORBA/CharHolder.java +++ b/libjava/classpath/org/omg/CORBA/CharHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -61,7 +61,7 @@ public final class CharHolder /** * The default type code for this holder. */ - private static final TypeCode t_char = new primitiveTypeCode(TCKind.tk_char); + private static final TypeCode t_char = new PrimitiveTypeCode(TCKind.tk_char); /** * The <code>char</code> (CORBA <code>char</code>) value, diff --git a/libjava/classpath/org/omg/CORBA/CharSeqHelper.java b/libjava/classpath/org/omg/CORBA/CharSeqHelper.java index b91306c2c3e..08406058ca8 100644 --- a/libjava/classpath/org/omg/CORBA/CharSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/CharSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class CharSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_char); + return new ArrayTypeCode(TCKind.tk_char); } /** diff --git a/libjava/classpath/org/omg/CORBA/CharSeqHolder.java b/libjava/classpath/org/omg/CORBA/CharSeqHolder.java index dc7d0a84050..a60483b5f0f 100644 --- a/libjava/classpath/org/omg/CORBA/CharSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/CharSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class CharSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_char); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_char); /** * Constructs an instance of CharSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/CompletionStatus.java b/libjava/classpath/org/omg/CORBA/CompletionStatus.java index f9f3704430a..1ddcca2877a 100644 --- a/libjava/classpath/org/omg/CORBA/CompletionStatus.java +++ b/libjava/classpath/org/omg/CORBA/CompletionStatus.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CORBA; +import gnu.CORBA.Minor; + import java.io.Serializable; import org.omg.CORBA.portable.IDLEntity; @@ -108,6 +110,7 @@ public class CompletionStatus /** * 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. @@ -116,11 +119,14 @@ public class CompletionStatus { try { - return states [ completion ]; + return states[completion]; } catch (ArrayIndexOutOfBoundsException ex) { - throw new BAD_OPERATION("Invalid completion status " + completion); + BAD_OPERATION bad = new BAD_OPERATION("Invalid completion status " + + completion); + bad.minor = Minor.Enumeration; + throw bad; } } diff --git a/libjava/classpath/org/omg/CORBA/CompletionStatusHelper.java b/libjava/classpath/org/omg/CORBA/CompletionStatusHelper.java index f6285744852..43b6b8c1099 100644 --- a/libjava/classpath/org/omg/CORBA/CompletionStatusHelper.java +++ b/libjava/classpath/org/omg/CORBA/CompletionStatusHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -131,7 +131,7 @@ public abstract class CompletionStatusHelper new String[] { "COMPLETED_YES", "COMPLETED_NO", "COMPLETED_MAYBE" }; typeCode = - Restricted_ORB.Singleton.create_enum_tc(id(), "CompletionStatus", + OrbRestricted.Singleton.create_enum_tc(id(), "CompletionStatus", members ); } diff --git a/libjava/classpath/org/omg/CORBA/DATA_CONVERSION.java b/libjava/classpath/org/omg/CORBA/DATA_CONVERSION.java index 3faacdcb2dd..7261aae4684 100644 --- a/libjava/classpath/org/omg/CORBA/DATA_CONVERSION.java +++ b/libjava/classpath/org/omg/CORBA/DATA_CONVERSION.java @@ -44,6 +44,26 @@ 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 class DATA_CONVERSION diff --git a/libjava/classpath/org/omg/CORBA/DefinitionKindHelper.java b/libjava/classpath/org/omg/CORBA/DefinitionKindHelper.java index d9c7cc15a46..fddbb585a2e 100644 --- a/libjava/classpath/org/omg/CORBA/DefinitionKindHelper.java +++ b/libjava/classpath/org/omg/CORBA/DefinitionKindHelper.java @@ -39,9 +39,9 @@ exception statement from your version. */ package org.omg.CORBA; import gnu.CORBA.DefinitionKindHolder; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import gnu.CORBA.gnuAny; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -97,7 +97,7 @@ public abstract class DefinitionKindHelper }; typeCode = - Restricted_ORB.Singleton.create_enum_tc(id(), "DefinitionKind", + OrbRestricted.Singleton.create_enum_tc(id(), "DefinitionKind", members ); } diff --git a/libjava/classpath/org/omg/CORBA/DoubleHolder.java b/libjava/classpath/org/omg/CORBA/DoubleHolder.java index efee74b0faa..65c8ebaf5e0 100644 --- a/libjava/classpath/org/omg/CORBA/DoubleHolder.java +++ b/libjava/classpath/org/omg/CORBA/DoubleHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,7 +62,7 @@ public final class DoubleHolder * The default type code for this holder. */ private static final TypeCode t_double = - new primitiveTypeCode(TCKind.tk_double); + new PrimitiveTypeCode(TCKind.tk_double); /** * The <code>double</code> (CORBA <code>double</code>) value, diff --git a/libjava/classpath/org/omg/CORBA/DoubleSeqHelper.java b/libjava/classpath/org/omg/CORBA/DoubleSeqHelper.java index d8dffbf4cdb..2d9423fd095 100644 --- a/libjava/classpath/org/omg/CORBA/DoubleSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/DoubleSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class DoubleSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_double); + return new ArrayTypeCode(TCKind.tk_double); } /** diff --git a/libjava/classpath/org/omg/CORBA/DoubleSeqHolder.java b/libjava/classpath/org/omg/CORBA/DoubleSeqHolder.java index a6828e1c137..619e9215bb9 100644 --- a/libjava/classpath/org/omg/CORBA/DoubleSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/DoubleSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class DoubleSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_double); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_double); /** * Constructs an instance of DoubleSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/DynamicImplementation.java b/libjava/classpath/org/omg/CORBA/DynamicImplementation.java index 3bcf93d422b..3b1b4431905 100644 --- a/libjava/classpath/org/omg/CORBA/DynamicImplementation.java +++ b/libjava/classpath/org/omg/CORBA/DynamicImplementation.java @@ -38,7 +38,12 @@ 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 @@ -51,18 +56,110 @@ import org.omg.CORBA.portable.ObjectImpl; * * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) */ -public abstract class DynamicImplementation +public class DynamicImplementation extends ObjectImpl { /** - * Invoke the method of the CORBA object. - * + * 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. + * + * @param request the container for both passing and returing the parameters, + * also contains the method name and thrown exceptions. */ - public abstract void invoke(ServerRequest request); + 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. diff --git a/libjava/classpath/org/omg/CORBA/FieldNameHelper.java b/libjava/classpath/org/omg/CORBA/FieldNameHelper.java index a35df4f3565..6d6de43da67 100644 --- a/libjava/classpath/org/omg/CORBA/FieldNameHelper.java +++ b/libjava/classpath/org/omg/CORBA/FieldNameHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.Any; import org.omg.CORBA.ORB; @@ -80,7 +80,7 @@ public abstract class FieldNameHelper */ public static TypeCode type() { - ORB orb = Restricted_ORB.Singleton; + ORB orb = OrbRestricted.Singleton; return orb.create_alias_tc(id(), "FieldName", orb.create_string_tc(0)); } diff --git a/libjava/classpath/org/omg/CORBA/FixedHolder.java b/libjava/classpath/org/omg/CORBA/FixedHolder.java index c3918a08d0d..8913acc1755 100644 --- a/libjava/classpath/org/omg/CORBA/FixedHolder.java +++ b/libjava/classpath/org/omg/CORBA/FixedHolder.java @@ -38,8 +38,8 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.fixedTypeCode; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.FixedTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import java.math.BigDecimal; @@ -108,7 +108,7 @@ public final class FixedHolder */ public TypeCode _type() { - return new fixedTypeCode(value); + return new FixedTypeCode(value); } /** diff --git a/libjava/classpath/org/omg/CORBA/FloatHolder.java b/libjava/classpath/org/omg/CORBA/FloatHolder.java index 059953faf83..1d6de16a192 100644 --- a/libjava/classpath/org/omg/CORBA/FloatHolder.java +++ b/libjava/classpath/org/omg/CORBA/FloatHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,7 +62,7 @@ public final class FloatHolder * The default type code for this holder. */ private static final TypeCode t_float = - new primitiveTypeCode(TCKind.tk_float); + new PrimitiveTypeCode(TCKind.tk_float); /** * The <code>float</code> (CORBA <code>float</code>) value, diff --git a/libjava/classpath/org/omg/CORBA/FloatSeqHelper.java b/libjava/classpath/org/omg/CORBA/FloatSeqHelper.java index 9f7630c3f95..1656dae440a 100644 --- a/libjava/classpath/org/omg/CORBA/FloatSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/FloatSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class FloatSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_float); + return new ArrayTypeCode(TCKind.tk_float); } /** diff --git a/libjava/classpath/org/omg/CORBA/FloatSeqHolder.java b/libjava/classpath/org/omg/CORBA/FloatSeqHolder.java index 24c7603336c..dbab1ec08ba 100644 --- a/libjava/classpath/org/omg/CORBA/FloatSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/FloatSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class FloatSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_float); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_float); /** * Constructs an instance of FloatSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/IDLTypeHelper.java b/libjava/classpath/org/omg/CORBA/IDLTypeHelper.java index d9ca36496f5..635168eb82d 100644 --- a/libjava/classpath/org/omg/CORBA/IDLTypeHelper.java +++ b/libjava/classpath/org/omg/CORBA/IDLTypeHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.portable.Delegate; import org.omg.CORBA.portable.InputStream; @@ -84,7 +84,7 @@ public abstract class IDLTypeHelper if (typeCode == null) { typeCode = - Restricted_ORB.Singleton.create_interface_tc(IDLTypeHelper.id(), + OrbRestricted.Singleton.create_interface_tc(IDLTypeHelper.id(), "IDLType" ); } 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 00000000000..a6e60d02ad4 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/INVALID_ACTIVITY.java @@ -0,0 +1,100 @@ +/* INVALID_ACTIVITY.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; + +/** + * 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 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 reason 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/IdentifierHelper.java b/libjava/classpath/org/omg/CORBA/IdentifierHelper.java index fa204484125..5c055f81290 100644 --- a/libjava/classpath/org/omg/CORBA/IdentifierHelper.java +++ b/libjava/classpath/org/omg/CORBA/IdentifierHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.Any; import org.omg.CORBA.ORB; @@ -80,7 +80,7 @@ public abstract class IdentifierHelper */ public static TypeCode type() { - ORB orb = Restricted_ORB.Singleton; + ORB orb = OrbRestricted.Singleton; return orb.create_alias_tc(id(), "Identifier", orb.create_string_tc(0)); } diff --git a/libjava/classpath/org/omg/CORBA/IntHolder.java b/libjava/classpath/org/omg/CORBA/IntHolder.java index 19822ef766e..4729535a7ec 100644 --- a/libjava/classpath/org/omg/CORBA/IntHolder.java +++ b/libjava/classpath/org/omg/CORBA/IntHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -61,7 +61,7 @@ public final class IntHolder /** * The default type code for this holder. */ - private static final TypeCode t_long = new primitiveTypeCode(TCKind.tk_long); + private static final TypeCode t_long = new PrimitiveTypeCode(TCKind.tk_long); /** * The <code>int</code> (CORBA <code>long</code>) value, diff --git a/libjava/classpath/org/omg/CORBA/LocalObject.java b/libjava/classpath/org/omg/CORBA/LocalObject.java index 4b6ae68afda..7c06e18249d 100644 --- a/libjava/classpath/org/omg/CORBA/LocalObject.java +++ b/libjava/classpath/org/omg/CORBA/LocalObject.java @@ -49,6 +49,13 @@ 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 @@ -141,6 +148,17 @@ public class LocalObject * * @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 { @@ -232,4 +250,114 @@ public class LocalObject { 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. + */ + 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()} 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); + } }
\ No newline at end of file diff --git a/libjava/classpath/org/omg/CORBA/LongHolder.java b/libjava/classpath/org/omg/CORBA/LongHolder.java index c0b14d33be2..ac249fed3c6 100644 --- a/libjava/classpath/org/omg/CORBA/LongHolder.java +++ b/libjava/classpath/org/omg/CORBA/LongHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,7 +62,7 @@ public final class LongHolder * The default type code for this holder. */ private static final TypeCode t_longlong = - new primitiveTypeCode(TCKind.tk_longlong); + new PrimitiveTypeCode(TCKind.tk_longlong); /** * The <code>long</code> (CORBA <code>long long</code>) value, diff --git a/libjava/classpath/org/omg/CORBA/LongLongSeqHelper.java b/libjava/classpath/org/omg/CORBA/LongLongSeqHelper.java index 1d7cde01cbb..0e31c713647 100644 --- a/libjava/classpath/org/omg/CORBA/LongLongSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/LongLongSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class LongLongSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_long); + return new ArrayTypeCode(TCKind.tk_long); } /** diff --git a/libjava/classpath/org/omg/CORBA/LongLongSeqHolder.java b/libjava/classpath/org/omg/CORBA/LongLongSeqHolder.java index 95579029673..e56acd4ad78 100644 --- a/libjava/classpath/org/omg/CORBA/LongLongSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/LongLongSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class LongLongSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_longlong); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_longlong); /** * Constructs an instance of LongLongSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/LongSeqHelper.java b/libjava/classpath/org/omg/CORBA/LongSeqHelper.java index e98c77920dd..26b4e91c2a5 100644 --- a/libjava/classpath/org/omg/CORBA/LongSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/LongSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class LongSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_long); + return new ArrayTypeCode(TCKind.tk_long); } /** diff --git a/libjava/classpath/org/omg/CORBA/LongSeqHolder.java b/libjava/classpath/org/omg/CORBA/LongSeqHolder.java index ac571decdb6..2359eb0b2f6 100644 --- a/libjava/classpath/org/omg/CORBA/LongSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/LongSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -56,8 +56,8 @@ public final class LongSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_long); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_long); /** * The <code>int[]</code> (CORBA <code>LongSeq</code>) value, diff --git a/libjava/classpath/org/omg/CORBA/MARSHAL.java b/libjava/classpath/org/omg/CORBA/MARSHAL.java index 34cfa78f637..2cd92f5a626 100644 --- a/libjava/classpath/org/omg/CORBA/MARSHAL.java +++ b/libjava/classpath/org/omg/CORBA/MARSHAL.java @@ -41,8 +41,230 @@ 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. + * 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) */ @@ -50,14 +272,15 @@ public 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. + * Creates a MARSHAL with the default minor code of 0, completion state + * COMPLETED_NO and the given explaining message. + * * @param reasom the explaining message. */ public MARSHAL(String message) @@ -66,32 +289,35 @@ public class MARSHAL } /** - * Creates MARSHAL with the default minor code of 0 and a - * completion state 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 additional error code. - * @param completed the method completion status. + /** + * 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, CompletionStatus completed) + public MARSHAL(int minor_code, CompletionStatus is_completed) { - super("", minor, completed); + super("", minor_code, is_completed); } /** * Created MARSHAL exception, providing full information. + * * @param reason explaining message. - * @param minor additional error code (the "minor"). - * @param completed the method completion status. + * @param minor_code additional error code (the "minor"). + * @param is_completed the method completion status. */ - public MARSHAL(String reason, int minor, CompletionStatus completed) + public MARSHAL(String reason, int minor_code, CompletionStatus is_completed) { - super(reason, minor, completed); + super(reason, minor_code, is_completed); } } diff --git a/libjava/classpath/org/omg/CORBA/NO_RESOURCES.java b/libjava/classpath/org/omg/CORBA/NO_RESOURCES.java index 262b8ce1a6b..013bdb674ce 100644 --- a/libjava/classpath/org/omg/CORBA/NO_RESOURCES.java +++ b/libjava/classpath/org/omg/CORBA/NO_RESOURCES.java @@ -41,9 +41,39 @@ 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. - * + * 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 class NO_RESOURCES @@ -56,8 +86,9 @@ public class NO_RESOURCES 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. + * Creates a NO_RESOURCES with the default minor code of 0, completion state + * COMPLETED_NO and the given explaining message. + * * @param reasom the explaining message. */ public NO_RESOURCES(String message) @@ -66,32 +97,35 @@ public class NO_RESOURCES } /** - * Creates NO_RESOURCES with the default minor code of 0 and a - * completion state 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 minor additional error code. - * @param completed the method completion status. + /** + * 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 minor, CompletionStatus completed) + public NO_RESOURCES(int a_minor, CompletionStatus a_completed) { - super("", minor, completed); + super("", a_minor, a_completed); } /** * Created NO_RESOURCES exception, providing full information. - * @param reason explaining message. - * @param minor additional error code (the "minor"). - * @param completed the method completion status. + * + * @param a_reason explaining message. + * @param a_minor additional error code (the "minor"). + * @param a_completed the method completion status. */ - public NO_RESOURCES(String reason, int minor, CompletionStatus completed) + public NO_RESOURCES(String a_reason, int a_minor, CompletionStatus a_completed) { - super(reason, minor, completed); + super(a_reason, a_minor, a_completed); } } diff --git a/libjava/classpath/org/omg/CORBA/NameValuePairHelper.java b/libjava/classpath/org/omg/CORBA/NameValuePairHelper.java index f40e570a79b..5d2430b23bb 100644 --- a/libjava/classpath/org/omg/CORBA/NameValuePairHelper.java +++ b/libjava/classpath/org/omg/CORBA/NameValuePairHelper.java @@ -39,9 +39,10 @@ exception statement from your version. */ package org.omg.CORBA; import gnu.CORBA.DynAn.NameValuePairHolder; -import gnu.CORBA.aliasTypeCode; -import gnu.CORBA.primitiveTypeCode; -import gnu.CORBA.stringTypeCode; +import gnu.CORBA.typecodes.AliasTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; +import gnu.CORBA.typecodes.StringTypeCode; +import gnu.CORBA.Minor; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -75,7 +76,9 @@ public abstract class NameValuePairHelper } catch (ClassCastException ex) { - throw new BAD_OPERATION("NameValuePair expected"); + BAD_OPERATION bad = new BAD_OPERATION("NameValuePair expected"); + bad.minor = Minor.Any; + throw bad; } } @@ -117,12 +120,12 @@ public abstract class NameValuePairHelper StructMember[] members = new StructMember[ 2 ]; TypeCode t_id = - new aliasTypeCode(new stringTypeCode(TCKind.tk_string), "", "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); + new StructMember("value", new PrimitiveTypeCode(TCKind.tk_any), null); typeCode = ORB.init().create_struct_tc(id(), "NameValuePair", members); } diff --git a/libjava/classpath/org/omg/CORBA/OMGVMCID.java b/libjava/classpath/org/omg/CORBA/OMGVMCID.java index 6c7b30810ef..2b2bd4bc3ef 100644 --- a/libjava/classpath/org/omg/CORBA/OMGVMCID.java +++ b/libjava/classpath/org/omg/CORBA/OMGVMCID.java @@ -1,54 +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. */ + Copyright (C) 2005 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you 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 vendor minor code ID reserved for the Object Management Group - * (http://www.omg.org). + * </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 vendor minor code ID (1330446336) reserved for the Object - * Management Group (http://www.omg.org). + * The OMG vendor minor code ID. */ - int value = 1330446336; + int value = 0x4F4D0000; } diff --git a/libjava/classpath/org/omg/CORBA/ORB.java b/libjava/classpath/org/omg/CORBA/ORB.java index 9163736eb97..06259fafa32 100644 --- a/libjava/classpath/org/omg/CORBA/ORB.java +++ b/libjava/classpath/org/omg/CORBA/ORB.java @@ -38,15 +38,18 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; -import gnu.CORBA.fixedTypeCode; -import gnu.CORBA.generalTypeCode; +import gnu.CORBA.OrbFocused; +import gnu.CORBA.ObjectCreator; +import gnu.CORBA.OrbRestricted; import gnu.CORBA.gnuContext; -import gnu.CORBA.primitiveTypeCode; -import gnu.CORBA.recordTypeCode; -import gnu.CORBA.recursiveTypeCode; +import gnu.CORBA.typecodes.FixedTypeCode; +import gnu.CORBA.typecodes.GeneralTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; +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; @@ -58,17 +61,17 @@ 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: + * 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> @@ -76,32 +79,72 @@ import java.util.Properties; * 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)}. - * </table> - * 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> - * + * + * 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 + * By default, {@link #init(String[], Properties)} and + * {@link #iinit(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 @@ -114,18 +157,21 @@ public abstract class ORB */ 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(); - - /** - * The class, implementing the default restricted ORB. - */ - private static final String DEFAULT_RESTRICTED_ORB = - gnu.CORBA.Restricted_ORB.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 @@ -172,7 +218,7 @@ public abstract class ORB /** * Create an instance of the CORBA {@link Any} with the type, intialised - * to {@link TCKind#tc_null} + * to {@link TCKind#tk_null} */ public abstract Any create_any(); @@ -359,7 +405,7 @@ public abstract class ORB */ public TypeCode create_fixed_tc(short digits, short scale) { - fixedTypeCode r = new fixedTypeCode(); + FixedTypeCode r = new FixedTypeCode(); r.setDigits(digits); r.setScale(scale); return r; @@ -394,7 +440,7 @@ public abstract class ORB * * @return the named value. */ - public abstract NamedValue create_named_value(String s, Any any, int flags); + public abstract NamedValue create_named_value(String name, Any any, int flags); /** * Send multiple prepared requests one way, do not caring about the answer. @@ -466,7 +512,7 @@ public abstract class ORB * However this method is oficially documented as not implemented at least * till v1.4 inclusive. * - * @param peration_definition the operation definition, must be + * @param operation_definition the operation definition, must be * CORBA <code>OperationDef</code>. * * @return never @@ -482,7 +528,7 @@ public abstract class ORB * <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}. + * {@link org.omg.PortableInterceptor#ORBInitialiser}. * * If the suitable factory is found, this factory creates the requested policy, * otherwise the PolicyError is thrown. @@ -532,7 +578,7 @@ public abstract class ORB * * The TypeCode object is initialized with the given id, name, and members. * @param id the Id of this type. - * @param the name of this type. + * @param name the name of this type. * @param members the member list. * * @return the typecode. @@ -548,7 +594,7 @@ public abstract class ORB * and members. * * @param id the Id of this type. - * @param the name of this type. + * @param name the name of this type. * @param discriminator the union discriminator. * @param members the member list. * @@ -579,7 +625,7 @@ public abstract class ORB */ public TypeCode create_abstract_interface_tc(String id, String name) { - generalTypeCode t = new generalTypeCode(TCKind.tk_abstract_interface); + GeneralTypeCode t = new GeneralTypeCode(TCKind.tk_abstract_interface); t.setName(name); t.setId(id); return t; @@ -595,7 +641,7 @@ public abstract class ORB */ public TypeCode create_native_tc(String id, String name) { - generalTypeCode t = new generalTypeCode(TCKind.tk_native); + GeneralTypeCode t = new GeneralTypeCode(TCKind.tk_native); t.setName(name); t.setId(id); return t; @@ -629,11 +675,11 @@ public abstract class ORB */ public TypeCode create_recursive_sequence_tc(int bound, int offset) { - recordTypeCode r = new recordTypeCode(TCKind.tk_struct); + RecordTypeCode r = new RecordTypeCode(TCKind.tk_struct); for (int i = 0; i < offset; i++) r.add(new StructMember()); - TypeCode recurs = new primitiveTypeCode(TCKind.tk_sequence); + TypeCode recurs = new PrimitiveTypeCode(TCKind.tk_sequence); r.add(new StructMember("", recurs, null)); return r; @@ -648,7 +694,7 @@ public abstract class ORB */ public TypeCode create_recursive_tc(String id) { - return new recursiveTypeCode(id); + return new RecursiveTypeCode(id); } /** @@ -658,7 +704,7 @@ public abstract class ORB TypeCode boxed_type ) { - generalTypeCode t = new generalTypeCode(TCKind.tk_value_box); + GeneralTypeCode t = new GeneralTypeCode(TCKind.tk_value_box); t.setName(name); t.setId(id); t.setContentType(boxed_type); @@ -672,7 +718,7 @@ public abstract class ORB TypeCode concrete_base, ValueMember[] members ) { - recordTypeCode r = new recordTypeCode(TCKind.tk_value); + RecordTypeCode r = new RecordTypeCode(TCKind.tk_value); r.setId(id); r.setName(name); r.setTypeModifier(type_modifier); @@ -741,7 +787,7 @@ public abstract class ORB * @return the default context of this ORB. * * @throws NO_IMPLEMENT for the Singleton ORB, returned by - * the parameterless {@link init()}. + * the parameterless {@link #init()}. */ public Context get_default_context() { @@ -751,7 +797,7 @@ public abstract class ORB /** * Return thg typecode, representing the given primitive object type. * - * @param the kind of the primitive typecode. + * @param tcKind the kind of the primitive typecode. * * @return the typecode of the primitve typecode. */ @@ -779,9 +825,9 @@ public abstract class ORB */ public static ORB init() { - String orb_cn = getORBName(null, RESTRICTED_ORB); + String orb_cn = getCumulatedProperty(null, RESTRICTED_ORB); if (orb_cn == null) - return Restricted_ORB.Singleton; + return OrbRestricted.Singleton; else return createORB(null, orb_cn); } @@ -804,6 +850,11 @@ public abstract class ORB 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); @@ -811,40 +862,44 @@ public abstract class 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 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. - - * + * 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(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); @@ -853,10 +908,10 @@ public abstract class ORB /** * List the initially available CORBA objects (services). - * + * * @return a list of services. - * - * @see resolve_initial_references(String) + * + * @see #resolve_initial_references(String) */ public abstract String[] list_initial_services(); @@ -919,9 +974,9 @@ public abstract class ORB * (key) inside the server, the communication protocol version, * supported charsets and so on. * - * @param the CORBA object + * @param forObject the CORBA object * @return the object IOR representation. - * @see string_to_object(String) + * @see #string_to_object(String) */ public abstract String object_to_string(Object forObject); @@ -985,6 +1040,12 @@ public abstract class ORB * 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 @@ -1016,7 +1077,7 @@ public abstract class ORB * @throws DATA_CONVERSION if the string being parsed contains unsupported * prefix or protocol. * - * @see object_to_string(org.omg.CORBA.Object) + * @see #object_to_string(org.omg.CORBA.Object) */ public abstract Object string_to_object(String IOR); @@ -1056,7 +1117,7 @@ public abstract class ORB * application. * * @param props application specific properties that were passed - * as a second parameter in {@link init(String[], Properties)}). + * as a second parameter in {@link #init(String[], Properties)}). * Can be <code>null</code>. */ protected abstract void set_parameters(String[] para, Properties props); @@ -1074,23 +1135,10 @@ public abstract class ORB protected abstract void set_parameters(Applet app, Properties props); /** - * Checks if the communication over network is allowed. - * @throws java.lang.SecurityException + * Get the property with the given name, searching in the standard + * places for the ORB properties. */ - private static final void checkNetworkingPermission(String host, int port) - throws SecurityException - { - SecurityManager security = System.getSecurityManager(); - if (security != null) - { - security.checkConnect(host, port); - } - } - - /** - * Get the ORB class name. - */ - private static String getORBName(Properties props, String property) + private static String getCumulatedProperty(Properties props, String property) { String orb_cn = null; @@ -1105,7 +1153,7 @@ public abstract class ORB if (orb_cn == null) orb_cn = checkFile(property, "java.home", "lib"); - + return orb_cn; } @@ -1148,10 +1196,10 @@ public abstract class ORB /** * 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. + * @param orbClassName the direct ORB class name, overriding other possible + * locations, or null if not specified. */ private static ORB createORB(Properties props, String orbClassName) { @@ -1159,15 +1207,21 @@ public abstract class ORB if (orbClassName == null) { - orbClassName = getORBName(props, FUNCTIONAL_ORB); + orbClassName = getCumulatedProperty(props, FUNCTIONAL_ORB); if (orbClassName == null) - orbClassName = DEFAULT_FUNCTIONAL_ORB; + { + String lp = getCumulatedProperty(props, LISTENER_PORT); + if (lp != null) + orbClassName = DEFAULT_FOCUSED_ORB; + else + orbClassName = DEFAULT_FUNCTIONAL_ORB; + } } try { - orb = (ORB) Class.forName(orbClassName).newInstance(); + orb = (ORB) ObjectCreator.forName(orbClassName).newInstance(); } catch (ClassNotFoundException ex) { diff --git a/libjava/classpath/org/omg/CORBA/ObjectHelper.java b/libjava/classpath/org/omg/CORBA/ObjectHelper.java index 1324c621f2b..220f2daced2 100644 --- a/libjava/classpath/org/omg/CORBA/ObjectHelper.java +++ b/libjava/classpath/org/omg/CORBA/ObjectHelper.java @@ -38,7 +38,8 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.Minor; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -63,7 +64,9 @@ public abstract class ObjectHelper } catch (ClassCastException ex) { - throw new BAD_OPERATION("CORBA object expected"); + BAD_OPERATION bad = new BAD_OPERATION("CORBA object expected"); + bad.minor = Minor.Any; + throw bad; } } diff --git a/libjava/classpath/org/omg/CORBA/ObjectHolder.java b/libjava/classpath/org/omg/CORBA/ObjectHolder.java index 27ae674167a..f79a89bef0d 100644 --- a/libjava/classpath/org/omg/CORBA/ObjectHolder.java +++ b/libjava/classpath/org/omg/CORBA/ObjectHolder.java @@ -38,8 +38,8 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; -import gnu.CORBA.recordTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; +import gnu.CORBA.typecodes.RecordTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -63,11 +63,11 @@ public final class ObjectHolder * 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; + private static final RecordTypeCode t_object; static { - t_object = new recordTypeCode(TCKind.tk_objref); + t_object = new RecordTypeCode(TCKind.tk_objref); t_object.setId(""); } diff --git a/libjava/classpath/org/omg/CORBA/OctetSeqHelper.java b/libjava/classpath/org/omg/CORBA/OctetSeqHelper.java index 0612ae4e2ff..df7b22ff52f 100644 --- a/libjava/classpath/org/omg/CORBA/OctetSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/OctetSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class OctetSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_octet); + return new ArrayTypeCode(TCKind.tk_octet); } /** diff --git a/libjava/classpath/org/omg/CORBA/OctetSeqHolder.java b/libjava/classpath/org/omg/CORBA/OctetSeqHolder.java index 5092d707eea..62ea7381920 100644 --- a/libjava/classpath/org/omg/CORBA/OctetSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/OctetSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class OctetSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_octet); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_octet); /** * Constructs an instance of OctetSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/PERSIST_STORE.java b/libjava/classpath/org/omg/CORBA/PERSIST_STORE.java index 8aae9b3bcf6..df17cefa9e9 100644 --- a/libjava/classpath/org/omg/CORBA/PERSIST_STORE.java +++ b/libjava/classpath/org/omg/CORBA/PERSIST_STORE.java @@ -57,7 +57,7 @@ public class PERSIST_STORE /** * Creates a PERSIST_STORE with the default minor code of 0, * completion state COMPLETED_NO and the given explaining message. - * @param reasom the explaining message. + * @param message the explaining message. */ public PERSIST_STORE(String message) { diff --git a/libjava/classpath/org/omg/CORBA/ParameterModeHelper.java b/libjava/classpath/org/omg/CORBA/ParameterModeHelper.java index ec75b2bcf72..ac17a9235ba 100644 --- a/libjava/classpath/org/omg/CORBA/ParameterModeHelper.java +++ b/libjava/classpath/org/omg/CORBA/ParameterModeHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -87,7 +87,7 @@ public abstract class ParameterModeHelper new String[] { "PARAM_IN", "PARAM_OUT", "PARAM_INOUT" }; typeCode = - Restricted_ORB.Singleton.create_enum_tc(id(), "ParameterMode", members); + OrbRestricted.Singleton.create_enum_tc(id(), "ParameterMode", members); } return typeCode; } diff --git a/libjava/classpath/org/omg/CORBA/PolicyError.java b/libjava/classpath/org/omg/CORBA/PolicyError.java index 82ae4e45dc0..749868a992f 100644 --- a/libjava/classpath/org/omg/CORBA/PolicyError.java +++ b/libjava/classpath/org/omg/CORBA/PolicyError.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CORBA; +import org.omg.CORBA.portable.IDLEntity; + import java.io.Serializable; /** @@ -75,7 +77,7 @@ public class PolicyError /** * Constructs the policy error with the given reason code. - * @param reason a reason code, one of + * @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}. @@ -88,11 +90,11 @@ public class PolicyError /** * Constructs the policy error with the given reason code and the * detailed message. - * @param reason a reason code, one of + * @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}. - * @param details the detailed message. */ public PolicyError(String a_details, short 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 00000000000..ab7ac95479a --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyErrorCodeHelper.java @@ -0,0 +1,115 @@ +/* PolicyErrorCodeHelper.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.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()}. + */ + public static void write(OutputStream ostream, short value) + { + ostream.write_short(value); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/CORBA/PolicyErrorHelper.java b/libjava/classpath/org/omg/CORBA/PolicyErrorHelper.java new file mode 100644 index 00000000000..49db768cd3b --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyErrorHelper.java @@ -0,0 +1,158 @@ +/* PolicyErrorHelper.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 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 +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the PolicyError typecode. The typecode defines a structure, named + * "PolicyError", containing the {@link PolicyErrorCode} (alias int) field, + * named "reason". + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = ORB.init(); + 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); + typeCode = orb.create_exception_tc(id(), "PolicyError", members); + } + return typeCode; + } + + /** + * 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. + String 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); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/CORBA/IDLEntity.java b/libjava/classpath/org/omg/CORBA/PolicyErrorHolder.java index 6515d83305b..8e2c9a8d342 100644 --- a/libjava/classpath/org/omg/CORBA/IDLEntity.java +++ b/libjava/classpath/org/omg/CORBA/PolicyErrorHolder.java @@ -1,4 +1,4 @@ -/* IDLEntity.java -- +/* PolicyErrorHolder.java -- Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,13 +38,66 @@ exception statement from your version. */ package org.omg.CORBA; -import java.io.Serializable; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; /** - * Indicates that this class has a corresponding Helper class. - * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) - */ -public interface IDLEntity - extends Serializable +* A holder for the exception {@link PolicyError}. + +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public class PolicyErrorHolder implements Streamable { -} + /** + * The stored PolicyError value. + */ + public PolicyError value; + + /** + * Create the unitialised 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(); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/CORBA/PolicyHelper.java b/libjava/classpath/org/omg/CORBA/PolicyHelper.java index 16b9d94c754..66fb0aa0868 100644 --- a/libjava/classpath/org/omg/CORBA/PolicyHelper.java +++ b/libjava/classpath/org/omg/CORBA/PolicyHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CORBA; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -99,7 +101,9 @@ public abstract class PolicyHelper } catch (ClassCastException ex) { - throw new BAD_OPERATION("Policy expected"); + BAD_OPERATION bad = new BAD_OPERATION("Policy expected"); + bad.minor = Minor.Any; + throw bad; } } diff --git a/libjava/classpath/org/omg/CORBA/PolicyListHelper.java b/libjava/classpath/org/omg/CORBA/PolicyListHelper.java index f03836a4fcc..6e4d329b837 100644 --- a/libjava/classpath/org/omg/CORBA/PolicyListHelper.java +++ b/libjava/classpath/org/omg/CORBA/PolicyListHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CORBA; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -97,7 +99,9 @@ public abstract class PolicyListHelper } catch (ClassCastException ex) { - throw new BAD_OPERATION("Policy[] expected"); + BAD_OPERATION bad = new BAD_OPERATION("Policy[] expected"); + bad.minor = Minor.Any; + throw bad; } } diff --git a/libjava/classpath/org/omg/CORBA/PrincipalHolder.java b/libjava/classpath/org/omg/CORBA/PrincipalHolder.java index 22501a0f794..270427f3fdd 100644 --- a/libjava/classpath/org/omg/CORBA/PrincipalHolder.java +++ b/libjava/classpath/org/omg/CORBA/PrincipalHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -58,7 +58,7 @@ public final class PrincipalHolder * The default type code for this holder. */ private static final TypeCode t_any = - new primitiveTypeCode(TCKind.tk_Principal); + new PrimitiveTypeCode(TCKind.tk_Principal); /** * The instance of {@link Principal}, held by this holder. diff --git a/libjava/classpath/org/omg/CORBA/REBIND.java b/libjava/classpath/org/omg/CORBA/REBIND.java new file mode 100644 index 00000000000..9480906cc4d --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/REBIND.java @@ -0,0 +1,99 @@ +/* REBIND.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; + +/** + * 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 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 reason 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 index 42fb008521f..a392002fd23 100644 --- a/libjava/classpath/org/omg/CORBA/RepositoryIdHelper.java +++ b/libjava/classpath/org/omg/CORBA/RepositoryIdHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.Any; import org.omg.CORBA.ORB; @@ -80,7 +80,7 @@ public abstract class RepositoryIdHelper */ public static TypeCode type() { - ORB orb = Restricted_ORB.Singleton; + ORB orb = OrbRestricted.Singleton; return orb.create_alias_tc(id(), "RepositoryId", orb.create_string_tc(0)); } diff --git a/libjava/classpath/org/omg/CORBA/ServiceDetailHelper.java b/libjava/classpath/org/omg/CORBA/ServiceDetailHelper.java index fe0135d975b..58000f2c5c7 100644 --- a/libjava/classpath/org/omg/CORBA/ServiceDetailHelper.java +++ b/libjava/classpath/org/omg/CORBA/ServiceDetailHelper.java @@ -38,6 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; +import gnu.CORBA.Minor; import gnu.CORBA.ServiceDetailHolder; import org.omg.CORBA.portable.InputStream; @@ -78,7 +79,10 @@ public abstract class ServiceDetailHelper } catch (ClassCastException ex) { - throw new BAD_OPERATION(); + BAD_OPERATION bad = new BAD_OPERATION(); + bad.initCause(ex); + bad.minor = Minor.Any; + throw bad; } } diff --git a/libjava/classpath/org/omg/CORBA/SetOverrideTypeHelper.java b/libjava/classpath/org/omg/CORBA/SetOverrideTypeHelper.java index bfdad683e92..1fa1ef868d1 100644 --- a/libjava/classpath/org/omg/CORBA/SetOverrideTypeHelper.java +++ b/libjava/classpath/org/omg/CORBA/SetOverrideTypeHelper.java @@ -39,7 +39,7 @@ exception statement from your version. */ package org.omg.CORBA; import gnu.CORBA.SetOverrideTypeHolder; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -88,7 +88,7 @@ public abstract class SetOverrideTypeHelper }; typeCode = - Restricted_ORB.Singleton.create_enum_tc(id(), "SetOverrideType", + OrbRestricted.Singleton.create_enum_tc(id(), "SetOverrideType", members ); } diff --git a/libjava/classpath/org/omg/CORBA/ShortHolder.java b/libjava/classpath/org/omg/CORBA/ShortHolder.java index c2e18cb2a8b..dfc4721f3f9 100644 --- a/libjava/classpath/org/omg/CORBA/ShortHolder.java +++ b/libjava/classpath/org/omg/CORBA/ShortHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,7 +62,7 @@ public final class ShortHolder * The default type code for this holder. */ private static final TypeCode t_short = - new primitiveTypeCode(TCKind.tk_short); + new PrimitiveTypeCode(TCKind.tk_short); /** * The <code>short</code> (CORBA <code>short</code>) value, diff --git a/libjava/classpath/org/omg/CORBA/ShortSeqHelper.java b/libjava/classpath/org/omg/CORBA/ShortSeqHelper.java index 21eda87d110..40124f216e9 100644 --- a/libjava/classpath/org/omg/CORBA/ShortSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/ShortSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class ShortSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_short); + return new ArrayTypeCode(TCKind.tk_short); } /** diff --git a/libjava/classpath/org/omg/CORBA/ShortSeqHolder.java b/libjava/classpath/org/omg/CORBA/ShortSeqHolder.java index 183db3a5770..246d1ecf47e 100644 --- a/libjava/classpath/org/omg/CORBA/ShortSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/ShortSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class ShortSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_short); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_short); /** * Constructs an instance of ShortSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/StringHolder.java b/libjava/classpath/org/omg/CORBA/StringHolder.java index 8a637c8e57f..ac45c562c70 100644 --- a/libjava/classpath/org/omg/CORBA/StringHolder.java +++ b/libjava/classpath/org/omg/CORBA/StringHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.stringTypeCode; +import gnu.CORBA.typecodes.StringTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -61,8 +61,8 @@ public final class StringHolder /** * The default type code for this holder. */ - private static final stringTypeCode t_string = - new stringTypeCode(TCKind.tk_string); + private static final StringTypeCode t_string = + new StringTypeCode(TCKind.tk_string); /** * The <code>String</code> (CORBA <code>string</code>) value, diff --git a/libjava/classpath/org/omg/CORBA/StringSeqHelper.java b/libjava/classpath/org/omg/CORBA/StringSeqHelper.java index 0ae2646795a..4225c0bd12b 100644 --- a/libjava/classpath/org/omg/CORBA/StringSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/StringSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class StringSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_string); + return new ArrayTypeCode(TCKind.tk_string); } /** diff --git a/libjava/classpath/org/omg/CORBA/StringSeqHolder.java b/libjava/classpath/org/omg/CORBA/StringSeqHolder.java index 8e419d23333..71ac887e27b 100755 --- a/libjava/classpath/org/omg/CORBA/StringSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/StringSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class StringSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_char); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_char); /** * Constructs an instance of StringSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/StringValueHelper.java b/libjava/classpath/org/omg/CORBA/StringValueHelper.java index 97d0e7a5d06..24e79ce571b 100644 --- a/libjava/classpath/org/omg/CORBA/StringValueHelper.java +++ b/libjava/classpath/org/omg/CORBA/StringValueHelper.java @@ -38,10 +38,9 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; -import gnu.CORBA.gnuAny; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; -import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.BoxedValueHelper; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -75,7 +74,7 @@ public class StringValueHelper * The String typecode. */ private static final TypeCode tString = - Restricted_ORB.Singleton.create_string_tc(0); + OrbRestricted.Singleton.create_string_tc(0); /** * Returns the String Value repository Id. @@ -121,7 +120,9 @@ public class StringValueHelper } catch (ClassCastException ex) { - throw new MARSHAL("String expected"); + MARSHAL m = new MARSHAL("String expected"); + m.minor = Minor.ClassCast; + throw m; } } @@ -141,7 +142,11 @@ public class StringValueHelper return an_any.extract_string(); } else - throw new BAD_OPERATION("Contains not a string value type"); + { + BAD_OPERATION bad = new BAD_OPERATION("String value type expected"); + bad.minor = Minor.Any; + throw bad; + } } /** @@ -177,7 +182,7 @@ public class StringValueHelper { if (typecode == null) { - ORB orb = Restricted_ORB.Singleton; + ORB orb = OrbRestricted.Singleton; typecode = orb.create_value_box_tc(id(), "StringValue", tString); } diff --git a/libjava/classpath/org/omg/CORBA/StructMemberHelper.java b/libjava/classpath/org/omg/CORBA/StructMemberHelper.java index 72d66fa912f..01445129b67 100644 --- a/libjava/classpath/org/omg/CORBA/StructMemberHelper.java +++ b/libjava/classpath/org/omg/CORBA/StructMemberHelper.java @@ -38,7 +38,8 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; import gnu.CORBA.TypeCodeHelper; import org.omg.CORBA.portable.InputStream; @@ -87,7 +88,7 @@ public abstract class StructMemberHelper { if (typeCode == null) { - ORB orb = Restricted_ORB.Singleton; + ORB orb = OrbRestricted.Singleton; synchronized (TypeCode.class) { @@ -151,6 +152,7 @@ public abstract class StructMemberHelper catch (UserException ex) { MARSHAL m = new MARSHAL(); + m.minor = Minor.UserException; m.initCause(ex); throw m; } @@ -170,6 +172,7 @@ public abstract class StructMemberHelper 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 index 85396ee534f..dd193627900 100644 --- a/libjava/classpath/org/omg/CORBA/SystemException.java +++ b/libjava/classpath/org/omg/CORBA/SystemException.java @@ -1,39 +1,39 @@ /* SystemException.java -- - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005 Free Software Foundation, Inc. -This file is part of GNU Classpath. + This file is part of GNU Classpath. -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you 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; @@ -42,6 +42,7 @@ import java.io.Serializable; /** * The root class for all CORBA standard exceptions. + * * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) */ public class SystemException @@ -49,8 +50,7 @@ public class SystemException implements Serializable { /** - * Use serialVersionUID for interoperability. - * Using the version 1.4 UID. + * Use serialVersionUID for interoperability. Using the version 1.4 UID. */ private static final long serialVersionUID = -8486391734674855519L; @@ -60,22 +60,35 @@ public class SystemException public CompletionStatus completed; /** - * The additional exception error code ("minor"). + * <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_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 - ) + CompletionStatus a_completed) { - super(a_reason); + 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/TIMEOUT.java b/libjava/classpath/org/omg/CORBA/TIMEOUT.java new file mode 100644 index 00000000000..44ae8b31cb3 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TIMEOUT.java @@ -0,0 +1,98 @@ +/* TIMEOUT.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; + +/** + * Raised when no delivery has been made during the specified timeout duration. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public 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 reason 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 00000000000..5f1981ba408 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TRANSACTION_MODE.java @@ -0,0 +1,99 @@ +/* TRANSACTION_MODE.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; + +/** + * 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 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 reason 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_UNAVAILABLE.java b/libjava/classpath/org/omg/CORBA/TRANSACTION_UNAVAILABLE.java new file mode 100644 index 00000000000..dc808a23ce9 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/TRANSACTION_UNAVAILABLE.java @@ -0,0 +1,99 @@ +/* TRANSACTION_UNAVAILABLE.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; + +/** + * Raised in response to the abnormal termination of the transaction + * service. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public 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 reason 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/TypeCodeHolder.java b/libjava/classpath/org/omg/CORBA/TypeCodeHolder.java index 276e8bf16e3..bb293376d1f 100644 --- a/libjava/classpath/org/omg/CORBA/TypeCodeHolder.java +++ b/libjava/classpath/org/omg/CORBA/TypeCodeHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -58,7 +58,7 @@ public class TypeCodeHolder * The default type code for this holder. */ private static final TypeCode t_TypeCode = - new primitiveTypeCode(TCKind.tk_TypeCode); + new PrimitiveTypeCode(TCKind.tk_TypeCode); /** * The <code>TypeCode</code> (CORBA <code>TypeCode</code>) value, diff --git a/libjava/classpath/org/omg/CORBA/TypeCodePackage/BadKind.java b/libjava/classpath/org/omg/CORBA/TypeCodePackage/BadKind.java index 88192f6ad8e..8ca659d7f4d 100644 --- a/libjava/classpath/org/omg/CORBA/TypeCodePackage/BadKind.java +++ b/libjava/classpath/org/omg/CORBA/TypeCodePackage/BadKind.java @@ -40,8 +40,8 @@ package org.omg.CORBA.TypeCodePackage; import java.io.Serializable; -import org.omg.CORBA.IDLEntity; import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; /** * This exception is thrown when an inappropriate operation is invoked on diff --git a/libjava/classpath/org/omg/CORBA/TypeCodePackage/Bounds.java b/libjava/classpath/org/omg/CORBA/TypeCodePackage/Bounds.java index cd48706bce5..16954e034f1 100644 --- a/libjava/classpath/org/omg/CORBA/TypeCodePackage/Bounds.java +++ b/libjava/classpath/org/omg/CORBA/TypeCodePackage/Bounds.java @@ -40,8 +40,8 @@ package org.omg.CORBA.TypeCodePackage; import java.io.Serializable; -import org.omg.CORBA.IDLEntity; import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; /** * The {@link org.omg.CORBA.TypeCode#member_name(int) }, diff --git a/libjava/classpath/org/omg/CORBA/ULongLongSeqHelper.java b/libjava/classpath/org/omg/CORBA/ULongLongSeqHelper.java index e92409bb0c4..1148cb40865 100644 --- a/libjava/classpath/org/omg/CORBA/ULongLongSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/ULongLongSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class ULongLongSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_ulong); + return new ArrayTypeCode(TCKind.tk_ulong); } /** diff --git a/libjava/classpath/org/omg/CORBA/ULongLongSeqHolder.java b/libjava/classpath/org/omg/CORBA/ULongLongSeqHolder.java index 2d0fcf0b371..70b43bf7f45 100644 --- a/libjava/classpath/org/omg/CORBA/ULongLongSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/ULongLongSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class ULongLongSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_ulonglong); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_ulonglong); /** * Constructs an instance of ULongLongSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/ULongSeqHelper.java b/libjava/classpath/org/omg/CORBA/ULongSeqHelper.java index 846833c2a89..dddc1323d7e 100644 --- a/libjava/classpath/org/omg/CORBA/ULongSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/ULongSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class ULongSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_long); + return new ArrayTypeCode(TCKind.tk_long); } /** diff --git a/libjava/classpath/org/omg/CORBA/ULongSeqHolder.java b/libjava/classpath/org/omg/CORBA/ULongSeqHolder.java index 8810e2159fc..64d9db6ceee 100644 --- a/libjava/classpath/org/omg/CORBA/ULongSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/ULongSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class ULongSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_ulong); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_ulong); /** * Constructs an instance of ULongSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/UShortSeqHelper.java b/libjava/classpath/org/omg/CORBA/UShortSeqHelper.java index 76371bc308a..d1fc440a90d 100644 --- a/libjava/classpath/org/omg/CORBA/UShortSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/UShortSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class UShortSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_short); + return new ArrayTypeCode(TCKind.tk_short); } /** diff --git a/libjava/classpath/org/omg/CORBA/UShortSeqHolder.java b/libjava/classpath/org/omg/CORBA/UShortSeqHolder.java index 8c6f7d19075..47e33b9be02 100644 --- a/libjava/classpath/org/omg/CORBA/UShortSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/UShortSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class UShortSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_ushort); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_ushort); /** * Constructs an instance of UShortSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/UnionMemberHelper.java b/libjava/classpath/org/omg/CORBA/UnionMemberHelper.java index a4943564489..c599542fb96 100644 --- a/libjava/classpath/org/omg/CORBA/UnionMemberHelper.java +++ b/libjava/classpath/org/omg/CORBA/UnionMemberHelper.java @@ -38,7 +38,8 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; import gnu.CORBA.TypeCodeHelper; import org.omg.CORBA.portable.InputStream; @@ -97,7 +98,7 @@ public abstract class UnionMemberHelper } active = true; - ORB orb = Restricted_ORB.Singleton; + ORB orb = OrbRestricted.Singleton; StructMember[] members = new StructMember[ 4 ]; TypeCode member; @@ -152,6 +153,7 @@ public abstract class UnionMemberHelper catch (UserException ex) { MARSHAL m = new MARSHAL(); + m.minor = Minor.UserException; m.initCause(ex); throw m; } @@ -172,6 +174,7 @@ public abstract class UnionMemberHelper catch (UserException ex) { MARSHAL m = new MARSHAL(); + m.minor = Minor.UserException; m.initCause(ex); throw m; } diff --git a/libjava/classpath/org/omg/CORBA/UnknownUserExceptionHelper.java b/libjava/classpath/org/omg/CORBA/UnknownUserExceptionHelper.java new file mode 100644 index 00000000000..e93dc740399 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UnknownUserExceptionHelper.java @@ -0,0 +1,157 @@ +/* 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 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 +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the UnknownUserException typecode (structure, + * named "UnknownUserException", containing a single field of + * type {@link Any}, named "except". + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = ORB.init(); + StructMember[] members = new StructMember[ 1 ]; + + TypeCode field; + + field = orb.get_primitive_tc(TCKind.tk_any); + members [ 0 ] = new StructMember("except", field, null); + typeCode = + orb.create_exception_tc(id(), "UnknownUserException", members); + } + return typeCode; + } + + /** + * 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. + String 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); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/CORBA/UnknownUserExceptionHolder.java b/libjava/classpath/org/omg/CORBA/UnknownUserExceptionHolder.java new file mode 100644 index 00000000000..d7b1ca006d4 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/UnknownUserExceptionHolder.java @@ -0,0 +1,103 @@ +/* UnknownUserExceptionHolder.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.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 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(); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/CORBA/ValueBaseHelper.java b/libjava/classpath/org/omg/CORBA/ValueBaseHelper.java index 941e9d740fe..1699d912d61 100644 --- a/libjava/classpath/org/omg/CORBA/ValueBaseHelper.java +++ b/libjava/classpath/org/omg/CORBA/ValueBaseHelper.java @@ -39,7 +39,7 @@ exception statement from your version. */ package org.omg.CORBA; import gnu.CORBA.CDR.Vio; -import gnu.CORBA.recordTypeCode; +import gnu.CORBA.typecodes.RecordTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -109,7 +109,7 @@ public abstract class ValueBaseHelper */ public static TypeCode type() { - recordTypeCode r = new recordTypeCode(TCKind.tk_value); + RecordTypeCode r = new RecordTypeCode(TCKind.tk_value); return r; } diff --git a/libjava/classpath/org/omg/CORBA/ValueBaseHolder.java b/libjava/classpath/org/omg/CORBA/ValueBaseHolder.java index c6efed5eb04..6f57d17c3f1 100644 --- a/libjava/classpath/org/omg/CORBA/ValueBaseHolder.java +++ b/libjava/classpath/org/omg/CORBA/ValueBaseHolder.java @@ -79,7 +79,7 @@ public class ValueBaseHolder /** * Read fill in the value field by reading an instance from the - * given input stream. Uses {@link ValueBaseHelper.} + * given input stream. Uses {@link ValueBaseHelper} * * @param input a stream to read from. */ @@ -89,7 +89,7 @@ public class ValueBaseHolder } /** - * Get the typecode of the stored instance. Uses {@link ValueBaseHelper.} + * Get the typecode of the stored instance. Uses {@link ValueBaseHelper} */ public TypeCode _type() { @@ -97,10 +97,10 @@ public class ValueBaseHolder } /** - * Write the stored instance to the given input stream. - * Uses {@link ValueBaseHelper.} + * Write the stored instance to the given output stream. + * Uses {@link ValueBaseHelper} * - * @param input a stream to read from. + * @param output a stream to write to. */ public void _write(OutputStream output) { diff --git a/libjava/classpath/org/omg/CORBA/ValueMemberHelper.java b/libjava/classpath/org/omg/CORBA/ValueMemberHelper.java index 208623c2e7b..3150af2aaf4 100644 --- a/libjava/classpath/org/omg/CORBA/ValueMemberHelper.java +++ b/libjava/classpath/org/omg/CORBA/ValueMemberHelper.java @@ -38,7 +38,8 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; import gnu.CORBA.TypeCodeHelper; import org.omg.CORBA.portable.InputStream; @@ -91,7 +92,7 @@ public abstract class ValueMemberHelper { if (typeCode == null) { - ORB orb = Restricted_ORB.Singleton; + ORB orb = OrbRestricted.Singleton; if (active) { @@ -177,6 +178,7 @@ public abstract class ValueMemberHelper catch (UserException ex) { MARSHAL m = new MARSHAL(); + m.minor = Minor.UserException; m.initCause(ex); throw m; } @@ -200,6 +202,7 @@ public abstract class ValueMemberHelper 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 index dcdad34e4f5..9845702985a 100644 --- a/libjava/classpath/org/omg/CORBA/VersionSpecHelper.java +++ b/libjava/classpath/org/omg/CORBA/VersionSpecHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.Any; import org.omg.CORBA.ORB; @@ -80,7 +80,7 @@ public abstract class VersionSpecHelper */ public static TypeCode type() { - ORB orb = Restricted_ORB.Singleton; + ORB orb = OrbRestricted.Singleton; return orb.create_alias_tc(id(), "VersionSpec", orb.create_string_tc(0)); } diff --git a/libjava/classpath/org/omg/CORBA/VisibilityHelper.java b/libjava/classpath/org/omg/CORBA/VisibilityHelper.java index f2ed32f6371..a09e5b6867d 100644 --- a/libjava/classpath/org/omg/CORBA/VisibilityHelper.java +++ b/libjava/classpath/org/omg/CORBA/VisibilityHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -59,7 +59,7 @@ public abstract class VisibilityHelper /** * Insert the Visibility into the given Any. - * Uses {@link Any.insert_short}. + * Uses {@link Any#insert_short}. */ public static void insert(Any any, short that) { @@ -68,7 +68,7 @@ public abstract class VisibilityHelper /** * Extract the Visibility from the given Any. - * Uses {@link Any.extract_short}. + * Uses {@link Any#extract_short}. */ public static short extract(Any any) { @@ -83,9 +83,9 @@ public abstract class VisibilityHelper if (typeCode == null) { TypeCode tshort = - Restricted_ORB.Singleton.get_primitive_tc(TCKind.tk_short); + OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_short); typeCode = - Restricted_ORB.Singleton.create_alias_tc(id(), "Visibility", tshort); + OrbRestricted.Singleton.create_alias_tc(id(), "Visibility", tshort); } return typeCode; } @@ -103,7 +103,7 @@ public abstract class VisibilityHelper /** * Read the visibility value (as short) from the CDR intput stream. * - * Uses {@link InputStream.read_short()}. + * Uses {@link InputStream#read_short()}. * * @param istream a stream to read from. */ @@ -115,7 +115,7 @@ public abstract class VisibilityHelper /** * Write the visibility value (as short) to the CDR output stream. * - * USes {@link OutputStream.write_short(short)}. + * USes {@link OutputStream#write_short(short)}. * * @param ostream a stream to write into. * @param value a value to write. diff --git a/libjava/classpath/org/omg/CORBA/WCharSeqHelper.java b/libjava/classpath/org/omg/CORBA/WCharSeqHelper.java index c12c3de1c78..4bb92989d05 100644 --- a/libjava/classpath/org/omg/CORBA/WCharSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/WCharSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -125,7 +125,7 @@ public abstract class WCharSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_char); + return new ArrayTypeCode(TCKind.tk_char); } /** diff --git a/libjava/classpath/org/omg/CORBA/WCharSeqHolder.java b/libjava/classpath/org/omg/CORBA/WCharSeqHolder.java index 1b11506a298..72a9cc8c1e3 100644 --- a/libjava/classpath/org/omg/CORBA/WCharSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/WCharSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class WCharSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_wchar); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_wchar); /** * Constructs an instance of WCharSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/WStringSeqHelper.java b/libjava/classpath/org/omg/CORBA/WStringSeqHelper.java index 916c6a250da..356cf0dd21c 100644 --- a/libjava/classpath/org/omg/CORBA/WStringSeqHelper.java +++ b/libjava/classpath/org/omg/CORBA/WStringSeqHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.InputStream; @@ -127,7 +127,7 @@ public abstract class WStringSeqHelper */ public static TypeCode type() { - return new primitiveArrayTypeCode(TCKind.tk_string); + return new ArrayTypeCode(TCKind.tk_string); } /** diff --git a/libjava/classpath/org/omg/CORBA/WStringSeqHolder.java b/libjava/classpath/org/omg/CORBA/WStringSeqHolder.java index 474d69a47ad..68b77ff6a3a 100755 --- a/libjava/classpath/org/omg/CORBA/WStringSeqHolder.java +++ b/libjava/classpath/org/omg/CORBA/WStringSeqHolder.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.primitiveArrayTypeCode; +import gnu.CORBA.typecodes.ArrayTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -62,8 +62,8 @@ public final class WStringSeqHolder /** * The type code for this holder. Each holder has a different instance. */ - private final primitiveArrayTypeCode typecode = - new primitiveArrayTypeCode(TCKind.tk_wchar); + private final ArrayTypeCode typecode = + new ArrayTypeCode(TCKind.tk_wchar); /** * Constructs an instance of WStringSeqHolder, diff --git a/libjava/classpath/org/omg/CORBA/WStringValueHelper.java b/libjava/classpath/org/omg/CORBA/WStringValueHelper.java index 7748a6c782d..1c63a408e3d 100644 --- a/libjava/classpath/org/omg/CORBA/WStringValueHelper.java +++ b/libjava/classpath/org/omg/CORBA/WStringValueHelper.java @@ -38,10 +38,9 @@ exception statement from your version. */ package org.omg.CORBA; -import gnu.CORBA.Restricted_ORB; -import gnu.CORBA.gnuAny; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; -import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.BoxedValueHelper; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -75,7 +74,7 @@ public class WStringValueHelper * The Wide String typecode. */ private static final TypeCode twString = - Restricted_ORB.Singleton.create_wstring_tc(0); + OrbRestricted.Singleton.create_wstring_tc(0); /** * Returns the String Value repository Id. @@ -121,7 +120,9 @@ public class WStringValueHelper } catch (ClassCastException ex) { - throw new MARSHAL("String expected"); + MARSHAL m = new MARSHAL("String expected"); + m.minor = Minor.ClassCast; + throw m; } } @@ -141,7 +142,11 @@ public class WStringValueHelper return an_any.extract_wstring(); } else - throw new BAD_OPERATION("Contains not a wide string value type"); + { + BAD_OPERATION bad = new BAD_OPERATION("WString value type expected"); + bad.minor = Minor.Any; + throw bad; + } } /** @@ -177,7 +182,7 @@ public class WStringValueHelper { if (typecode == null) { - ORB orb = Restricted_ORB.Singleton; + ORB orb = OrbRestricted.Singleton; typecode = orb.create_value_box_tc(id(), "WStringValue", twString); } diff --git a/libjava/classpath/org/omg/CORBA/WrongTransactionHelper.java b/libjava/classpath/org/omg/CORBA/WrongTransactionHelper.java new file mode 100644 index 00000000000..5bb5baff2eb --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/WrongTransactionHelper.java @@ -0,0 +1,151 @@ +/* WrongTransactionHelper.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.EmptyExceptionHolder; +import gnu.CORBA.Minor; + +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 WrongTransaction}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class WrongTransactionHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the WrongTransaction typecode (structure, + * named "WrongTransaction"), no fields. + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = ORB.init(); + StructMember[] members = new StructMember[ 0 ]; + typeCode = orb.create_exception_tc(id(), "WrongTransaction", members); + } + return typeCode; + } + + /* 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()); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/CORBA/WrongTransactionHolder.java b/libjava/classpath/org/omg/CORBA/WrongTransactionHolder.java new file mode 100644 index 00000000000..103724f81dd --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/WrongTransactionHolder.java @@ -0,0 +1,103 @@ +/* WrongTransactionHolder.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.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 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(); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/CORBA/_IDLTypeStub.java b/libjava/classpath/org/omg/CORBA/_IDLTypeStub.java index db36fa78016..6661b0c4702 100644 --- a/libjava/classpath/org/omg/CORBA/_IDLTypeStub.java +++ b/libjava/classpath/org/omg/CORBA/_IDLTypeStub.java @@ -38,6 +38,7 @@ exception statement from your version. */ package org.omg.CORBA; +import gnu.CORBA.Minor; import gnu.CORBA.TypeCodeHelper; import org.omg.CORBA.portable.ApplicationException; @@ -52,7 +53,7 @@ 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.IOR_Delegate} + * working instance with the known IOR, pass {@link gnu.CORBA.IorDelegate} * to the constructor. * * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) @@ -78,7 +79,7 @@ public class _IDLTypeStub /** * Create an instance with the given delegate. * - * @see gnu.CORBA.IOR_Delegate + * @see gnu.CORBA.IorDelegate */ public _IDLTypeStub(Delegate delegate) { @@ -114,6 +115,7 @@ public class _IDLTypeStub catch (UserException ex) { MARSHAL m = new MARSHAL(); + m.minor = Minor.UserException; m.initCause(ex); throw m; } diff --git a/libjava/classpath/org/omg/CORBA/portable/ObjectImpl.java b/libjava/classpath/org/omg/CORBA/portable/ObjectImpl.java index 3cf1f49770d..f2f21a79e17 100644 --- a/libjava/classpath/org/omg/CORBA/portable/ObjectImpl.java +++ b/libjava/classpath/org/omg/CORBA/portable/ObjectImpl.java @@ -60,9 +60,9 @@ public abstract class ObjectImpl implements org.omg.CORBA.Object { /** - * The vendor - dependent delegate, responsible for the method implementations. + * The delegate, responsible for the method implementations. */ - private Delegate delegate; + transient Delegate delegate; /** * Create a request to invoke the method of this object, specifying |