diff options
Diffstat (limited to 'org/omg/CORBA')
-rw-r--r-- | org/omg/CORBA/Any.java | 12 | ||||
-rw-r--r-- | org/omg/CORBA/ORB.java | 4 | ||||
-rw-r--r-- | org/omg/CORBA/ObjectHelper.java | 7 | ||||
-rw-r--r-- | org/omg/CORBA/ObjectHolder.java | 17 | ||||
-rw-r--r-- | org/omg/CORBA/TypeCode.java | 66 |
5 files changed, 61 insertions, 45 deletions
diff --git a/org/omg/CORBA/Any.java b/org/omg/CORBA/Any.java index d8c892d21..1e72709d2 100644 --- a/org/omg/CORBA/Any.java +++ b/org/omg/CORBA/Any.java @@ -51,7 +51,7 @@ import org.omg.CORBA.portable.IDLEntity; public abstract class Any implements Serializable, IDLEntity { - /** + /** * Using v 1.4 serialVersionUID for interoperability. */ private static final long serialVersionUID = 1217179597823814463L; @@ -312,12 +312,18 @@ public abstract class Any public abstract void insert_TypeCode(TypeCode typecode); /** - * Insert the CORBA <code>Value</code> into this <code>Any</code> + * Insert the CORBA <code>Value</code> into this <code>Any</code>. + * + * The type of the Any should be set (by {@link #type(TypeCode)}) + * before inserting the value. */ public abstract void insert_Value(Serializable x, TypeCode typecode); /** - * Insert the CORBA <code>Value</code> into this <code>Any</code> + * Insert the CORBA <code>Value</code> into this <code>Any</code>. + * + * The type of the Any should be set (by {@link #type(TypeCode)}) + * before inserting the value. */ public abstract void insert_Value(Serializable x); diff --git a/org/omg/CORBA/ORB.java b/org/omg/CORBA/ORB.java index 6a53ccc11..772642e93 100644 --- a/org/omg/CORBA/ORB.java +++ b/org/omg/CORBA/ORB.java @@ -881,6 +881,10 @@ public abstract class ORB * <td>Encodes/decodes IDL data types into/from byte arrays.</td> * </tr> * + * <tr><td>DynAnyFactory</td><td>{@link org.omg.DynamicAny.DynAnyFactory}</td> + * <td>Creates DynAny's.</td> + * </tr> + * * </table> * * @param name the object name. diff --git a/org/omg/CORBA/ObjectHelper.java b/org/omg/CORBA/ObjectHelper.java index 0e0efa51e..1324c621f 100644 --- a/org/omg/CORBA/ObjectHelper.java +++ b/org/omg/CORBA/ObjectHelper.java @@ -50,10 +50,7 @@ import org.omg.CORBA.portable.OutputStream; */ public abstract class ObjectHelper { - /** - * The cached binding list type code. - */ - private static TypeCode typeCode = new primitiveTypeCode(TCKind.tk_objref); + static TypeCode typeCode; /** * Extract the array of object from the given {@link Any}. @@ -100,6 +97,8 @@ public abstract class ObjectHelper */ public static TypeCode type() { + if (typeCode == null) + typeCode = ORB.init().get_primitive_tc(TCKind.tk_objref); return typeCode; } diff --git a/org/omg/CORBA/ObjectHolder.java b/org/omg/CORBA/ObjectHolder.java index 02526bee1..27ae67416 100644 --- a/org/omg/CORBA/ObjectHolder.java +++ b/org/omg/CORBA/ObjectHolder.java @@ -39,6 +39,7 @@ exception statement from your version. */ package org.omg.CORBA; import gnu.CORBA.primitiveTypeCode; +import gnu.CORBA.recordTypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; @@ -59,10 +60,16 @@ public final class ObjectHolder implements Streamable { /** - * The default type code for this holder. + * The default type code for this holder if the object type code with + * the zero length string as id. */ - private static final TypeCode t_object = - new primitiveTypeCode(TCKind.tk_objref); + private static final recordTypeCode t_object; + + static + { + t_object = new recordTypeCode(TCKind.tk_objref); + t_object.setId(""); + } /** * The <code>org.omg.CORBA.Object</code> (CORBA <code>Object</code>) value, @@ -109,7 +116,7 @@ public final class ObjectHolder */ public TypeCode _type() { - return t_object; + return ObjectHelper.type(); } /** @@ -124,4 +131,4 @@ public final class ObjectHolder { output.write_Object(value); } -} +}
\ No newline at end of file diff --git a/org/omg/CORBA/TypeCode.java b/org/omg/CORBA/TypeCode.java index 38fb0564f..a1ad3db9e 100644 --- a/org/omg/CORBA/TypeCode.java +++ b/org/omg/CORBA/TypeCode.java @@ -38,11 +38,11 @@ exception statement from your version. */ package org.omg.CORBA; -import java.io.Serializable; - import org.omg.CORBA.TypeCodePackage.BadKind; import org.omg.CORBA.portable.IDLEntity; +import java.io.Serializable; + /** * An information about a CORBA data type. * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) @@ -57,10 +57,12 @@ public abstract class TypeCode private static final long serialVersionUID = -6521025782489515676L; /** - * Returns the concrete base type for this TypeCode. - * @return a TypeCode, defining the concrete base type for this - * Typecode. - * @throws org.omg.CORBA.TypeCodePackage.BadKind + * For value types that support inheritance this method returns the + * of the ancestor type code. + * + * @return the ancestor TypeCode. + * + * @throws BadKind for all typecodes except the value type typecodes. */ public abstract TypeCode concrete_base_type() throws BadKind; @@ -69,7 +71,7 @@ public abstract class TypeCode * For sequences, arrays, aliases and value boxes, returns the IDL type for * the members of the object. * @return a TypeCode of the memebers of this type. - * @throws org.omg.CORBA.TypeCodePackage.BadKind for types other than + * @throws BadKind for types other than * sequences, arrays, aliases and value boxes. */ public abstract TypeCode content_type() @@ -79,7 +81,7 @@ public abstract class TypeCode * For unions, returs the index of the default member. * @return the index of the default member, -1 if there is * no default member. - * @throws org.omg.CORBA.TypeCodePackage.BadKind if this type is not + * @throws BadKind if this type is not * a union. */ public abstract int default_index() @@ -88,15 +90,15 @@ public abstract class TypeCode /** * Returs definition of member labels for untions * @return a TypeCode, describing all non-default member labels. - * @throws org.omg.CORBA.TypeCodePackage.BadKind if this type is not a + * @throws BadKind if this type is not a * union. */ public abstract TypeCode discriminator_type() throws BadKind; /** - * Test two types for equality. The default implementation - * returs true of the types of the same kind. + * Test two types for equality. + * * @param other the other type to compere with * @return true if the types are interchangeable. */ @@ -112,7 +114,7 @@ public abstract class TypeCode /** * For the fixed type, returns the number of digits. * @return the number of digits for the fixed type - * @throws org.omg.CORBA.TypeCodePackage.BadKind if this is not a fixed + * @throws BadKind if this is not a fixed * type. */ public abstract short fixed_digits() @@ -123,7 +125,7 @@ public abstract class TypeCode * positive (the number of digits to the right of the decimal point) or * negative (adds zeros to the left of the decimal point). * @return the scale. - * @throws org.omg.CORBA.TypeCodePackage.BadKind if this is not a fixed + * @throws BadKind if this is not a fixed * type. */ public abstract short fixed_scale() @@ -140,7 +142,7 @@ public abstract class TypeCode * Returns the RepositoryId globally identifying the type, defined by * this TypeCode. * @return tje RepositoryId. In some cases, it may be an empty string. - * @throws org.omg.CORBA.TypeCodePackage.BadKind if the type is other than + * @throws BadKind if the type is other than * reference, structure, union, enumeration, alias, exception, valuetype, * boxed valuetype and also native and abstract interfaces. */ @@ -161,7 +163,7 @@ public abstract class TypeCode * * @return length or bound * - * @throws org.omg.CORBA.TypeCodePackage.BadKind for types other than + * @throws BadKind for types other than * string, sequence and array. */ public abstract int length() @@ -171,7 +173,7 @@ public abstract class TypeCode * Returns the number of type memebers. * * @return the number of memebers - * @throws org.omg.CORBA.TypeCodePackage.BadKind for types other than + * @throws BadKind for types other than * structure, union, enumeration or exception. */ public abstract int member_count() @@ -185,14 +187,14 @@ public abstract class TypeCode * * @return the label * - * @throws org.omg.CORBA.TypeCodePackage.BadKind if this is not a union + * @throws BadKind if this is not a union * type. * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is out of * valid bounds. */ public abstract Any member_label(int index) - throws BadKind, - org.omg.CORBA.TypeCodePackage.Bounds; + throws BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; /** * Retrieves the simple name of the member identified by the given index. @@ -201,14 +203,14 @@ public abstract class TypeCode * * @return the member name that in some cases can be an empty string. * - * @throws org.omg.CORBA.TypeCodePackage.BadKind for types other than + * @throws BadKind for types other than * structure, union or enumeration. * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is out of * valid bounds. */ public abstract String member_name(int index) - throws BadKind, - org.omg.CORBA.TypeCodePackage.Bounds; + throws BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; /** * Retrieves the member type of the member identified by the given index. @@ -217,14 +219,14 @@ public abstract class TypeCode * * @return the member type. * - * @throws org.omg.CORBA.TypeCodePackage.BadKind for types other than + * @throws BadKind for types other than * structure, union, enumeration or exception. * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is out of * valid bounds. */ public abstract TypeCode member_type(int index) - throws BadKind, - org.omg.CORBA.TypeCodePackage.Bounds; + throws BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; /** * Returns the visibility scope of the member at the given index. @@ -234,22 +236,21 @@ public abstract class TypeCode * * @return either PRIVATE_MEMBER.value or PUBLIC_MEMBER.value * - * @throws org.omg.CORBA.TypeCodePackage.BadKind if this is not a non boxed + * @throws BadKind if this is not a non boxed * value type. * * @throws org.omg.CORBA.TypeCodePackage.Bounds if the index is out of * valid bounds. */ public abstract short member_visibility(int index) - throws BadKind, - org.omg.CORBA.TypeCodePackage.Bounds; - + throws BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; /** * Retrieves the simple name identifying this TypeCode object * within its enclosing scope. * @return the name, can be an empty string. - * @throws org.omg.CORBA.TypeCodePackage.BadKind for typer other than + * @throws BadKind for typer other than * reference, structure, union, enumeration, alias, exception, * valuetype, boxed valuetype, native, and abstract interface */ @@ -263,9 +264,8 @@ public abstract class TypeCode * VM_NONE.value, VM_ABSTRACT.value, VM_CUSTOM.value, or * VM_TRUNCATABLE.value, * - * @throws org.omg.CORBA.TypeCodePackage.BadKind for types other than - * value type. + * @throws BadKind for all types other than value type. */ public abstract short type_modifier() throws BadKind; -} +}
\ No newline at end of file |