diff options
author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-15 23:20:01 +0000 |
---|---|---|
committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-15 23:20:01 +0000 |
commit | 3b3101d8b5ae4f08a16c0b7111da6cad41bbd282 (patch) | |
tree | a5eb7cf42a51869cc8aa1fad7ad6a90cca47fdd8 /libjava/classpath/org | |
parent | 7e55c49d7d91ef9f09e93c1100119b1ab3652446 (diff) | |
download | gcc-3b3101d8b5ae4f08a16c0b7111da6cad41bbd282.tar.gz |
Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated.
* Makefile.in: Likewise.
* scripts/makemake.tcl: Use glob -nocomplain.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/org')
219 files changed, 6586 insertions, 577 deletions
diff --git a/libjava/classpath/org/ietf/jgss/GSSCredential.java b/libjava/classpath/org/ietf/jgss/GSSCredential.java index 724825d5eed..bdf14971006 100644 --- a/libjava/classpath/org/ietf/jgss/GSSCredential.java +++ b/libjava/classpath/org/ietf/jgss/GSSCredential.java @@ -331,4 +331,14 @@ public interface GSSCredential extends Cloneable * @return True if this object equals the other. */ boolean equals(Object another); + + /** + * Return the hash code of this credential. When overriding {@link #equals}, + * it is necessary to override hashCode() as well. + * + * @return the hash code that must be the same for two credentials if + * {@link #equals} returns true. + */ + int hashCode(); + } diff --git a/libjava/classpath/org/ietf/jgss/GSSException.java b/libjava/classpath/org/ietf/jgss/GSSException.java index 5443f766cfe..9c352e3e937 100644 --- a/libjava/classpath/org/ietf/jgss/GSSException.java +++ b/libjava/classpath/org/ietf/jgss/GSSException.java @@ -1,5 +1,5 @@ /* GSSException.java -- a general exception in GSS. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -79,6 +79,9 @@ import java.util.ResourceBundle; * the caller, this class performs the mapping from their numeric values * to textual representations. All Java GSS-API methods are declared * throwing this exception. + * + * @specnote Some of the constant values defined in this class were + * chosen to be compatible with J2SE 1.4, and not with RFC 2853. */ public class GSSException extends Exception { @@ -90,28 +93,29 @@ public class GSSException extends Exception // Constants and fields. // ------------------------------------------------------------------------- - // These values do not jive with the "Constant Field Values" in the J2SE - // 1.4.1, but do follow RFC 2853. I trust the IETF, but not Sun. - /** * Channel bindings mismatch error. + * @specnote Should be 4 according to RFC 2853. */ - public static final int BAD_BINDINGS = 4; + public static final int BAD_BINDINGS = 1; /** * Unsupported mechanism requested error. + * @specnote Should be 1 according to RFC 2853. */ - public static final int BAD_MECH = 1; + public static final int BAD_MECH = 2; /** * Invalid name provided error. + * @specnote Should be 2 according to RFC 2853. */ - public static final int BAD_NAME = 2; + public static final int BAD_NAME = 3; /** * Name of unsupported type provided error. + * @specnote Should be 3 according to RFC 2853. */ - public static final int BAD_NAMETYPE = 3; + public static final int BAD_NAMETYPE = 4; /** * Invalid status code error - this is the default status value. @@ -125,38 +129,45 @@ public class GSSException extends Exception /** * Specified security context expired error. + * @specnote Should be 12 according to RFC 2853. */ - public static final int CONTEXT_EXPIRED = 12; + public static final int CONTEXT_EXPIRED = 7; /** * Expired credentials detected error. + * @specnote Should be 11 according to RFC 2853. */ - public static final int CREDENTIALS_EXPIRED = 11; + public static final int CREDENTIALS_EXPIRED = 8; /** * Defective credential error. + * @specnote Should be 10 according to RFC 2853. */ - public static final int DEFECTIVE_CREDENTIAL = 10; + public static final int DEFECTIVE_CREDENTIAL = 9; /** * Defective token error. + * @specnote Should be 9 according to RFC 2853. */ - public static final int DEFECTIVE_TOKEN = 9; + public static final int DEFECTIVE_TOKEN = 10; /** * General failure, unspecified at GSS-API level. + * @specnote Should be 13 according to RFC 2853. */ - public static final int FAILURE = 13; + public static final int FAILURE = 11; /** * Invalid security context error. + * @specnote Should be 8 according to RFC 2853. */ - public static final int NO_CONTEXT = 8; + public static final int NO_CONTEXT = 12; /** * Invalid credentials error. + * @specnote Should be 7 according to RFC 2853. */ - public static final int NO_CRED = 7; + public static final int NO_CRED = 13; /** * Unsupported QOP value error. @@ -188,16 +199,18 @@ public class GSSException extends Exception * code that may occur during context establishment. It is not used to * indicate supplementary status values. The MessageProp object is used * for that purpose. + * @specnote Should be 20 according to RFC 2853. */ - public static final int DUPLICATE_TOKEN = 20; + public static final int DUPLICATE_TOKEN = 19; /** * The token's validity period has expired. This is a fatal error code * that may occur during context establishment. It is not used to * indicate supplementary status values. The MessageProp object is used * for that purpose. + * @specnote Should be 19 according to RFC 2853. */ - public static final int OLD_TOKEN = 19; + public static final int OLD_TOKEN = 20; /** * A later token has already been processed. This is a fatal error code diff --git a/libjava/classpath/org/ietf/jgss/GSSName.java b/libjava/classpath/org/ietf/jgss/GSSName.java index 5550697b5f0..ee3209dd0b4 100644 --- a/libjava/classpath/org/ietf/jgss/GSSName.java +++ b/libjava/classpath/org/ietf/jgss/GSSName.java @@ -201,6 +201,15 @@ public interface GSSName boolean equals(Object another); /** + * Return the hashcode of this GSSName. When overriding {@link #equals}, + * it is normally necessary to override hashCode() as well. + * + * @return the hash code that must be the same for two names if {@link #equals} + * returns true. + */ + int hashCode(); + + /** * Creates a mechanism name (MN) from an arbitrary internal name. This * is equivalent to using the factory methods {@link * GSSManager#createName(java.lang.String,org.ietf.jgss.Oid,org.ietf.jgss.Oid)} 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/PolicyErrorHolder.java b/libjava/classpath/org/omg/CORBA/PolicyErrorHolder.java new file mode 100644 index 00000000000..8e2c9a8d342 --- /dev/null +++ b/libjava/classpath/org/omg/CORBA/PolicyErrorHolder.java @@ -0,0 +1,103 @@ +/* PolicyErrorHolder.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 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 diff --git a/libjava/classpath/org/omg/CORBA_2_3/ORB.java b/libjava/classpath/org/omg/CORBA_2_3/ORB.java index 7a9dc6a1a57..82660fea705 100644 --- a/libjava/classpath/org/omg/CORBA_2_3/ORB.java +++ b/libjava/classpath/org/omg/CORBA_2_3/ORB.java @@ -117,11 +117,9 @@ public abstract class ORB } /** - * Up till OMG 3.0.3 inclusive and also in Suns API till 1.4 - * inclusive this is totally undocumented. No problem, though, - * because is in addition not implemented. - * - * @throws NO_IMPLEMENT, always. + * This method is called by RMI-IIOP {@link javax.rmi.Tie#orb(ORB)}, + * passing <code>this</code> as parameter. The ORB will try to connect + * that tie as one of its objects. */ public void set_delegate(java.lang.Object wrapper) { diff --git a/libjava/classpath/org/omg/CORBA_2_3/portable/InputStream.java b/libjava/classpath/org/omg/CORBA_2_3/portable/InputStream.java index 06ee33e6616..23055ef2d4d 100644 --- a/libjava/classpath/org/omg/CORBA_2_3/portable/InputStream.java +++ b/libjava/classpath/org/omg/CORBA_2_3/portable/InputStream.java @@ -40,9 +40,9 @@ package org.omg.CORBA_2_3.portable; import gnu.CORBA.CDR.Vio; -import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.CustomMarshal; import org.omg.CORBA.portable.BoxedValueHelper; -import org.omg.CORBA.portable.ValueFactory; +import org.omg.CORBA.portable.StreamableValue; import java.io.Serializable; @@ -78,12 +78,12 @@ public abstract class InputStream */ public Object read_abstract_interface() { - boolean isValue = read_boolean(); + boolean isObject = read_boolean(); - if (isValue) - return read_value(); - else + if (isObject) return read_Object(); + else + return read_value(); } /** @@ -192,11 +192,7 @@ public abstract class InputStream */ public Serializable read_value(String repository_id) { - ValueFactory factory = - ((org.omg.CORBA_2_3.ORB) orb()).lookup_value_factory(repository_id); - if (factory == null) - throw new MARSHAL("No factory"); - return (Serializable) Vio.read(this, null, factory); + return Vio.read(this, repository_id); } /** diff --git a/libjava/classpath/org/omg/CORBA_2_3/portable/OutputStream.java b/libjava/classpath/org/omg/CORBA_2_3/portable/OutputStream.java index 2ff8c226a82..70f9a4913ba 100644 --- a/libjava/classpath/org/omg/CORBA_2_3/portable/OutputStream.java +++ b/libjava/classpath/org/omg/CORBA_2_3/portable/OutputStream.java @@ -64,40 +64,40 @@ public abstract class OutputStream extends org.omg.CORBA.portable.OutputStream { /** - * Writes an abstract interface to the stream. An abstract interface can - * be eithe CORBA object or value type and is written as a union with - * the boolean discriminator (false for objects, true for value types). - * - * The object from value is separated by fact that all values implement - * the {@link ValueBase} interface. Also, the passed parameter is treated - * as value it it does not implement CORBA Object. - * + * Writes an abstract interface to the stream. An abstract interface can be + * eithe CORBA object or value type and is written as a union with the boolean + * discriminator (false for objects, true for value types). + * + * The object from value is separated by fact that all values implement the + * {@link ValueBase} interface. Also, the passed parameter is treated as value + * it it does not implement CORBA Object. + * * @param an_interface an abstract interface to write. */ public void write_abstract_interface(java.lang.Object an_interface) { - boolean isValue = - an_interface instanceof ValueBase || - (!(an_interface instanceof org.omg.CORBA.Object)); + boolean isObject = !(an_interface instanceof ValueBase) + && an_interface instanceof org.omg.CORBA.Object; - write_boolean(isValue); + write_boolean(isObject); - if (isValue) - write_value((ValueBase) an_interface); - else + if (isObject) write_Object((org.omg.CORBA.Object) an_interface); + else + write_value((Serializable) an_interface); + } /** * Writes a value type into the output stream. - * - * The value type must implement either {@link CustomValue} - * (for user-defined writing method) or {@link StramableValue} - * (for standard writing using code, generated by IDL compiler). - * - * The written record will have a repository id, matching the - * class of the passed object. The codebase will not be written. - * + * + * The value type must implement either {@link CustomValue} (for user-defined + * writing method) or {@link StramableValue} (for standard writing using code, + * generated by IDL compiler). + * + * The written record will have a repository id, matching the class of the + * passed object. The codebase will not be written. + * * @param value a value type object to write. */ public void write_value(Serializable value) @@ -124,7 +124,9 @@ public abstract class OutputStream * Writes a value type into the output stream, stating it is an * instance of the given class. The written record * will have a repository id, matching the passed class. - * The codebase will not be written. + * The codebase will not be written. It the object + * being written is an instance of the different class, this results + * writing two Id inheritance hierarchy. * * The value type must implement either {@link CustomValue} * (for user-defined writing method) or {@link StramableValue} @@ -138,15 +140,15 @@ public abstract class OutputStream } /** - * Writes a value type into the output stream, - * stating it has the given repository id. - * - * The value type must implement either {@link CustomValue} - * (for user-defined writing method) or {@link StramableValue} - * (for standard writing using code, generated by IDL compiler). - * + * Writes a value type into the output stream, stating it has the given + * repository id. + * + * The value type must implement either {@link CustomValue} (for user-defined + * writing method) or {@link StramableValue} (for standard writing using code, + * generated by IDL compiler). + * * @param repository_id a repository id of the value type. - * + * * @param value a value type object to write. */ public void write_value(Serializable value, String repository_id) diff --git a/libjava/classpath/org/omg/CosNaming/BindingHelper.java b/libjava/classpath/org/omg/CosNaming/BindingHelper.java index 1665464ec7e..b5b42077218 100644 --- a/libjava/classpath/org/omg/CosNaming/BindingHelper.java +++ b/libjava/classpath/org/omg/CosNaming/BindingHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -74,7 +76,10 @@ public abstract class BindingHelper } catch (ClassCastException ex) { - throw new BAD_OPERATION("Binding expected"); + BAD_OPERATION bad = new BAD_OPERATION("Binding expected"); + bad.minor = Minor.Any; + bad.initCause(ex); + throw bad; } } diff --git a/libjava/classpath/org/omg/CosNaming/BindingIteratorHelper.java b/libjava/classpath/org/omg/CosNaming/BindingIteratorHelper.java index 204d9f05872..64f7b4dfa51 100644 --- a/libjava/classpath/org/omg/CosNaming/BindingIteratorHelper.java +++ b/libjava/classpath/org/omg/CosNaming/BindingIteratorHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.BAD_PARAM; @@ -78,6 +80,7 @@ public abstract class BindingIteratorHelper { BAD_OPERATION bad = new BAD_OPERATION("Binding iterator expected"); bad.initCause(ex); + bad.minor = Minor.Any; throw bad; } } @@ -121,6 +124,35 @@ public abstract class BindingIteratorHelper return new _BindingIteratorStub(delegate); } } + + /** + * Narrow the given object to the BindingIterator. No type-checking is + * performed to verify that the object actually supports the requested type. + * The {@link BAD_OPERATION} will be thrown if unsupported operations are + * invoked on the new returned reference, but no failure is expected at the + * time of the unchecked_narrow. + * + * @param obj the object to cast. + * + * @return the casted binding iterator. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static BindingIterator unchecked_narrow(org.omg.CORBA.Object obj) + { + if (obj == null) + return null; + else if (obj instanceof BindingIterator) + return (BindingIterator) obj; + else + { + // Do not call the _is_a(..). + Delegate delegate = ((ObjectImpl) obj)._get_delegate(); + return new _BindingIteratorStub(delegate); + } + } /** * Read the exception from the given CDR stream. diff --git a/libjava/classpath/org/omg/CosNaming/BindingIteratorPOA.java b/libjava/classpath/org/omg/CosNaming/BindingIteratorPOA.java index 1aa7521fbb2..988c4ee9126 100644 --- a/libjava/classpath/org/omg/CosNaming/BindingIteratorPOA.java +++ b/libjava/classpath/org/omg/CosNaming/BindingIteratorPOA.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.CompletionStatus; import org.omg.CORBA.portable.InputStream; @@ -103,7 +105,8 @@ public abstract class BindingIteratorPOA out = rh.createReply(); } else - throw new BAD_OPERATION(method, 0, CompletionStatus.COMPLETED_MAYBE); + throw new BAD_OPERATION(method, Minor.Method, + CompletionStatus.COMPLETED_MAYBE); return out; } diff --git a/libjava/classpath/org/omg/CosNaming/BindingTypeHelper.java b/libjava/classpath/org/omg/CosNaming/BindingTypeHelper.java index ede00008ea7..2f0dc71c4ef 100644 --- a/libjava/classpath/org/omg/CosNaming/BindingTypeHelper.java +++ b/libjava/classpath/org/omg/CosNaming/BindingTypeHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -71,6 +73,7 @@ public abstract class BindingTypeHelper { BAD_OPERATION bad = new BAD_OPERATION("Binding type expected"); bad.initCause(ex); + bad.minor = Minor.Any; throw bad; } } diff --git a/libjava/classpath/org/omg/CosNaming/IstringHelper.java b/libjava/classpath/org/omg/CosNaming/IstringHelper.java index 83bbecee5af..b90b452e69f 100644 --- a/libjava/classpath/org/omg/CosNaming/IstringHelper.java +++ b/libjava/classpath/org/omg/CosNaming/IstringHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CosNaming; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.Any; import org.omg.CORBA.ORB; @@ -84,7 +84,7 @@ public abstract class IstringHelper */ public static TypeCode type() { - ORB orb = Restricted_ORB.Singleton; + ORB orb = OrbRestricted.Singleton; return orb.create_alias_tc(id(), "Istring", orb.create_string_tc(0)); } diff --git a/libjava/classpath/org/omg/CosNaming/NameComponent.java b/libjava/classpath/org/omg/CosNaming/NameComponent.java index a2db313e620..1e06caaeffe 100644 --- a/libjava/classpath/org/omg/CosNaming/NameComponent.java +++ b/libjava/classpath/org/omg/CosNaming/NameComponent.java @@ -40,6 +40,8 @@ package org.omg.CosNaming; import org.omg.CORBA.portable.IDLEntity; +import java.util.zip.Adler32; + /** * The name component, a node in the multi-comonent name. * @@ -115,4 +117,14 @@ public final class NameComponent { return id + "." + kind; } -}
\ No newline at end of file + + /** + * Return the hashCode of this NameComponent. + */ + public int hashCode() + { + Adler32 adler = new Adler32(); + adler.update(toString().getBytes()); + return (int) adler.getValue() & Integer.MAX_VALUE; + } +} diff --git a/libjava/classpath/org/omg/CosNaming/NameComponentHelper.java b/libjava/classpath/org/omg/CosNaming/NameComponentHelper.java index 9f0e1287efd..8499edfe66e 100644 --- a/libjava/classpath/org/omg/CosNaming/NameComponentHelper.java +++ b/libjava/classpath/org/omg/CosNaming/NameComponentHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -76,6 +78,7 @@ public abstract class NameComponentHelper { BAD_OPERATION bad = new BAD_OPERATION("Name component expected"); bad.initCause(ex); + bad.minor = Minor.Any; throw bad; } } diff --git a/libjava/classpath/org/omg/CosNaming/NameHelper.java b/libjava/classpath/org/omg/CosNaming/NameHelper.java index 047ad918f93..18faf31823b 100644 --- a/libjava/classpath/org/omg/CosNaming/NameHelper.java +++ b/libjava/classpath/org/omg/CosNaming/NameHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -77,6 +79,7 @@ public abstract class NameHelper { BAD_OPERATION bad = new BAD_OPERATION("Name expected"); bad.initCause(ex); + bad.minor = Minor.Any; throw bad; } } diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextExtHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextExtHelper.java index 6e2ef060b9a..86bf8c55dfd 100644 --- a/libjava/classpath/org/omg/CosNaming/NamingContextExtHelper.java +++ b/libjava/classpath/org/omg/CosNaming/NamingContextExtHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.BAD_PARAM; @@ -78,6 +80,7 @@ public abstract class NamingContextExtHelper { BAD_OPERATION bad = new BAD_OPERATION("NamingContextExt expected"); bad.initCause(ex); + bad.minor = Minor.Any; throw bad; } } @@ -122,6 +125,35 @@ public abstract class NamingContextExtHelper return new _NamingContextExtStub(delegate); } } + + /** + * Narrow the given object to the NamingContextExt. No type-checking is + * performed to verify that the object actually supports the requested type. + * The {@link BAD_OPERATION} will be thrown if unsupported operations are + * invoked on the new returned reference, but no failure is expected at the + * time of the unchecked_narrow. + * + * @param obj the object to cast. + * + * @return the casted NamingContextExt + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static NamingContextExt unchecked_narrow(org.omg.CORBA.Object obj) + { + if (obj == null) + return null; + else if (obj instanceof NamingContextExt) + return (NamingContextExt) obj; + else + { + // Do not call the _is_a(..). + Delegate delegate = ((ObjectImpl) obj)._get_delegate(); + return new _NamingContextExtStub(delegate); + } + } /** * Read the extended naming context from the given CDR input stream. diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextExtPOA.java b/libjava/classpath/org/omg/CosNaming/NamingContextExtPOA.java index a6d3346f82c..cf5d7b3d808 100644 --- a/libjava/classpath/org/omg/CosNaming/NamingContextExtPOA.java +++ b/libjava/classpath/org/omg/CosNaming/NamingContextExtPOA.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.CompletionStatus; import org.omg.CORBA.ObjectHelper; @@ -189,7 +191,7 @@ public abstract class NamingContextExtPOA OutputStream out = null; Integer call_method = (Integer) _NamingContextImplBase.methods.get(method); if (call_method == null) - throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE); + throw new BAD_OPERATION(Minor.Method, CompletionStatus.COMPLETED_MAYBE); switch (call_method.intValue()) { diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextHelper.java index 3a60d9cb4de..fb9b091a6a0 100644 --- a/libjava/classpath/org/omg/CosNaming/NamingContextHelper.java +++ b/libjava/classpath/org/omg/CosNaming/NamingContextHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.BAD_PARAM; @@ -78,6 +80,7 @@ public abstract class NamingContextHelper { BAD_OPERATION bad = new BAD_OPERATION("Naming context expected"); bad.initCause(ex); + bad.minor = Minor.Any; throw bad; } } @@ -130,6 +133,35 @@ public abstract class NamingContextHelper else throw new BAD_PARAM(); } + + /** + * Narrow the given object to the NamingContext. No type-checking is performed + * to verify that the object actually supports the requested type. The + * {@link BAD_OPERATION} will be thrown if unsupported operations are invoked + * on the new returned reference, but no failure is expected at the time of + * the unchecked_narrow. + * + * @param obj the object to cast. + * + * @return the casted NamingContext. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static NamingContext unchecked_narrow(org.omg.CORBA.Object obj) + { + if (obj == null) + return null; + else if (obj instanceof NamingContext) + return (NamingContext) obj; + else + { + // Do not call the _is_a(..). + Delegate delegate = ((ObjectImpl) obj)._get_delegate(); + return new _NamingContextStub(delegate); + } + } /** * Read the naming context from the given CDR input stream. diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextPOA.java b/libjava/classpath/org/omg/CosNaming/NamingContextPOA.java index a2db0ad3502..a9788827642 100644 --- a/libjava/classpath/org/omg/CosNaming/NamingContextPOA.java +++ b/libjava/classpath/org/omg/CosNaming/NamingContextPOA.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.CompletionStatus; import org.omg.CORBA.ObjectHelper; @@ -92,7 +94,7 @@ public abstract class NamingContextPOA OutputStream out = null; Integer call_method = (Integer) _NamingContextImplBase.methods.get(method); if (call_method == null) - throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE); + throw new BAD_OPERATION(Minor.Method, CompletionStatus.COMPLETED_MAYBE); switch (call_method.intValue()) { diff --git a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.java index 9487895213c..6bf7bd7a6b3 100644 --- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.java +++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming.NamingContextPackage; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -75,7 +77,10 @@ public abstract class AlreadyBoundHelper } 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/CosNaming/NamingContextPackage/CannotProceedHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/CannotProceedHelper.java index d1a1da51e4e..1d0b6049b66 100644 --- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/CannotProceedHelper.java +++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/CannotProceedHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming.NamingContextPackage; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -78,7 +80,10 @@ public abstract class CannotProceedHelper } 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/CosNaming/NamingContextPackage/InvalidNameHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.java index 434713b2d6f..8f1133602d7 100644 --- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.java +++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming.NamingContextPackage; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -75,7 +77,10 @@ public abstract class InvalidNameHelper } 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/CosNaming/NamingContextPackage/NotEmptyHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.java index e1f82994f9e..6333dfcbcd3 100644 --- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.java +++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming.NamingContextPackage; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -75,7 +77,10 @@ public abstract class NotEmptyHelper } 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/CosNaming/NamingContextPackage/NotFoundHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundHelper.java index 544ab63776f..442b7db9e63 100644 --- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundHelper.java +++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming.NamingContextPackage; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -77,7 +79,10 @@ public abstract class NotFoundHelper } 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/CosNaming/NamingContextPackage/NotFoundReasonHelper.java b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.java index b6eacf85f90..45a42a0ba70 100644 --- a/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.java +++ b/libjava/classpath/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming.NamingContextPackage; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -74,7 +76,10 @@ public abstract class NotFoundReasonHelper } 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/CosNaming/_BindingIteratorImplBase.java b/libjava/classpath/org/omg/CosNaming/_BindingIteratorImplBase.java index 53c0dd3a656..9c7e1b34728 100644 --- a/libjava/classpath/org/omg/CosNaming/_BindingIteratorImplBase.java +++ b/libjava/classpath/org/omg/CosNaming/_BindingIteratorImplBase.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.BooleanHolder; import org.omg.CORBA.CompletionStatus; @@ -114,7 +116,8 @@ public abstract class _BindingIteratorImplBase out = rh.createReply(); } else - throw new BAD_OPERATION(method, 0, CompletionStatus.COMPLETED_MAYBE); + throw new BAD_OPERATION(method, Minor.Method, + CompletionStatus.COMPLETED_MAYBE); return out; } diff --git a/libjava/classpath/org/omg/CosNaming/_NamingContextExtStub.java b/libjava/classpath/org/omg/CosNaming/_NamingContextExtStub.java index 3ad77203084..a0bc80ac08d 100644 --- a/libjava/classpath/org/omg/CosNaming/_NamingContextExtStub.java +++ b/libjava/classpath/org/omg/CosNaming/_NamingContextExtStub.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.CosNaming; -import gnu.CORBA.NamingService.snConverter; +import gnu.CORBA.NamingService.NameTransformer; import org.omg.CORBA.MARSHAL; import org.omg.CORBA.ObjectHelper; @@ -86,7 +86,7 @@ public class _NamingContextExtStub /** * The local name form converter. */ - private snConverter converter = new snConverter(); + private NameTransformer converter = new NameTransformer(); /** * Create the naming context stub. diff --git a/libjava/classpath/org/omg/CosNaming/_NamingContextImplBase.java b/libjava/classpath/org/omg/CosNaming/_NamingContextImplBase.java index 7c1fb3a1d1e..33bddef5d74 100644 --- a/libjava/classpath/org/omg/CosNaming/_NamingContextImplBase.java +++ b/libjava/classpath/org/omg/CosNaming/_NamingContextImplBase.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.CosNaming; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.CompletionStatus; import org.omg.CORBA.DynamicImplementation; @@ -123,7 +125,7 @@ public abstract class _NamingContextImplBase OutputStream out = null; Integer call_method = (Integer) methods.get(method); if (call_method == null) - throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE); + throw new BAD_OPERATION(Minor.Method, CompletionStatus.COMPLETED_MAYBE); switch (call_method.intValue()) { @@ -389,7 +391,7 @@ public abstract class _NamingContextImplBase // The server request contains no required result type. Integer call_method = (Integer) methods.get(request.operation()); if (call_method == null) - throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE); + throw new BAD_OPERATION(Minor.Method, CompletionStatus.COMPLETED_MAYBE); switch (call_method.intValue()) { diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java index 0c02916e542..b8e3aafef5b 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryHelper.java @@ -39,6 +39,8 @@ exception statement from your version. */ package org.omg.DynamicAny; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_PARAM; import org.omg.CORBA.TypeCode; import org.omg.CORBA.ORB; @@ -80,6 +82,25 @@ public abstract class DynAnyFactoryHelper + " is not a DynAnyFactory"); } } + + /** + * Narrow the given object to the DynAnyFactory. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted DynAnyFactory. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static DynAnyFactory unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } /** * Get the final_type code of the {@link DynAnyFactory}. @@ -161,13 +182,8 @@ public abstract class DynAnyFactoryHelper */ static String not_applicable(String Id) { - try - { - throw new MARSHAL("The read/write are not applicable for " + Id); - } - catch (Exception e) - { - throw new MARSHAL(); - } + MARSHAL m = new MARSHAL("The read/write are not applicable for " + Id); + m.minor = Minor.Inappropriate; + throw m; } }
\ No newline at end of file diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java index c7b54bef89d..a9f45c4b73c 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.DynamicAny.DynAnyFactoryPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -106,6 +107,7 @@ public abstract class InconsistentTypeCodeHelper { BAD_OPERATION bad = new BAD_OPERATION("InconsistentTypeCode expected"); bad.initCause(cex); + bad.minor = Minor.Any; throw bad; } } diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java index ca48cd4c5aa..73e2d9856a1 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyHelper.java @@ -79,6 +79,25 @@ public abstract class DynAnyHelper throw new BAD_PARAM(obj.getClass().getName() + " is not a DynAny"); } } + + /** + * Narrow the given object to the DynAny. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted DynAny. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static DynAny unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } /** * Get the type code of the {@link DynAny}. diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java index 55e35eedc81..1b5004f072b 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.DynamicAny.DynAnyPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -107,6 +108,7 @@ public abstract class InvalidValueHelper { BAD_OPERATION bad = new BAD_OPERATION("InvalidValue expected"); bad.initCause(cex); + bad.minor = Minor.Any; throw bad; } } diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java index e15fb72c668..b09ab4db863 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.DynamicAny.DynAnyPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -107,6 +108,7 @@ public abstract class TypeMismatchHelper { BAD_OPERATION bad = new BAD_OPERATION("TypeMismatch expected"); bad.initCause(cex); + bad.minor = Minor.Any; throw bad; } } diff --git a/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java b/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java index 87e34452319..ec3f0c4815f 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynAnySeqHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.DynamicAny; import gnu.CORBA.DynAnySeqHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -106,6 +107,7 @@ public abstract class DynAnySeqHelper { BAD_OPERATION bad = new BAD_OPERATION("DynAnySeq expected"); bad.initCause(cex); + bad.minor = Minor.Any; throw bad; } } diff --git a/libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java b/libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java index 0372b58518c..f2892c85692 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynArrayHelper.java @@ -78,6 +78,25 @@ public abstract class DynArrayHelper throw new BAD_PARAM(obj.getClass().getName() + " is not a DynArray"); } } + + /** + * Narrow the given object to the DynArray. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted DynArray. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static DynArray unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } /** * Get the type code of the {@link DynArray}. diff --git a/libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java b/libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java index 944d4375739..8db1a20065e 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynEnumHelper.java @@ -79,6 +79,25 @@ public abstract class DynEnumHelper throw new BAD_PARAM(obj.getClass().getName() + " is not a DynEnum"); } } + + /** + * Narrow the given object to the DynEnum. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted DynEnum. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static DynEnum unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } /** * Get the type code of the {@link DynEnum}. diff --git a/libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java b/libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java index 1d818d7b178..84bb59d9f3c 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynFixedHelper.java @@ -79,6 +79,25 @@ public abstract class DynFixedHelper throw new BAD_PARAM(obj.getClass().getName() + " is not a DynFixed"); } } + + /** + * Narrow the given object to the DynFixed. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted DynFixed. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static DynFixed unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } /** * Get the type code of the {@link DynFixed}. diff --git a/libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java b/libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java index c38a51f0951..ad30133712e 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynSequenceHelper.java @@ -78,6 +78,25 @@ public abstract class DynSequenceHelper throw new BAD_PARAM(obj.getClass().getName() + " is not a DynSequence"); } } + + /** + * Narrow the given object to the DynSequence. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted DynSequence. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static DynSequence unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } /** * Get the type code of the {@link DynSequence}. diff --git a/libjava/classpath/org/omg/DynamicAny/DynStructHelper.java b/libjava/classpath/org/omg/DynamicAny/DynStructHelper.java index e4790b443ff..021c5d031a5 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynStructHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynStructHelper.java @@ -78,6 +78,25 @@ public abstract class DynStructHelper throw new BAD_PARAM(obj.getClass().getName() + " is not a DynStruct"); } } + + /** + * Narrow the given object to the DynStruct. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted DynStruct. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static DynStruct unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } /** * Get the type code of the {@link DynStruct}. diff --git a/libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java b/libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java index 794098333e9..8f924c0864e 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynUnionHelper.java @@ -78,6 +78,25 @@ public abstract class DynUnionHelper throw new BAD_PARAM(obj.getClass().getName() + " is not a DynUnion"); } } + + /** + * Narrow the given object to the DynUnion. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted DynUnion. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static DynUnion unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } /** * Get the type code of the {@link DynUnion}. diff --git a/libjava/classpath/org/omg/DynamicAny/DynValueHelper.java b/libjava/classpath/org/omg/DynamicAny/DynValueHelper.java index a6d7afaa9e3..026ca499077 100644 --- a/libjava/classpath/org/omg/DynamicAny/DynValueHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/DynValueHelper.java @@ -78,6 +78,25 @@ public abstract class DynValueHelper throw new BAD_PARAM(obj.getClass().getName() + " is not a DynValue"); } } + + /** + * Narrow the given object to the DynValue. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted DynValue. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static DynValue unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } /** * Get the type code of the {@link DynValue}. diff --git a/libjava/classpath/org/omg/DynamicAny/FieldNameHelper.java b/libjava/classpath/org/omg/DynamicAny/FieldNameHelper.java index 7c4cdbf4919..f15b8adfa4f 100644 --- a/libjava/classpath/org/omg/DynamicAny/FieldNameHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/FieldNameHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.DynamicAny; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.Any; import org.omg.CORBA.ORB; @@ -84,7 +84,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/DynamicAny/NameDynAnyPairHelper.java b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairHelper.java index d649800b8b6..a0e5c6b85f9 100644 --- a/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairHelper.java @@ -38,6 +38,7 @@ exception statement from your version. */ package org.omg.DynamicAny; +import gnu.CORBA.Minor; import gnu.CORBA.NameDynAnyPairHolder; import org.omg.CORBA.Any; @@ -83,6 +84,7 @@ public abstract class NameDynAnyPairHelper { BAD_OPERATION bad = new BAD_OPERATION("NameDynAnyPair expected"); bad.initCause(cex); + bad.minor = Minor.Any; throw bad; } } diff --git a/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java index f110926b853..ec4f728228f 100644 --- a/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/NameDynAnyPairSeqHelper.java @@ -38,6 +38,7 @@ exception statement from your version. */ package org.omg.DynamicAny; +import gnu.CORBA.Minor; import gnu.CORBA.NameDynAnyPairSeqHolder; import org.omg.CORBA.Any; @@ -105,6 +106,7 @@ public abstract class NameDynAnyPairSeqHelper { BAD_OPERATION bad = new BAD_OPERATION("NameDynAnyPairSeq expected"); bad.initCause(cex); + bad.minor = Minor.Any; throw bad; } } diff --git a/libjava/classpath/org/omg/DynamicAny/NameValuePairHelper.java b/libjava/classpath/org/omg/DynamicAny/NameValuePairHelper.java index a3d5bff4526..1e0f52b5946 100644 --- a/libjava/classpath/org/omg/DynamicAny/NameValuePairHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/NameValuePairHelper.java @@ -38,6 +38,7 @@ exception statement from your version. */ package org.omg.DynamicAny; +import gnu.CORBA.Minor; import gnu.CORBA.NameValuePairHolder; import org.omg.CORBA.Any; @@ -118,6 +119,7 @@ public abstract class NameValuePairHelper { BAD_OPERATION bad = new BAD_OPERATION("NameValuePair expected"); bad.initCause(cex); + bad.minor = Minor.Any; throw bad; } } diff --git a/libjava/classpath/org/omg/DynamicAny/NameValuePairSeqHelper.java b/libjava/classpath/org/omg/DynamicAny/NameValuePairSeqHelper.java index 400708e18e0..62481534e1a 100644 --- a/libjava/classpath/org/omg/DynamicAny/NameValuePairSeqHelper.java +++ b/libjava/classpath/org/omg/DynamicAny/NameValuePairSeqHelper.java @@ -38,6 +38,7 @@ exception statement from your version. */ package org.omg.DynamicAny; +import gnu.CORBA.Minor; import gnu.CORBA.NameValuePairSeqHolder; import org.omg.CORBA.Any; @@ -98,6 +99,7 @@ public abstract class NameValuePairSeqHelper { BAD_OPERATION bad = new BAD_OPERATION("NameValuePairSeq expected"); bad.initCause(cex); + bad.minor = Minor.Any; throw bad; } } diff --git a/libjava/classpath/org/omg/DynamicAny/_DynAnyFactoryStub.java b/libjava/classpath/org/omg/DynamicAny/_DynAnyFactoryStub.java index b0f6d6052a6..15f7c816b44 100644 --- a/libjava/classpath/org/omg/DynamicAny/_DynAnyFactoryStub.java +++ b/libjava/classpath/org/omg/DynamicAny/_DynAnyFactoryStub.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.DynamicAny; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.MARSHAL; import org.omg.CORBA.TypeCode; @@ -101,7 +103,9 @@ public class _DynAnyFactoryStub public DynAny create_dyn_any(Any _0) throws InconsistentTypeCode { - throw new MARSHAL(NOT_APPLICABLE); + MARSHAL m = new MARSHAL(NOT_APPLICABLE); + m.minor = Minor.Inappropriate; + throw m; } /** @@ -113,7 +117,9 @@ public class _DynAnyFactoryStub public DynAny create_dyn_any_from_type_code(TypeCode _0) throws InconsistentTypeCode { - throw new MARSHAL(NOT_APPLICABLE); + MARSHAL m = new MARSHAL(NOT_APPLICABLE); + m.minor = Minor.Inappropriate; + throw m; } static String NOT_APPLICABLE = diff --git a/libjava/classpath/org/omg/IOP/CodecFactoryHelper.java b/libjava/classpath/org/omg/IOP/CodecFactoryHelper.java index d5c55a264cc..fea0b887bd9 100644 --- a/libjava/classpath/org/omg/IOP/CodecFactoryHelper.java +++ b/libjava/classpath/org/omg/IOP/CodecFactoryHelper.java @@ -120,6 +120,25 @@ public abstract class CodecFactoryHelper throw bad; } } + + /** + * Narrow the given object to the CodecFactory. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted CodecFactory. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static CodecFactory unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } /** * This should read the CodecFactory from the CDR intput stream, diff --git a/libjava/classpath/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.java b/libjava/classpath/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.java index a1082178c52..e036dbf1f42 100644 --- a/libjava/classpath/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.java +++ b/libjava/classpath/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.IOP.CodecFactoryPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.ORB; import org.omg.CORBA.Any; @@ -108,6 +109,7 @@ public abstract class UnknownEncodingHelper { BAD_OPERATION bad = new BAD_OPERATION("UnknownEncoding expected"); bad.initCause(cex); + bad.minor = Minor.Any; throw bad; } } diff --git a/libjava/classpath/org/omg/IOP/CodecPackage/FormatMismatchHelper.java b/libjava/classpath/org/omg/IOP/CodecPackage/FormatMismatchHelper.java index e5910ac57a0..e353be8f9ed 100644 --- a/libjava/classpath/org/omg/IOP/CodecPackage/FormatMismatchHelper.java +++ b/libjava/classpath/org/omg/IOP/CodecPackage/FormatMismatchHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.IOP.CodecPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -103,6 +104,7 @@ public abstract class FormatMismatchHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("FormatMismatch expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.java b/libjava/classpath/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.java index 6c4ce52f0b5..8a93c5895a0 100644 --- a/libjava/classpath/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.java +++ b/libjava/classpath/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.IOP.CodecPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -106,6 +107,7 @@ public abstract class InvalidTypeForEncodingHelper { BAD_OPERATION bad = new BAD_OPERATION("InvalidTypeForEncoding expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/IOP/CodecPackage/TypeMismatchHelper.java b/libjava/classpath/org/omg/IOP/CodecPackage/TypeMismatchHelper.java index 9f422863755..33951de701f 100644 --- a/libjava/classpath/org/omg/IOP/CodecPackage/TypeMismatchHelper.java +++ b/libjava/classpath/org/omg/IOP/CodecPackage/TypeMismatchHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.IOP.CodecPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -103,6 +104,7 @@ public abstract class TypeMismatchHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("TypeMismatch expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/IOP/ExceptionDetailMessage.java b/libjava/classpath/org/omg/IOP/ExceptionDetailMessage.java new file mode 100644 index 00000000000..167ab1ac7e9 --- /dev/null +++ b/libjava/classpath/org/omg/IOP/ExceptionDetailMessage.java @@ -0,0 +1,60 @@ +/* ExceptionDetailMessage.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.IOP; + +/** + * <p>Defines the ExceptionDetailMessage (= 14) service context. This context + * may be included into reply message, having the SYSTEM_EXCEPTION or + * USER_EXCEPTION reply status, as the alternative to the stack trace + * that might contain sensitive or unwanted information. The service + * context contains the CDR-encapsulated wide string, usually + * returned by {@link Exception#getMessage}. + * </p><p> + * The applications may also send the more comprehensive UnknownExceptionInfo + * ( = 9 ) service context that contains the thrown exception, written + * as the Value type. + * </p> + */ +public interface ExceptionDetailMessage +{ + /** + * Specifies the ExceptionDetailMessage value, 14. + */ + int value = 14; +} diff --git a/libjava/classpath/org/omg/IOP/IORHelper.java b/libjava/classpath/org/omg/IOP/IORHelper.java index 5945bb75aa4..77f18d9b9cd 100644 --- a/libjava/classpath/org/omg/IOP/IORHelper.java +++ b/libjava/classpath/org/omg/IOP/IORHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.IOP; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -111,6 +113,7 @@ public abstract class IORHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("IOR expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/IOP/MultipleComponentProfileHelper.java b/libjava/classpath/org/omg/IOP/MultipleComponentProfileHelper.java index bc26068c94c..6f5156fe223 100644 --- a/libjava/classpath/org/omg/IOP/MultipleComponentProfileHelper.java +++ b/libjava/classpath/org/omg/IOP/MultipleComponentProfileHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.IOP; +import gnu.CORBA.Minor; + import org.omg.CORBA.ORB; import org.omg.CORBA.Any; import org.omg.CORBA.TypeCode; @@ -96,6 +98,7 @@ public abstract class MultipleComponentProfileHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("MultipleComponentProfile expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/IOP/RMICustomMaxStreamFormat.java b/libjava/classpath/org/omg/IOP/RMICustomMaxStreamFormat.java new file mode 100644 index 00000000000..a071c848887 --- /dev/null +++ b/libjava/classpath/org/omg/IOP/RMICustomMaxStreamFormat.java @@ -0,0 +1,56 @@ +/* RMICustomMaxStreamFormat.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.IOP; + + /** + * A single constant interface, defining the RMICustomMaxStreamFormat (= 17) + * service context. This constant is used in the service contexts + * inside the message when the {@link TAG_RMI_CUSTOM_MAX_STREAM_FORMAT} + * are used in IOR references. Please note that these two constants have + * different values. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface RMICustomMaxStreamFormat +{ + /** + * Specifies the RMICustomMaxStreamFormat value, 17. + */ + int value = 17; +} diff --git a/libjava/classpath/org/omg/IOP/ServiceContextHelper.java b/libjava/classpath/org/omg/IOP/ServiceContextHelper.java index a8224a64cdc..5693a32357a 100644 --- a/libjava/classpath/org/omg/IOP/ServiceContextHelper.java +++ b/libjava/classpath/org/omg/IOP/ServiceContextHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.IOP; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -115,6 +117,7 @@ public abstract class ServiceContextHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("ServiceContext expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/IOP/ServiceContextListHelper.java b/libjava/classpath/org/omg/IOP/ServiceContextListHelper.java index 11bbe253fea..fa436cbb885 100644 --- a/libjava/classpath/org/omg/IOP/ServiceContextListHelper.java +++ b/libjava/classpath/org/omg/IOP/ServiceContextListHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.IOP; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.ORB; @@ -94,7 +96,10 @@ public abstract class ServiceContextListHelper } catch (ClassCastException ex) { - throw new BAD_OPERATION("ServiceContext[] expected."); + BAD_OPERATION bad = new BAD_OPERATION("ServiceContext[] expected"); + bad.minor = Minor.Any; + bad.initCause(ex); + throw bad; } } diff --git a/libjava/classpath/org/omg/IOP/TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.java b/libjava/classpath/org/omg/IOP/TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.java new file mode 100644 index 00000000000..e13c759c954 --- /dev/null +++ b/libjava/classpath/org/omg/IOP/TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.java @@ -0,0 +1,61 @@ +/* TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.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.IOP; + +/** + * A single constant interface, defining the + * TAG_RMI_CUSTOM_MAX_STREAM_FORMAT (= 38) tagged component. + * + * This component defines the format that has been used to write the RMI-IIOP + * value type objects in the message. It consists of the single byte, + * having the value of the used version. If this component is missing, + * the default value is assumed to be 1 for GIOP 1.2 and 2 for GIOP 1.3. + * The component can occur only once in the same IOR profile. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface TAG_RMI_CUSTOM_MAX_STREAM_FORMAT +{ + /** + * Specifies the TAG_RMI_CUSTOM_MAX_STREAM_FORMAT value, 38. + */ + int value = 38; +} diff --git a/libjava/classpath/org/omg/IOP/TaggedComponentHelper.java b/libjava/classpath/org/omg/IOP/TaggedComponentHelper.java index 906d6390a36..eaee120f081 100644 --- a/libjava/classpath/org/omg/IOP/TaggedComponentHelper.java +++ b/libjava/classpath/org/omg/IOP/TaggedComponentHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.IOP; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.MARSHAL; @@ -115,6 +117,7 @@ public abstract class TaggedComponentHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("TaggedComponent expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } @@ -149,6 +152,7 @@ public abstract class TaggedComponentHelper catch (IOException e) { MARSHAL m = new MARSHAL(); + m.minor = Minor.Encapsulation; m.initCause(e); throw m; } @@ -175,6 +179,7 @@ public abstract class TaggedComponentHelper catch (IOException e) { MARSHAL m = new MARSHAL(); + m.minor = Minor.Encapsulation; m.initCause(e); throw m; } diff --git a/libjava/classpath/org/omg/IOP/TaggedProfileHelper.java b/libjava/classpath/org/omg/IOP/TaggedProfileHelper.java index a23122eb975..2943657c01f 100644 --- a/libjava/classpath/org/omg/IOP/TaggedProfileHelper.java +++ b/libjava/classpath/org/omg/IOP/TaggedProfileHelper.java @@ -38,8 +38,9 @@ exception statement from your version. */ package org.omg.IOP; -import gnu.CORBA.CDR.cdrBufInput; -import gnu.CORBA.CDR.cdrBufOutput; +import gnu.CORBA.Minor; +import gnu.CORBA.CDR.BufferredCdrInput; +import gnu.CORBA.CDR.BufferedCdrOutput; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -118,6 +119,7 @@ public abstract class TaggedProfileHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("TaggedProfile expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } @@ -143,10 +145,10 @@ public abstract class TaggedProfileHelper TaggedProfile value = new TaggedProfile(); value.tag = input.read_long(); - if (input instanceof cdrBufInput) + if (input instanceof BufferredCdrInput) { // Highly probable. - value.profile_data = ((cdrBufInput) input).read_sequence(); + value.profile_data = ((BufferredCdrInput) input).read_sequence(); } else { @@ -167,7 +169,7 @@ public abstract class TaggedProfileHelper { output.write_long(value.tag); - if (output instanceof cdrBufOutput) + if (output instanceof BufferedCdrOutput) { // Highly probable. output.write_long(value.profile_data.length); @@ -178,6 +180,7 @@ public abstract class TaggedProfileHelper catch (IOException e) { MARSHAL m = new MARSHAL(); + m.minor = Minor.Encapsulation; m.initCause(e); throw m; } diff --git a/libjava/classpath/org/omg/Messaging/SyncScopeHelper.java b/libjava/classpath/org/omg/Messaging/SyncScopeHelper.java index 7d8b412fe5f..1d482c57950 100644 --- a/libjava/classpath/org/omg/Messaging/SyncScopeHelper.java +++ b/libjava/classpath/org/omg/Messaging/SyncScopeHelper.java @@ -38,8 +38,8 @@ exception statement from your version. */ package org.omg.Messaging; -import gnu.CORBA.primitiveTypeCode; -import gnu.CORBA.recordTypeCode; +import gnu.CORBA.typecodes.PrimitiveTypeCode; +import gnu.CORBA.typecodes.RecordTypeCode; import org.omg.CORBA.Any; import org.omg.CORBA.TCKind; @@ -104,10 +104,10 @@ public class SyncScopeHelper */ public static TypeCode type() { - recordTypeCode r = new recordTypeCode(TCKind.tk_alias); + RecordTypeCode r = new RecordTypeCode(TCKind.tk_alias); r.setName("SyncScope"); r.setId(id()); - r.setContentType(new primitiveTypeCode(TCKind.tk_short)); + r.setContentType(new PrimitiveTypeCode(TCKind.tk_short)); return r; } diff --git a/libjava/classpath/org/omg/CORBA/IDLEntity.java b/libjava/classpath/org/omg/PortableInterceptor/ACTIVE.java index 6515d83305b..d7e7e1487e9 100644 --- a/libjava/classpath/org/omg/CORBA/IDLEntity.java +++ b/libjava/classpath/org/omg/PortableInterceptor/ACTIVE.java @@ -1,4 +1,4 @@ -/* IDLEntity.java -- +/* ACTIVE.java -- Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -36,15 +36,20 @@ 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; +package org.omg.PortableInterceptor; /** - * Indicates that this class has a corresponding Helper class. - * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + * A single constant interface, defining the adapter state (ACTIVE) = 1. + * Used with IOR interceptors. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) */ -public interface IDLEntity - extends Serializable +public interface ACTIVE { + /** + * Specifies the ACTIVE value, 1. + */ + short value = 1; } diff --git a/libjava/classpath/org/omg/PortableInterceptor/AdapterManagerIdHelper.java b/libjava/classpath/org/omg/PortableInterceptor/AdapterManagerIdHelper.java new file mode 100644 index 00000000000..f3f7e64416a --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/AdapterManagerIdHelper.java @@ -0,0 +1,119 @@ +/* AdapterManagerIdHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A helper operations for the adapter manager id. An adapter manager id is an + * integer constant and needs no helper, but the one is included anyway. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class AdapterManagerIdHelper +{ + /** + * Create the AdapterManagerId typecode (alias of CORBA long (java int), + * named "AdapterManagerId"). + */ + public static TypeCode type() + { + ORB orb = ORB.init(); + return orb.create_alias_tc(id(), "AdapterManagerId", + orb.get_primitive_tc(TCKind.tk_long) + ); + } + + /** + * Insert the int into the given Any. + */ + public static void insert(Any any, int that) + { + any.insert_long(that); + } + + /** + * Extract the int from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain int. + */ + public static int extract(Any any) + { + return any.extract_long(); + } + + /** + * Get the adapter manager id repository id. + * + * @return "IDL:omg.org/PortableInterceptor/AdapterManagerId:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/AdapterManagerId:1.0"; + } + + /** + * Read the int (adapter manager id) from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static int read(InputStream input) + { + return input.read_long(); + } + + /** + * Write the int (adapter manager id) to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, int value) + { + output.write_long(value); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/AdapterNameHelper.java b/libjava/classpath/org/omg/PortableInterceptor/AdapterNameHelper.java new file mode 100644 index 00000000000..1cda311b23d --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/AdapterNameHelper.java @@ -0,0 +1,144 @@ +/* AdapterNameHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StringSeqHelper; +import org.omg.CORBA.StringSeqHolder; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * Provides static helper methods for working with the adapter name helper. + * The adapter name helper is an array of strings, so {@link StringSeqHelper} + * could be used for io operations. The separate helper is provided anyway. + * + * @since 1.5 + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class AdapterNameHelper +{ + + /** + * The cached typecode, computed once. + */ + static TypeCode typecode; + + /** + * Extract the adapter name (<code>String[]</code>) from the given {@link Any}. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + */ + public static String[] extract(Any a) + { + StringSeqHolder h = (StringSeqHolder) a.extract_Streamable(); + return h.value; + } + + /** + * Returns the agreed Id. + * + * @return "IDL:omg.org/PortableInterceptor/AdapterName:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/AdapterName:1.0"; + } + + /** + * Insert into the given adapter name (<code>String[]</code>) into the + * given {@link Any}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, String[] that) + { + StringSeqHolder holder = new StringSeqHolder(that); + into.insert_Streamable(holder); + into.type(type()); + } + + /** + * Reads the <code>String[]</code> from the CORBA input stream. + * + * @param input the CORBA stream to read from. + * @return the value from the stream. + */ + public static String[] read(InputStream input) + { + return StringSeqHelper.read(input); + } + + /** + * Creates and returns a new instance of the TypeCode, + * corresponding the adapter name. + * + * @return the alias of the string sequence, named "AdapterName". + */ + public static TypeCode type() + { + if (typecode == null) + { + ORB orb = OrbRestricted.Singleton; + + TypeCode component = orb.create_string_tc(0); + typecode = orb.create_alias_tc(id(), "AdapterName", component); + } + return typecode; + } + + /** + * Writes the <code>String[]</code> into the given stream. + * + * @param output the CORBA output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, String[] value) + { + StringSeqHelper.write(output, value); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/AdapterStateHelper.java b/libjava/classpath/org/omg/PortableInterceptor/AdapterStateHelper.java new file mode 100644 index 00000000000..ceb7ac8d52a --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/AdapterStateHelper.java @@ -0,0 +1,119 @@ +/* AdapterStateHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A helper operations for the adapter state. An adapter state is an + * short integer constant and needs no helper, but the one is included anyway. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class AdapterStateHelper +{ + /** + * Create the AdapterState typecode (alias of <code>short</code>, + * named "AdapterState"). + */ + public static TypeCode type() + { + ORB orb = ORB.init(); + return orb.create_alias_tc(id(), "AdapterState", + orb.get_primitive_tc(TCKind.tk_short) + ); + } + + /** + * Insert the <code>short</code> into the given Any. + */ + public static void insert(Any any, short that) + { + any.insert_short(that); + } + + /** + * Extract the <code>short</code> from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain int. + */ + public static short extract(Any any) + { + return any.extract_short(); + } + + /** + * Get the adapter state repository id. + * + * @return "IDL:omg.org/PortableInterceptor/AdapterState:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/AdapterState:1.0"; + } + + /** + * Read the <code>short</code> (adapter state) from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static short read(InputStream input) + { + return input.read_short(); + } + + /** + * Write the <code>short</code> (adapter state) to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, short value) + { + output.write_short(value); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java b/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java index b7a5a541e93..df3bcaef72b 100644 --- a/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java +++ b/libjava/classpath/org/omg/PortableInterceptor/CurrentHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.PortableInterceptor; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_PARAM; import org.omg.CORBA.MARSHAL; @@ -45,6 +47,7 @@ import org.omg.CORBA.ORB; import org.omg.CORBA.TypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; +import org.omg.PortableServer.ServantActivator; /** * The helper operations for the CORBA object {@link Current}. @@ -123,6 +126,25 @@ public abstract class CurrentHelper throw new BAD_PARAM("Not a Current"); } } + + /** + * Narrow the given object to the Current. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted Current. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static Current unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } /** * Not supported for compatibility reasons. @@ -133,7 +155,9 @@ public abstract class CurrentHelper */ public static Current read(InputStream input) { - throw new MARSHAL(); + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; } /** @@ -145,6 +169,8 @@ public abstract class CurrentHelper */ public static void write(OutputStream output, Current value) { - throw new MARSHAL(); + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; } }
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/DISCARDING.java b/libjava/classpath/org/omg/PortableInterceptor/DISCARDING.java new file mode 100644 index 00000000000..bec0c25e0ac --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/DISCARDING.java @@ -0,0 +1,55 @@ +/* DISCARDING.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +/** + * A single constant interface, defining the adapter state (DISCARDING) = 2. + * Used with IOR interceptors. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface DISCARDING +{ + /** + * Specifies the DISCARDING value, 2. + */ + short value = 2; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ForwardRequestHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ForwardRequestHelper.java index 11d6b7f0fd6..5db56d74560 100644 --- a/libjava/classpath/org/omg/PortableInterceptor/ForwardRequestHelper.java +++ b/libjava/classpath/org/omg/PortableInterceptor/ForwardRequestHelper.java @@ -38,6 +38,7 @@ exception statement from your version. */ package org.omg.PortableInterceptor; +import gnu.CORBA.Minor; import gnu.CORBA.Interceptor.ForwardRequestHolder; import org.omg.CORBA.Any; @@ -106,6 +107,7 @@ public abstract class ForwardRequestHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION(id() + " expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableInterceptor/HOLDING.java b/libjava/classpath/org/omg/PortableInterceptor/HOLDING.java new file mode 100644 index 00000000000..ce22a1f6860 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/HOLDING.java @@ -0,0 +1,55 @@ +/* HOLDING.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +/** + * A single constant interface, defining the adapter state (HOLDING) = 0. + * Used with IOR interceptors. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface HOLDING +{ + /** + * Specifies the HOLDING value, 0. + */ + short value = 0; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/INACTIVE.java b/libjava/classpath/org/omg/PortableInterceptor/INACTIVE.java new file mode 100644 index 00000000000..8a5cad1e124 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/INACTIVE.java @@ -0,0 +1,57 @@ +/* INACTIVE.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +/** + * A single constant interface, defining the adapter state (INACTIVE) = 3. + * The adapter is shutting down, and will eventually end up in the + * NON_EXISTENT state. + * Used with IOR interceptors. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface INACTIVE +{ + /** + * Specifies the INACTIVE value, 3. + */ + short value = 3; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/IORInfoOperations.java index 58ef02fb0c0..fdeb2973b8a 100644 --- a/libjava/classpath/org/omg/PortableInterceptor/IORInfoOperations.java +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInfoOperations.java @@ -73,7 +73,7 @@ public interface IORInfoOperations void add_ior_component(TaggedComponent tagged_component); /** - * Get the server side policy for an IOR being constructed. The method returns + * Get the server side policy for an IOR being constructed. The method returns * policies applying for POA where the object, represented by this IOR, is * connected. * @@ -85,4 +85,54 @@ public interface IORInfoOperations * @see org.omg.PortableServer.POAOperations#create_POA */ Policy get_effective_policy(int policy_type); + + /** + * Get the adapter template that is associated with the object POA. + * The template is also a reference factory and can produce the new object + * references. + * + * @since 1.5 + */ + public ObjectReferenceTemplate adapter_template(); + + /** + * The current_factory is the factory, used by the adapter to create + * object references. This factory is initially the same as the + * adapter_template. + * + * @since 1.5 + */ + public ObjectReferenceFactory current_factory(); + + /** + * Set the current object reference factory, used to produce the new objects. + * + * The current factory can only be set during the call to the + * {@link IORInterceptor_3_0Operations#components_established(IORInfo)}. + * + * @since 1.5 + */ + public void current_factory(ObjectReferenceFactory factory); + + /** + * Get the POA manager Id. + * + * @return Id that uniquely refers to the poa manager, used by this POA. + * + * @since 1.5 + * + * @see IORInterceptor_3_0Operations#adapter_manager_state_changed + */ + public int manager_id(); + + /** + * Get the state of the adapter manager. + * + * @since 1.5 + * + * @return the state of the adapters to that the IOR being created belongs. + * One of the {@link HOLDING#value}, {@link DISCARDING#value}, + * {@link INACTIVE#value} or {@link NON_EXISTENT#value}. + */ + short state(); }
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptorOperations.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptorOperations.java index 868fcab6c62..746d139cf6f 100644 --- a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptorOperations.java +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptorOperations.java @@ -47,12 +47,12 @@ package org.omg.PortableInterceptor; public interface IORInterceptorOperations extends InterceptorOperations { /** - * A server side ORB calls this method on all registered IORInterceptor's when + * A server side ORB calls this method on all registered IORInterceptor's when * creating the object reference (IOR). The interceptors have the possibility * to add additional tags to the IOR being created. * - * @param info the interface class providing methods to insert additional tags - * into IOR being constructed. The same instan + * @param info the interface class providing methods to insert additional tags + * into IOR being constructed. */ public void establish_components(IORInfo info); }
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0.java new file mode 100644 index 00000000000..4b2093d40c6 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0.java @@ -0,0 +1,59 @@ +/* IORInterceptor_3_0.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * The IORInterceptor_3_0 adds to {@link Interceptor} functionality, available + * since CORBA 3.0. These new operations are defined separately in + * {@link IORInterceptor_3_0Operations}. + * + * IORInterceptor_3_0 is registered exactly in the same way as the + * {@link IORInterceptor}. The ORB calls the additional methods to all + * IOR interceptors that implement this extended interface. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IORInterceptor_3_0 + extends IORInterceptor_3_0Operations, IDLEntity, IORInterceptor +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java new file mode 100644 index 00000000000..565242477d9 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java @@ -0,0 +1,195 @@ +/* IORInterceptor_3_0Helper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import gnu.CORBA.Minor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.Delegate; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the CORBA object {@link IORInterceptor_3_0}. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class IORInterceptor_3_0Helper +{ + /** + * The cached {@link IORInterceptor_3_0} typecode, computed once. + */ + private static TypeCode typeCode; + + /** + * Get the type code of the {@link IORInterceptor_3_0}. + */ + public static TypeCode type() + { + if (typeCode == null) + typeCode = ORB.init().create_interface_tc(id(), "IORInterceptor_3_0"); + return typeCode; + } + + /** + * Insert the IORInterceptor_3_0 into the given Any. + * + * @param any the Any to insert into. + * @param that the IORInterceptor_3_0 to insert. + */ + public static void insert(Any any, IORInterceptor_3_0 that) + { + any.insert_Streamable(new IORInterceptor_3_0Holder(that)); + } + + /** + * Extract the IORInterceptor_3_0 from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain + * IORInterceptor_3_0. + */ + public static IORInterceptor_3_0 extract(Any any) + { + try + { + IORInterceptor_3_0Holder holder = (IORInterceptor_3_0Holder) + any.extract_Streamable(); + return holder.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("IORInterceptor_3_0 expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the IORInterceptor_3_0 repository id. + * + * @return "IDL:omg.org/PortableInterceptor/IORInterceptor_3_0:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/IORInterceptor_3_0:1.0"; + } + + /** + * Narrow the passed object into the IORInterceptor_3_0. If the object has a + * different java type, create an instance of the _IORInterceptor_3_0Stub, + * using the same delegate, as for the passed parameter. Hence, unlike java + * type cast, this method may return a different object, than has been passed. + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a IORInterceptor_3_0. + */ + public static IORInterceptor_3_0 narrow(org.omg.CORBA.Object obj) + { + if (obj == null) + return null; + else if (obj instanceof IORInterceptor_3_0) + return (IORInterceptor_3_0) obj; + else if (!obj._is_a(id())) + throw new BAD_PARAM("Not a IORInterceptor_3_0"); + else + { + Delegate delegate = ((ObjectImpl) obj)._get_delegate(); + return new _IORInterceptor_3_0Stub(delegate); + } + } + + /** + * Narrow the passed object into the IORInterceptor_3_0. No type-checking is + * performed to verify that the object actually supports the requested type. + * The {@link BAD_OPERATION} will be thrown if unsupported operations are + * invoked on the new returned reference, but no failure is expected at the + * time of the unchecked_narrow. For instance, the narrowing of the + * remote instance of the {@link IORInterceptor} will work as long as only the + * methods, inherited from this parent, are invoked. + * + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a IORInterceptor_3_0. + */ + public static IORInterceptor_3_0 unchecked_narrow(org.omg.CORBA.Object obj) + { + if (obj == null) + return null; + else if (obj instanceof IORInterceptor_3_0) + return (IORInterceptor_3_0) obj; + else + { + Delegate delegate = ((ObjectImpl) obj)._get_delegate(); + return new _IORInterceptor_3_0Stub(delegate); + } + } + + + /** + * Read the IORInterceptor_3_0 from the CDR intput stream (IOR profile + * expected). + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static IORInterceptor_3_0 read(InputStream input) + { + return unchecked_narrow(input.read_Object()); + } + + /** + * Write the IORInterceptor_3_0 to the CDR output stream (as IOR profile). + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, IORInterceptor_3_0 value) + { + output.write_Object(value); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Holder.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Holder.java new file mode 100644 index 00000000000..dc7ecf23faa --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Holder.java @@ -0,0 +1,106 @@ +/* IORInterceptor_3_0Holder.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for the object {@link IORInterceptor_3_0}. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class IORInterceptor_3_0Holder + implements Streamable +{ + /** + * The stored IORInterceptor_3_0 value. + */ + public IORInterceptor_3_0 value; + + /** + * Create the unitialised instance, leaving the value field with default + * <code>null</code> value. + */ + public IORInterceptor_3_0Holder() + { + } + + /** + * Create the initialised instance. + * + * @param initialValue the value that will be assigned to the + * <code>value</code> field. + */ + public IORInterceptor_3_0Holder(IORInterceptor_3_0 initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link value} by data from the CDR stream. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = IORInterceptor_3_0Helper.read(input); + } + + /** + * Write the stored value into the CDR stream. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + IORInterceptor_3_0Helper.write(output, value); + } + + /** + * Get the typecode of the IORInterceptor_3_0. + */ + public org.omg.CORBA.TypeCode _type() + { + return IORInterceptor_3_0Helper.type(); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Operations.java b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Operations.java new file mode 100644 index 00000000000..ce6575a4ce0 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/IORInterceptor_3_0Operations.java @@ -0,0 +1,90 @@ +/* IORInterceptor_3_0Operations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +/** + * Defines the operations, applicable to the IORInterceptor_3_0. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IORInterceptor_3_0Operations + extends IORInterceptorOperations +{ + /** + * This method is invoked on all registered IORInterceptor_3_0 instances when + * the state of the adapter manager changes. + * + * @param adapterManagerId the Id of the adapter manager that has changed the + * state. The same value is returned by + * {@link IORInfoOperations#manager_id()}. + * + * @param adapterState the new state of the adapter manager, one of the + * {@link HOLDING#value}, {@link DISCARDING#value}, {@link INACTIVE#value} + * or {@link NON_EXISTENT#value}. + */ + void adapter_manager_state_changed(int adapterManagerId, short adapterState); + + /** + * Notifies the interceptor about the adapter state changes that are unrelated + * to adapter manager state changes. This method is invoked on all registered + * IORInterceptor_3_0 instances. The only currently possible change of state + * is when POA is destroyed. In this case, the method is invoked passing the + * single element array witn the reference template of the POA being destroyed + * and the {@link NON_EXISTENT#value} state. + * + * @param adapters identifies the object adapters that have changed they + * state. + * @param adaptersState the new state of the adapters, one of the + * {@link HOLDING#value}, {@link DISCARDING#value}, {@link INACTIVE#value} + * or {@link NON_EXISTENT#value}. + */ + void adapter_state_changed(ObjectReferenceTemplate[] adapters, + short adaptersState); + + /** + * This metod is invoked after the + * {@link IORInterceptorOperations#establish_components} have been called on + * all registered interceptor instances. At this stage, it is possible to set + * the object reference factory using + * {@link IORInfo#current_factory(ObjectReferenceFactory )}. + */ + void components_established(IORInfo info); +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/InvalidSlotHelper.java b/libjava/classpath/org/omg/PortableInterceptor/InvalidSlotHelper.java index c0aa0ee1bb4..98b2596771f 100644 --- a/libjava/classpath/org/omg/PortableInterceptor/InvalidSlotHelper.java +++ b/libjava/classpath/org/omg/PortableInterceptor/InvalidSlotHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableInterceptor; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -106,6 +107,7 @@ public abstract class InvalidSlotHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("InvalidSlot expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableInterceptor/NON_EXISTENT.java b/libjava/classpath/org/omg/PortableInterceptor/NON_EXISTENT.java new file mode 100644 index 00000000000..136b64fb008 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/NON_EXISTENT.java @@ -0,0 +1,57 @@ +/* NON_EXISTENT.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +/** + * A single constant interface, defining the adapter state (NON_EXISTENT) = 4. + * NON_EXISTENT does not map directly to a particular POAManager state, but + * indicates that a POA has been destroyed. Used with IOR interceptors. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ + +public interface NON_EXISTENT +{ + /** + * Specifies the NON_EXISTENT value, 4. + */ + short value = 4; +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBIdHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ORBIdHelper.java new file mode 100644 index 00000000000..8332845a662 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBIdHelper.java @@ -0,0 +1,119 @@ +/* ORBIdHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The ORB Id is defined in OMG specification just as a narrow (not wide) + * string. As such, the ORB Id needs no helper, but one is included in + * the API anyway. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ORBIdHelper +{ + /** + * Insert the ORB Id into Any (uses {@link Any.insert_string}). + * + * @param a the Any to insert into. + * @param that the string to insert. + */ + public static void insert(Any a, String that) + { + a.insert_string(that); + } + + /** + * Extract the ORB Id from Any ((uses {@link Any.extract_string}). + * + * @param a the Any to extract from. + */ + public static String extract(Any a) + { + return a.extract_string(); + } + + /** + * Return an alias typecode. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "ORBId", orb.create_string_tc(0)); + } + + /** + * Return the ORB Id repository id. + * @return "IDL:omg.org/PortableInterceptor/ORBId:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ORBId:1.0"; + } + + /** + * Calls {@link InputStream#read_string()}. + * + * @param input the stream to read from. + */ + public static String read(InputStream input) + { + return input.read_string(); + } + + /** + * Calls {@link OutputStream#write_string()}. + * + * @param output the stream to write into. + * @param value the string (ORB Id) value to write. + */ + public static void write(OutputStream output, String value) + { + output.write_string(value); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java index 9cffbe1b551..7b545ff8168 100644 --- a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoOperations.java @@ -55,7 +55,7 @@ public interface ORBInitInfoOperations * * @param interceptor the interceptor to register. * - * @throws DuplicateName if the interceptor name is not an empty string and an + * @throws DuplicateName if the interceptor name is not an empty string and an * interceptor with this name is already registered with the ORB being * created. */ @@ -63,11 +63,14 @@ public interface ORBInitInfoOperations throws DuplicateName; /** - * Register the IOR (object reference) interceptor. - * + * Register the IOR (object reference) interceptor. If the registered + * interceptor implements the extended {@link IORInterceptor_3_0} interface, + * ORB will call its additional methods, defined in the + * {@link IORInterceptor_3_0Operations}. + * * @param interceptor the interceptor to register. - * - * @throws DuplicateName if the interceptor name is not an empty string and an + * + * @throws DuplicateName if the interceptor name is not an empty string and an * interceptor with this name is already registered with the ORB being * created. */ @@ -79,7 +82,7 @@ public interface ORBInitInfoOperations * * @param interceptor the interceptor to register. * - * @throws DuplicateName if the interceptor name is not an empty string and an + * @throws DuplicateName if the interceptor name is not an empty string and an * interceptor with this name is already registered with the ORB being * created. */ @@ -90,7 +93,7 @@ public interface ORBInitInfoOperations * Allocate a slot on a {@link PortableInterceptor.Current}. While slots can * be allocated by this method, they cannot be initialized. * {@link CurrentOperations#get_slot} and {@link CurrentOperations#set_slot} - * throw {@link org.omg.CORBA.BAD_INV_ORDER} while called from the interceptor + * throw {@link org.omg.CORBA.BAD_INV_ORDER} while called from the interceptor * initializer. * * @return the index to the slot that has been allocated. diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHelper.java index a5c83fa80b0..648e9679b42 100644 --- a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHelper.java +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHelper.java @@ -110,6 +110,7 @@ public abstract class DuplicateNameHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("DuplicateName expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java index 7f1132f98a3..f89f9d4c6db 100644 --- a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableInterceptor.ORBInitInfoPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -103,6 +104,7 @@ public abstract class InvalidNameHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("InvalidName expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java index d0946e3fa00..c22d14a11fd 100644 --- a/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java +++ b/libjava/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java @@ -38,7 +38,7 @@ exception statement from your version. */ package org.omg.PortableInterceptor.ORBInitInfoPackage; -import gnu.CORBA.Restricted_ORB; +import gnu.CORBA.OrbRestricted; import org.omg.CORBA.Any; import org.omg.CORBA.ORB; @@ -81,8 +81,8 @@ public class ObjectIdHelper */ public static TypeCode type() { - ORB orb = Restricted_ORB.Singleton; - return orb.create_alias_tc(id(), "Object Id", orb.create_string_tc(0)); + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "ObjectId", orb.create_string_tc(0)); } /** @@ -97,7 +97,7 @@ public class ObjectIdHelper /** * Calls {@link InputStream#read_string()}. * - * @param instream the stream to read from. + * @param input the stream to read from. */ public static String read(InputStream input) { @@ -107,7 +107,7 @@ public class ObjectIdHelper /** * Calls {@link OutputStream#write_string()}. * - * @param ostream the stream to write into. + * @param output the stream to write into. * @param value the string (Object Id) value to write. */ public static void write(OutputStream output, String value) diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectIdHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectIdHelper.java new file mode 100644 index 00000000000..600d0a0fb94 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectIdHelper.java @@ -0,0 +1,121 @@ +/* ObjectIdHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.ORB; +import org.omg.CORBA.OctetSeqHelper; +import org.omg.CORBA.OctetSeqHolder; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The Object Id of this package is defined in OMG specification as a byte array. + * As such, the Object Id needs no helper, but one is included in the API anyway. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectIdHelper +{ + /** + * Insert the Object Id into Any. + * + * @param a the Any to insert into. + * @param that the string to insert. + */ + public static void insert(Any a, byte[] that) + { + a.insert_Streamable(new OctetSeqHolder(that)); + a.type(type()); + } + + /** + * Extract the Object Id from Any. + * + * @param a the Any to extract from. + */ + public static byte[] extract(Any a) + { + return ((OctetSeqHolder) a.extract_Streamable()).value; + } + + /** + * Return an alias typecode (an alias of the octet sequence). + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "ObjectId", OctetSeqHelper.type()); + } + + /** + * Return the Object Id repository id. + * @return "IDL:omg.org/PortableInterceptor/ObjectId:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ObjectId:1.0"; + } + + /** + * Read the Object Id as a byte array. + * + * @param input the stream to read from. + */ + public static byte[] read(InputStream input) + { + return OctetSeqHelper.read(input); + } + + /** + * Write the Object Id as a byte array. + * + * @param output the stream to write into. + * @param value the Object Id value to write. + */ + public static void write(OutputStream output, byte[] value) + { + OctetSeqHelper.write(output, value); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactory.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactory.java new file mode 100644 index 00000000000..55cde585c5e --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactory.java @@ -0,0 +1,57 @@ +/* ObjectReferenceFactory.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * Provides the possibility to create the CORBA object reference. + * The reference is created from repository id (defining the type of the + * object) and the object id (defining the identity of the object). + * The operation for creating reference is defined separately in + * {@link ObjectReferenceFactoryOperations}. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ObjectReferenceFactory + extends ObjectReferenceFactoryOperations, IDLEntity +{ +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java new file mode 100644 index 00000000000..55ee0be18fc --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java @@ -0,0 +1,150 @@ +/* ObjectReferenceFactoryHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import gnu.CORBA.CDR.Vio; +import gnu.CORBA.Minor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.ValueMember; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.VM_ABSTRACT; + +/** + * The helper operations for the CORBA object {@link ObjectReferenceFactory}. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectReferenceFactoryHelper +{ + /** + * The cached {@link ObjectReferenceFactory} typecode, computed once. + */ + private static TypeCode typeCode; + + /** + * Get the type code of the {@link ObjectReferenceFactory}. + * + * @return value type code with the agreed id, named + * "ObjectReferenceFactory", abstract, no members, no base type. + */ + public static TypeCode type() + { + if (typeCode == null) + typeCode = + ORB.init().create_value_tc(id(), "ObjectReferenceFactory", + VM_ABSTRACT.value, null, new ValueMember[ 0 ] + ); + return typeCode; + } + + /** + * Insert the ObjectReferenceFactory into the given Any. + * + * @param any the Any to insert into. + * @param that the ObjectReferenceFactory to insert. + */ + public static void insert(Any any, ObjectReferenceFactory that) + { + ObjectReferenceFactoryHolder h = new ObjectReferenceFactoryHolder(that); + any.insert_Streamable(h); + } + + /** + * Extract the ObjectReferenceFactory from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain ObjectReferenceFactory. + */ + public static ObjectReferenceFactory extract(Any any) + { + try + { + ObjectReferenceFactoryHolder h = + (ObjectReferenceFactoryHolder) (any.extract_Streamable()); + return h.value; + } + catch (ClassCastException ex) + { + BAD_OPERATION bad = + new BAD_OPERATION("ObjectReferenceFactory expected"); + bad.minor = Minor.Any; + bad.initCause(ex); + throw bad; + } + } + + /** + * Get the ObjectReferenceFactory repository id. + * + * @return "IDL:omg.org/PortableInterceptor/ObjectReferenceFactory:1.0", + * always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ObjectReferenceFactory:1.0"; + } + + /** + * Read the ObjectReferenceFactory from the CDR intput stream + * (ValueBase type expected). + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static ObjectReferenceFactory read(InputStream input) + { + return (ObjectReferenceFactory) Vio.read(input); + } + + /** + * Write the ObjectReferenceFactory to the CDR output stream (as a ValueBase). + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, ObjectReferenceFactory value) + { + Vio.write(output, value); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHolder.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHolder.java new file mode 100644 index 00000000000..fc68ec5c148 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryHolder.java @@ -0,0 +1,105 @@ +/* ObjectReferenceFactoryHolder.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * A holder for the object {@link ObjectReferenceFactory}. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class ObjectReferenceFactoryHolder + implements Streamable +{ + /** + * The stored ObjectReferenceFactory value. + */ + public ObjectReferenceFactory value; + + /** + * Create the unitialised instance, leaving the value field + * with default <code>null</code> value. + */ + public ObjectReferenceFactoryHolder() + { + } + + /** + * Create the initialised instance. + * @param initialValue the value that will be assigned to + * the <code>value</code> field. + */ + public ObjectReferenceFactoryHolder(ObjectReferenceFactory initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link value} by data from the CDR stream. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = ObjectReferenceFactoryHelper.read(input); + } + + /** + * Write the stored value into the CDR stream. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + ObjectReferenceFactoryHelper.write(output, value); + } + + /** + * Get the typecode of the ObjectReferenceFactory. + */ + public org.omg.CORBA.TypeCode _type() + { + return ObjectReferenceFactoryHelper.type(); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryOperations.java new file mode 100644 index 00000000000..b5d912d12be --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceFactoryOperations.java @@ -0,0 +1,69 @@ +/* ObjectReferenceFactoryOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.ValueBase; + +/** + * Defines the operations, applicable to the ObjectReferenceFactory. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ObjectReferenceFactoryOperations + extends ValueBase +{ + /** + * Create an object with the given repository and object ids. This interface + * does not specify where and how the returned object must be connected and + * activated. The derived {@link ObjectReferenceTemplate} interface assumes + * the the object must be connected to the POA that is specific to that + * template (name can be obtained). + * + * If the object with this objectId already exists in the given context, it is + * found and returned; the new object is <i>not</i> created. + * + * @param repositoryId the repository id of the object being created, defines + * the type of the object. + * + * @param objectId the byte array, defining the identity of the object. + */ + org.omg.CORBA.Object make_object(String repositoryId, byte[] objectId); +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplate.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplate.java new file mode 100644 index 00000000000..666735e7636 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplate.java @@ -0,0 +1,78 @@ +/* ObjectReferenceTemplate.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.PortableServer.POA; + +/** + * Defines the identity of the portable object adapter ({@link POA}}. The + * adapter name, orb id and server id together uniquely define the identity + * of this adapter. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ObjectReferenceTemplate + extends ObjectReferenceFactory +{ + /** + * Get the name of this adapter. This name can be set by specifying + * the org.omg.CORBA.ORBid property in the ORB.Init(.., Properties). + * The default value includes the hashcode of the ORB instance and hence + * should normally differ for each ORB. + * + * @return the name of adapter, represented in the form of the string array. + */ + String[] adapter_name(); + + /** + * The id of the {@link org.omg.CORBA.ORB} of this adapter. + * + * @return the ORB id, represented in the form of string. + */ + String orb_id(); + + /** + * Get the server id of of this adapter. This name can be set by specifying + * the org.omg.CORBA.ServerId property in the ORB.Init(.., Properties) or + * in the system property. All ORB's on the same jre share the same value. + * + * @return the server id, represented in the form of string. + */ + String server_id(); +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java new file mode 100644 index 00000000000..258a73ae8a1 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java @@ -0,0 +1,144 @@ +/* ObjectReferenceTemplateHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import gnu.CORBA.Minor; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.VM_ABSTRACT; +import org.omg.CORBA.ValueMember; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the CORBA object + * {@link ObjectReferenceTemplate}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectReferenceTemplateHelper +{ + /** + * The cached {@link ObjectReferenceTemplate} typecode, computed once. + */ + private static TypeCode typeCode; + + /** + * Get the type code of the {@link ObjectReferenceTemplate}. + * + * @return value type type code, named ObjectReferenceTemplate, + * no members, abstract. + */ + public static TypeCode type() + { + if (typeCode == null) + typeCode = + ORB.init().create_value_tc(id(), "ObjectReferenceTemplate", + VM_ABSTRACT.value, null, new ValueMember[ 0 ] + ); + return typeCode; + } + + /** + * Insert the ObjectReferenceTemplate into the given Any. + * + * @param any the Any to insert into. + * @param that the ObjectReferenceTemplate to insert. + */ + public static void insert(Any any, ObjectReferenceTemplate that) + { + any.insert_Streamable(new ObjectReferenceTemplateHolder(that)); + } + + /** + * Extract the ObjectReferenceTemplate from given Any. + * + * @throws BAD_OPERATION if the passed Any does not + * contain ObjectReferenceTemplate. + */ + public static ObjectReferenceTemplate extract(Any any) + { + try + { + ObjectReferenceTemplateHolder h = + (ObjectReferenceTemplateHolder) any.extract_Streamable(); + return h.value; + } + catch (ClassCastException ex) + { + BAD_OPERATION bad = + new BAD_OPERATION("ObjectReferenceTemplate expected"); + bad.minor = Minor.Any; + bad.initCause(ex); + throw bad; + } + } + + /** + * Get the ObjectReferenceTemplate repository id. + * + * @return "IDL:omg.org/PortableInterceptor/ObjectReferenceTemplate:1.0", + * always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ObjectReferenceTemplate:1.0"; + } + + /** + * Read the object reference template (as the value type). + */ + public static ObjectReferenceTemplate read(InputStream input) + { + return (ObjectReferenceTemplate) + ((org.omg.CORBA_2_3.portable.InputStream) input).read_value(); + } + + /** + * Write the object reference template (as the value type). + */ + public static void write(OutputStream output, ObjectReferenceTemplate value) + { + ((org.omg.CORBA_2_3.portable.OutputStream) output). + write_value(value); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHolder.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHolder.java new file mode 100644 index 00000000000..9658e1fa718 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateHolder.java @@ -0,0 +1,103 @@ +/* ObjectReferenceTemplateHolder.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.Streamable; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + + /** + * A holder for the object {@link ObjectReferenceTemplate}. + * +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class ObjectReferenceTemplateHolder + implements Streamable +{ + /** + * The stored ObjectReferenceTemplate value. + */ + public ObjectReferenceTemplate value; + + /** + * Create the unitialised instance, leaving the value field + * with default <code>null</code> value. + */ + public ObjectReferenceTemplateHolder() + { + } + + /** + * Create the initialised instance. + * @param initialValue the value that will be assigned to + * the <code>value</code> field. + */ + public ObjectReferenceTemplateHolder(ObjectReferenceTemplate initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link value} by data from the CDR stream. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = ObjectReferenceTemplateHelper .read(input); + } + + /** + * Write the stored value into the CDR stream. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + ObjectReferenceTemplateHelper .write(output, value); + } + + /** + * Get the typecode of the ObjectReferenceTemplate. + */ + public org.omg.CORBA.TypeCode _type() + { + return ObjectReferenceTemplateHelper .type(); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHelper.java new file mode 100644 index 00000000000..c4f09896f97 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHelper.java @@ -0,0 +1,169 @@ +/* ObjectReferenceTemplateSeqHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package org.omg.PortableInterceptor; + +import gnu.CORBA.Minor; +import gnu.CORBA.typecodes.GeneralTypeCode; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * Provides static helper methods for working with the array of object reference + * templates. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectReferenceTemplateSeqHelper +{ + /** + * The type code, computed once. + */ + static TypeCode typecode; + + /** + * Extract the <code>ObjectReferenceTemplate[]</code> from the given + * {@link Any}. This implementation expects the {@link Any} to hold the + * instance of {@link ObjectReferenceTemplateSeqHolder} that is returned by + * {@link Any#extract_Streamable() }. + * + * @param a an Any to extract the array from. + * + * @return the extracted array. + * + * @throws BAD_OPERATION if the Any contains something other than the the + * {@link ObjectReferenceTemplateSeqHolder}. + */ + public static ObjectReferenceTemplate[] extract(Any a) + { + try + { + ObjectReferenceTemplateSeqHolder h = (ObjectReferenceTemplateSeqHolder) + a.extract_Streamable(); + return h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION( + "ObjectReferenceTemplate[] expected"); + bad.initCause(cex); + bad.minor = Minor.Any; + throw bad; + } + } + + /** + * Returns the object reference template sequence repository Id. + * + * @return "IDL:omg.org/PortableInterceptor/ObjectReferenceTemplateSeq:1.0", + * always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ObjectReferenceTemplateSeq:1.0"; + } + + /** + * Insert into the given <code>ObjectReferenceTemplate[]</code> into the + * given {@link Any}. This implementation first creates a + * {@link ObjectReferenceTemplateSeqHolder} and then calls + * {@link Any#insert_Streamable(Streamable)}. + * + * @param into the target Any. + * @param that the array to insert. + */ + public static void insert(Any into, ObjectReferenceTemplate[] that) + { + ObjectReferenceTemplateSeqHolder holder = + new ObjectReferenceTemplateSeqHolder(that); + into.insert_Streamable(holder); + } + + /** + * Reads the <code>ObjectReferenceTemplate[]</code> from the CORBA input + * stream. + * + * @param input the CORBA (not java.io) stream to read from. + * @return the value from the stream. + */ + public static ObjectReferenceTemplate[] read(InputStream input) + { + ObjectReferenceTemplate[] value = + new ObjectReferenceTemplate[input.read_long()]; + for (int i = 0; i < value.length; i++) + value[i] = ObjectReferenceTemplateHelper.read(input); + return value; + } + + /** + * Creates and returns a new instance of the TypeCode, corresponding the CORBA + * <code>ObjectReferenceTemplate[]</code>. The length of the sequence is + * left with the initial value 0. + */ + public static TypeCode type() + { + if (typecode == null) + { + GeneralTypeCode t = new GeneralTypeCode(TCKind.tk_sequence); + t.setId(id()); + t.setLength(0); + t.setContentType(ObjectReferenceTemplateHelper.type()); + typecode = t; + } + return typecode; + } + + /** + * Writes the <code>ObjectReferenceTemplate[]</code> into the given stream. + * + * @param output the CORBA (not java.io) output stream to write. + * @param value the value that must be written. + */ + public static void write(OutputStream output, ObjectReferenceTemplate[] value) + { + output.write_long(value.length); + + for (int i = 0; i < value.length; i++) + ObjectReferenceTemplateHelper.write(output, value[i]); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHolder.java b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHolder.java new file mode 100644 index 00000000000..d16f5cedd9f --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHolder.java @@ -0,0 +1,104 @@ +/* ObjectReferenceTemplateSeqHolder.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.portable.Streamable; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * A holder for the array of {@link ObjectReferenceTemplate}s. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class ObjectReferenceTemplateSeqHolder + implements Streamable +{ + /** + * The stored ObjectReferenceTemplate value. + */ + public ObjectReferenceTemplate[] value; + + /** + * Create the unitialised instance, leaving the value field with default + * <code>null</code> value. + */ + public ObjectReferenceTemplateSeqHolder() + { + } + + /** + * Create the initialised instance. + * + * @param initialValue the value that will be assigned to the + * <code>value</code> field. + */ + public ObjectReferenceTemplateSeqHolder(ObjectReferenceTemplate[] initialValue) + { + value = initialValue; + } + + /** + * Fill in the {@link value} by data from the CDR stream. + * + * @param input the org.omg.CORBA.portable stream to read. + */ + public void _read(InputStream input) + { + value = ObjectReferenceTemplateSeqHelper.read(input); + } + + /** + * Write the stored value into the CDR stream. + * + * @param output the org.omg.CORBA.portable stream to write. + */ + public void _write(OutputStream output) + { + ObjectReferenceTemplateSeqHelper.write(output, value); + } + + /** + * Get the typecode of the ObjectReferenceTemplate. + */ + public org.omg.CORBA.TypeCode _type() + { + return ObjectReferenceTemplateSeqHelper.type(); + } +} diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerIdHelper.java b/libjava/classpath/org/omg/PortableInterceptor/ServerIdHelper.java new file mode 100644 index 00000000000..e4f8fe9c28f --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/ServerIdHelper.java @@ -0,0 +1,119 @@ +/* ServerIdHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.ORB; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The Server Id is defined in OMG specification just as a narrow (not wide) + * string. As such, the Server Id needs no helper, but one is included in + * the API anyway. + * + * @since 1.5 + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ServerIdHelper +{ + /** + * Insert the Server Id into Any (uses {@link Any.insert_string}). + * + * @param a the Any to insert into. + * @param that the string to insert. + */ + public static void insert(Any a, String that) + { + a.insert_string(that); + } + + /** + * Extract the Server Id from Any ((uses {@link Any.extract_string}). + * + * @param a the Any to extract from. + */ + public static String extract(Any a) + { + return a.extract_string(); + } + + /** + * Return an alias typecode. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + return orb.create_alias_tc(id(), "ServerId", orb.create_string_tc(0)); + } + + /** + * Return the Server Id repository id. + * @return "IDL:omg.org/PortableInterceptor/ServerId:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableInterceptor/ServerId:1.0"; + } + + /** + * Calls {@link InputStream#read_string()}. + * + * @param input the stream to read from. + */ + public static String read(InputStream input) + { + return input.read_string(); + } + + /** + * Calls {@link OutputStream#write_string()}. + * + * @param output the stream to write into. + * @param value the string (Server Id) value to write. + */ + public static void write(OutputStream output, String value) + { + output.write_string(value); + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java index 7646253d134..a9ee7d92032 100644 --- a/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java +++ b/libjava/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java @@ -216,7 +216,8 @@ import org.omg.IOP.ServiceContext; * * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) */ -public interface ServerRequestInfoOperations extends RequestInfoOperations +public interface ServerRequestInfoOperations + extends RequestInfoOperations { /** * Allows the interceptor to add service contexts to the request. Such added @@ -231,9 +232,7 @@ public interface ServerRequestInfoOperations extends RequestInfoOperations * @throws BAD_INV_ORDER minor 15 if the context with the same Id already * exists and replace=false. */ - void add_reply_service_context(ServiceContext service_context, - boolean replace - ); + void add_reply_service_context(ServiceContext service_context, boolean replace); /** * Get the identifier for the object adapter (POA). @@ -257,14 +256,15 @@ public interface ServerRequestInfoOperations extends RequestInfoOperations * @throws INV_POLICY minor 2 if no factory was registered to produce this * type of policy or the policy is otherwise invalid. */ - Policy get_server_policy(int type) throws INV_POLICY; + Policy get_server_policy(int type) + throws INV_POLICY; /** * Get the exception to be returned to the client. If the returned Any cannot * not support holding of that exception, it holds * {@link org.omg.CORBA.UNKNOWN} minor 1 instead. * - * @return an Any, holding exception that has been thrown and will be returned + * @return an Any, holding exception that has been thrown and will be returned * to client. */ Any sending_exception(); @@ -281,7 +281,8 @@ public interface ServerRequestInfoOperations extends RequestInfoOperations * @see RequestInfoOperations#get_slot(int) * @see org.omg.PortableInterceptor#Current */ - void set_slot(int id, Any data) throws InvalidSlot; + void set_slot(int id, Any data) + throws InvalidSlot; /** * Checks if the servant is the given repository id. @@ -299,4 +300,27 @@ public interface ServerRequestInfoOperations extends RequestInfoOperations * @return the repository id of the servant. */ String target_most_derived_interface(); + + /** + * Returns the name of the adapter that is handling the current request. + * The name is returned as a string array, representing full path from + * the root poa till the current poa, for instance + * {"RootPOA", "childPOA","grandchildPOA"}. + */ + public String[] adapter_name(); + + /** + * Returns the id of the ORB that is handling the current request. The ORB + * id can be specified as the property org.omg.CORBA.ORBid when creating + * the ORB. + */ + public String orb_id(); + + /** + * Returs the id of the server that is handling the current request. The server + * id is the same for all POAs and ORBs in the current virtual machine and + * can be set as the property org.omg.CORBA.ServerId when creating one of the + * ORBs. + */ + public String server_id(); }
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableInterceptor/_IORInterceptor_3_0Stub.java b/libjava/classpath/org/omg/PortableInterceptor/_IORInterceptor_3_0Stub.java new file mode 100644 index 00000000000..52856407a54 --- /dev/null +++ b/libjava/classpath/org/omg/PortableInterceptor/_IORInterceptor_3_0Stub.java @@ -0,0 +1,272 @@ +/* _IORInterceptor_3_0Stub.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableInterceptor; + +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.Delegate; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; + +import java.io.Serializable; + +/** + * The IORInterceptor_3_0 stub (proxy), used on the client side. The + * {@link IORInterceptor_3_0} methods contain the code for remote invocaton. The + * stub is required by {@link IORInterceptor_3_0Helper} .read, .narrow and + * .unchecked_narrow methods. + * + * @specnote Being not specified in 1.5 API, this class is package private. + * From that happened to some other stubs, it will likely to appear in the 1.6 + * or later. Because of this, it is placed here. + * + * @specnote The stub and the helper support the existence of the interceptor + * on the remote side only. To support the corresponding support on the side + * where the ORB is registered with this interceptor, you also need + * _IORInfoStub, IORInfoHelper and either servants or implementation bases + * for both POA and IORInfo. These classes are not defined in the 1.5 API, + * hence they are not included. You may need to generate the manually from + * the IDL descriptions, available from + * http://www.omg.org/docs/formal/04-03-12.pdf. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +class _IORInterceptor_3_0Stub + extends ObjectImpl + implements IORInterceptor_3_0, Serializable +{ + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1; + + /** + * Create the IORInterceptor_3_0 stub. To get the stub working, you must later + * set the delegate with {@link ObjectImpl#_set_delegate(Delegate)}. + */ + public _IORInterceptor_3_0Stub() + { + } + + /** + * Create the naming context stub with the given delegate. + */ + public _IORInterceptor_3_0Stub(Delegate delegate) + { + _set_delegate(delegate); + } + + /** + * Return the array of repository ids for this object. + */ + public String[] _ids() + { + return new String[] { IORInterceptor_3_0Helper.id() }; + } + + /** {@inheritDoc} */ + public void adapter_manager_state_changed(int adapterManagerId, + short adapterState) + { + InputStream input = null; + try + { + OutputStream output = _request("adapter_manager_state_changed", true); + output.write_long(adapterManagerId); + output.write_short(adapterState); + input = _invoke(output); + + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + adapter_manager_state_changed(adapterManagerId, adapterState); + } + finally + { + _releaseReply(input); + } + } + + /** {@inheritDoc} */ + public void adapter_state_changed(ObjectReferenceTemplate[] adapters, + short adaptersState) + { + InputStream input = null; + try + { + OutputStream output = _request("adapter_state_changed", true); + output.write_long(adapters.length); + for (int i0 = 0; i0 < adapters.length; i0++) + ObjectReferenceTemplateHelper.write(output, adapters[i0]); + output.write_short(adaptersState); + input = _invoke(output); + + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + adapter_state_changed(adapters, adaptersState); + } + finally + { + _releaseReply(input); + } + } + + /** {@inheritDoc} */ + public void components_established(IORInfo info) + { + InputStream input = null; + try + { + OutputStream output = _request("components_established", true); + output.write_Object(info); + input = _invoke(output); + + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + components_established(info); + } + finally + { + _releaseReply(input); + } + } + + /** {@inheritDoc} */ + public void establish_components(IORInfo info) + { + InputStream input = null; + try + { + OutputStream output = _request("establish_components", true); + output.write_Object(info); + input = _invoke(output); + + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + establish_components(info); + } + finally + { + _releaseReply(input); + } + } + + /** {@inheritDoc} */ + public String name() + { + InputStream input = null; + try + { + OutputStream output = _request("name", true); + input = _invoke(output); + String returns = input.read_string(); + + return returns; + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + return name(); + } + finally + { + _releaseReply(input); + } + } + + /** {@inheritDoc} */ + public void destroy() + { + InputStream input = null; + try + { + OutputStream output = _request("destroy", true); + input = _invoke(output); + + } + catch (ApplicationException ex) + { + input = ex.getInputStream(); + String id = ex.getId(); + throw new MARSHAL(id); + } + catch (RemarshalException remarsh) + { + destroy(); + } + finally + { + _releaseReply(input); + } + } +}
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContextHelper.java b/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContextHelper.java index 0ba6352001f..848a3c3d3f6 100644 --- a/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContextHelper.java +++ b/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContextHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableServer.CurrentPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -105,6 +106,7 @@ public abstract class NoContextHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("NoContext expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java b/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java index 6f8d5ea6bf3..f4b0619b017 100644 --- a/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java +++ b/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java @@ -38,6 +38,7 @@ exception statement from your version. */ package org.omg.PortableServer; +import gnu.CORBA.Minor; import gnu.CORBA.Poa.ForwardRequestHolder; import org.omg.CORBA.Any; @@ -80,6 +81,7 @@ public abstract class ForwardRequestHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("ForwardRequest expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyValue.java b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyValue.java index 2dda0ef2b61..ac81d389cdd 100644 --- a/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyValue.java +++ b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyValue.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.PortableServer; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.portable.IDLEntity; @@ -129,7 +131,9 @@ public class IdAssignmentPolicyValue } catch (ArrayIndexOutOfBoundsException ex) { - throw new BAD_OPERATION("Invalid enumeration code " + code); + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; } } diff --git a/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyValue.java b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyValue.java index d0992d9dbe2..c0f281249b0 100644 --- a/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyValue.java +++ b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyValue.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.PortableServer; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.portable.IDLEntity; @@ -129,7 +131,9 @@ public class IdUniquenessPolicyValue } catch (ArrayIndexOutOfBoundsException ex) { - throw new BAD_OPERATION("Invalid enumeration code " + code); + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; } } diff --git a/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyValue.java b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyValue.java index 8d2913bf66f..9d81d5fab81 100644 --- a/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyValue.java +++ b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyValue.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.PortableServer; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.portable.IDLEntity; @@ -129,7 +131,9 @@ public class ImplicitActivationPolicyValue } catch (ArrayIndexOutOfBoundsException ex) { - throw new BAD_OPERATION("Invalid enumeration code " + code); + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; } } diff --git a/libjava/classpath/org/omg/PortableServer/LifespanPolicyValue.java b/libjava/classpath/org/omg/PortableServer/LifespanPolicyValue.java index 1e046c4e941..117eb5a3c9e 100644 --- a/libjava/classpath/org/omg/PortableServer/LifespanPolicyValue.java +++ b/libjava/classpath/org/omg/PortableServer/LifespanPolicyValue.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.PortableServer; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.portable.IDLEntity; @@ -126,7 +128,9 @@ public class LifespanPolicyValue } catch (ArrayIndexOutOfBoundsException ex) { - throw new BAD_OPERATION("Invalid enumeration code " + code); + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; } } diff --git a/libjava/classpath/org/omg/PortableServer/POAHelper.java b/libjava/classpath/org/omg/PortableServer/POAHelper.java index 2928d9f0737..3712da00d69 100644 --- a/libjava/classpath/org/omg/PortableServer/POAHelper.java +++ b/libjava/classpath/org/omg/PortableServer/POAHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.PortableServer; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_PARAM; import org.omg.CORBA.TypeCode; import org.omg.CORBA.ORB; @@ -126,7 +128,9 @@ public abstract class POAHelper */ public static POA read(InputStream input) { - throw new MARSHAL("Not applicable"); + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; } /** @@ -142,6 +146,8 @@ public abstract class POAHelper */ public static void write(OutputStream output, POA value) { - throw new MARSHAL("Not applicable"); + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; } }
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java index db7b965bbad..2a587a4126b 100644 --- a/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java +++ b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableServer.POAManagerPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -106,6 +107,7 @@ public abstract class AdapterInactiveHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("AdapterInactive expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/POAManagerPackage/State.java b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/State.java index 536189a0ce2..9e856098b0b 100644 --- a/libjava/classpath/org/omg/PortableServer/POAManagerPackage/State.java +++ b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/State.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.PortableServer.POAManagerPackage; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.portable.IDLEntity; @@ -140,7 +142,7 @@ public class State /** * Returns the State, matching the given integer constant. - * + * * @param code one of _HOLDING, _ACTIVE, _DISCARDING, _INACTIVE. * @return one of HOLDING, ACTIVE, DISCARDING, INACTIVE. * @throws BAD_PARAM if the parameter is not one of the valid values. @@ -149,16 +151,19 @@ public class State { try { - return enume [ code ]; + return enume[code]; } catch (ArrayIndexOutOfBoundsException ex) { - throw new BAD_OPERATION("Invalid enumeration code " + code); + BAD_OPERATION bad = new BAD_OPERATION("Invalid state " + code); + bad.minor = Minor.Enumeration; + throw bad; } } /** * Returns a short string representation. + * * @return the name of the current enumeration value. */ public String toString() diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java index 3ffee4ff85a..61a41089191 100644 --- a/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableServer.POAPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -107,6 +108,7 @@ public abstract class AdapterAlreadyExistsHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("AdapterAlreadyExists expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java index f05daec3d83..dd318bf09cb 100644 --- a/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableServer.POAPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -106,6 +107,7 @@ public abstract class AdapterNonExistentHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("AdapterNonExistent expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.java index 15aa62d8201..5e9e627c73f 100644 --- a/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.java +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.java @@ -38,6 +38,7 @@ exception statement from your version. */ package org.omg.PortableServer.POAPackage; +import gnu.CORBA.Minor; import gnu.CORBA.Poa.InvalidPolicyHolder; import org.omg.CORBA.Any; @@ -110,6 +111,7 @@ public abstract class InvalidPolicyHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("InvalidPolicy expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java index 26b21ce6c10..fd2c189fc14 100644 --- a/libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableServer.POAPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -106,6 +107,7 @@ public abstract class NoServantHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("NoServant expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java index 99891dbe5c3..011867473ee 100644 --- a/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableServer.POAPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -107,6 +108,7 @@ public abstract class ObjectAlreadyActiveHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("ObjectAlreadyActive expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java index 867d5f4f641..0d8ff473cf3 100644 --- a/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableServer.POAPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -106,6 +107,7 @@ public abstract class ObjectNotActiveHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("ObjectNotActive expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java index 0db0e938b69..a74e674012a 100644 --- a/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableServer.POAPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -107,6 +108,7 @@ public abstract class ServantAlreadyActiveHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("ServantAlreadyActive expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java index 429421853ba..5fb52cf35b1 100644 --- a/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableServer.POAPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -106,6 +107,7 @@ public abstract class ServantNotActiveHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("ServantNotActive expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapterHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapterHelper.java index ebba304a536..cd862b0814b 100644 --- a/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapterHelper.java +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapterHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableServer.POAPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -106,6 +107,7 @@ public abstract class WrongAdapterHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("WrongAdapter expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java index 5460d0ea79d..a1f27cbb0eb 100644 --- a/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.PortableServer.POAPackage; import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; @@ -106,6 +107,7 @@ public abstract class WrongPolicyHelper catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("WrongPolicy expected"); + bad.minor = Minor.Any; bad.initCause(cex); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyValue.java b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyValue.java index 139010c86e8..0b1ce4d0bfa 100644 --- a/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyValue.java +++ b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyValue.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.PortableServer; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.portable.IDLEntity; @@ -151,7 +153,9 @@ public class RequestProcessingPolicyValue } catch (ArrayIndexOutOfBoundsException ex) { - throw new BAD_OPERATION("Invalid enumeration code " + code); + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; } } diff --git a/libjava/classpath/org/omg/PortableServer/Servant.java b/libjava/classpath/org/omg/PortableServer/Servant.java index 745fc8a7ed4..5c99ee1a0e3 100644 --- a/libjava/classpath/org/omg/PortableServer/Servant.java +++ b/libjava/classpath/org/omg/PortableServer/Servant.java @@ -45,6 +45,8 @@ import org.omg.CORBA.ORB; import org.omg.PortableServer.POAPackage.ServantNotActive; import org.omg.PortableServer.POAPackage.WrongPolicy; import org.omg.PortableServer.portable.Delegate; + +import gnu.CORBA.Minor; import gnu.CORBA.Poa.ORB_1_4; import gnu.CORBA.Poa.gnuPOA; @@ -239,6 +241,7 @@ public abstract class Servant catch (WrongPolicy unexp) { BAD_OPERATION bad = new BAD_OPERATION(); + bad.minor = Minor.Policy; bad.initCause(unexp); throw bad; } @@ -253,6 +256,7 @@ public abstract class Servant unexp.initCause(ex); BAD_OPERATION bad = new BAD_OPERATION(); + bad.minor = Minor.Activation; bad.initCause(unexp); throw bad; } diff --git a/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java b/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java index 1aab99cee4c..8aa58b2f627 100644 --- a/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java +++ b/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java @@ -38,7 +38,10 @@ exception statement from your version. */ package org.omg.PortableServer; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.BAD_PARAM; import org.omg.CORBA.MARSHAL; import org.omg.CORBA.ORB; @@ -112,6 +115,26 @@ public abstract class ServantActivatorHelper throw bad; } } + + /** + * Narrow the given object to the ServantActivator. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted ServantActivator. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static ServantActivator unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + /** * This should read the servant activator, but it cannot be transferred @@ -125,7 +148,9 @@ public abstract class ServantActivatorHelper */ public static ServantActivator read(InputStream input) { - throw new MARSHAL(); + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; } /** @@ -140,6 +165,8 @@ public abstract class ServantActivatorHelper */ public static void write(OutputStream output, ServantActivator value) { - throw new MARSHAL(); + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; } }
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java b/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java index 984abdffe69..082c4c586ee 100644 --- a/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java +++ b/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.PortableServer; +import gnu.CORBA.Minor; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.MARSHAL; @@ -108,10 +110,30 @@ public abstract class ServantLocatorHelper catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION(); + bad.minor = Minor.ClassCast; bad.initCause(ex); throw bad; } } + + /** + * Narrow the given object to the ServantLocator. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). + * + * @param obj the object to cast. + * + * @return the casted ServantLocator. + * + * @since 1.5 + * + * @see OMG issue 4158. + */ + public static ServantLocator unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } /** * This should read the servant locator, but it cannot be transferred @@ -125,7 +147,9 @@ public abstract class ServantLocatorHelper */ public static ServantLocator read(InputStream input) { - throw new MARSHAL(); + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; } /** @@ -140,6 +164,8 @@ public abstract class ServantLocatorHelper */ public static void write(OutputStream output, ServantLocator value) { - throw new MARSHAL(); + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; } }
\ No newline at end of file diff --git a/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyValue.java b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyValue.java index caf8132e638..0b6ecf62fe1 100644 --- a/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyValue.java +++ b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyValue.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.PortableServer; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.portable.IDLEntity; @@ -126,7 +128,9 @@ public class ServantRetentionPolicyValue } catch (ArrayIndexOutOfBoundsException ex) { - throw new BAD_OPERATION("Invalid enumeration code " + code); + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; } } diff --git a/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java b/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java index c7d4d636726..5c771a7d624 100644 --- a/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java +++ b/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java @@ -38,6 +38,8 @@ exception statement from your version. */ package org.omg.PortableServer; +import gnu.CORBA.Minor; + import org.omg.CORBA.BAD_OPERATION; import org.omg.CORBA.portable.IDLEntity; @@ -139,7 +141,9 @@ public class ThreadPolicyValue } catch (ArrayIndexOutOfBoundsException ex) { - throw new BAD_OPERATION("Invalid enumeration code " + code); + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; } } |