diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-23 21:31:04 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-23 21:31:04 +0000 |
| commit | 947b8814056ea2fba6bbcfab86591f74bffc0311 (patch) | |
| tree | 3ca4b2e68dc14c3128b9c781d23f1d0b1f2bee49 /libjava/classpath/org/omg/IOP | |
| parent | 49792907376493f0939563eb0219b96a48f1ae3b (diff) | |
| download | ppe42-gcc-947b8814056ea2fba6bbcfab86591f74bffc0311.tar.gz ppe42-gcc-947b8814056ea2fba6bbcfab86591f74bffc0311.zip | |
Imported Classpath 0.18.
* sources.am, Makefile.in: Updated.
* Makefile.am (nat_source_files): Removed natProxy.cc.
* java/lang/reflect/natProxy.cc: Removed.
* gnu/classpath/jdwp/VMFrame.java,
gnu/classpath/jdwp/VMIdManager.java,
gnu/classpath/jdwp/VMVirtualMachine.java,
java/lang/reflect/VMProxy.java: New files.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* scripts/makemake.tcl (verbose): Add gnu/java/awt/peer/qt to BC
list.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/net/DefaultContentHandlerFactory.java (getContent):
Remove ClasspathToolkit references.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/awt/xlib/XCanvasPeer.java: Add new peer methods.
* gnu/awt/xlib/XFramePeer.java: Likewise.
* gnu/awt/xlib/XGraphicsConfiguration.java: Likewise.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* Makefile.am (libgcjawt_la_SOURCES): Remove jawt.c. Add
classpath/native/jawt/jawt.c.
* Makefile.in: Regenerate.
* jawt.c: Remove file.
* include/Makefile.am (tool_include__HEADERS): Remove jawt.h and
jawt_md.h. Add ../classpath/include/jawt.h and
../classpath/include/jawt_md.h.
* include/Makefile.in: Regenerate.
* include/jawt.h: Regenerate.
* include/jawt_md.h: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104586 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/org/omg/IOP')
| -rw-r--r-- | libjava/classpath/org/omg/IOP/ServiceContext.java | 2 | ||||
| -rw-r--r-- | libjava/classpath/org/omg/IOP/TaggedComponentHelper.java | 89 | ||||
| -rw-r--r-- | libjava/classpath/org/omg/IOP/TaggedProfileHelper.java | 93 |
3 files changed, 115 insertions, 69 deletions
diff --git a/libjava/classpath/org/omg/IOP/ServiceContext.java b/libjava/classpath/org/omg/IOP/ServiceContext.java index 0dcd7781e26..e011a4e9e57 100644 --- a/libjava/classpath/org/omg/IOP/ServiceContext.java +++ b/libjava/classpath/org/omg/IOP/ServiceContext.java @@ -55,7 +55,7 @@ import java.io.Serializable; * * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) */ -public class ServiceContext +public final class ServiceContext implements IDLEntity, Serializable { /** diff --git a/libjava/classpath/org/omg/IOP/TaggedComponentHelper.java b/libjava/classpath/org/omg/IOP/TaggedComponentHelper.java index f432165429f..906d6390a36 100644 --- a/libjava/classpath/org/omg/IOP/TaggedComponentHelper.java +++ b/libjava/classpath/org/omg/IOP/TaggedComponentHelper.java @@ -40,6 +40,7 @@ package org.omg.IOP; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.MARSHAL; import org.omg.CORBA.ORB; import org.omg.CORBA.StructMember; import org.omg.CORBA.TCKind; @@ -47,11 +48,13 @@ import org.omg.CORBA.TypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; +import java.io.IOException; + /** -* A helper operations for the {@link TaggedComponent}. -* -* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) -*/ + * A helper operations for the {@link TaggedComponent}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ public abstract class TaggedComponentHelper { /** @@ -60,49 +63,46 @@ public abstract class TaggedComponentHelper private static TypeCode typeCode; /** - * Create the TaggedComponent typecode (structure, - * named "TaggedComponent"). - * The typecode states that the structure contains the - * following fields: tag, component_data. + * Create the TaggedComponent typecode (structure, named "TaggedComponent"). + * The typecode states that the structure contains the following fields: tag, + * component_data. */ public static TypeCode type() { if (typeCode == null) { ORB orb = ORB.init(); - StructMember[] members = new StructMember[ 2 ]; + StructMember[] members = new StructMember[2]; TypeCode field; - field = - orb.create_alias_tc("IDL:omg.org/IOP/ComponentId:1.0", "ComponentId", - orb.get_primitive_tc(TCKind.tk_ulong) - ); - members [ 0 ] = new StructMember("tag", field, null); + field = orb.create_alias_tc("IDL:omg.org/IOP/ComponentId:1.0", + "ComponentId", + orb.get_primitive_tc(TCKind.tk_ulong)); + members[0] = new StructMember("tag", field, null); - field = - orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet)); - members [ 1 ] = new StructMember("component_data", field, null); + field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet)); + members[1] = new StructMember("component_data", field, null); typeCode = orb.create_struct_tc(id(), "TaggedComponent", members); } return typeCode; } /** - * Insert the TaggedComponent into the given Any. - * This method uses the TaggedComponentHolder. - * - * @param any the Any to insert into. - * @param that the TaggedComponent to insert. - */ + * Insert the TaggedComponent into the given Any. This method uses the + * TaggedComponentHolder. + * + * @param any the Any to insert into. + * @param that the TaggedComponent to insert. + */ public static void insert(Any any, TaggedComponent that) { any.insert_Streamable(new TaggedComponentHolder(that)); } /** - * Extract the TaggedComponent from given Any. - * This method uses the TaggedComponentHolder. + * Extract the TaggedComponent from given Any. This method uses the + * TaggedComponentHolder. * * @throws BAD_OPERATION if the passed Any does not contain TaggedComponent. */ @@ -132,9 +132,8 @@ public abstract class TaggedComponentHelper /** * Read the structure from the CDR intput stream. Expects the integer - * identifier of the tag, then the size of the tag data - * and then the specified number of bytes, representing the data - * of the tag. + * identifier of the tag, then the size of the tag data and then the specified + * number of bytes, representing the data of the tag. * * @param input a org.omg.CORBA.portable stream to read from. */ @@ -142,17 +141,24 @@ public abstract class TaggedComponentHelper { TaggedComponent value = new TaggedComponent(); value.tag = input.read_long(); - value.component_data = new byte[ input.read_long() ]; - for (int i0 = 0; i0 < value.component_data.length; i0++) - value.component_data [ i0 ] = input.read_octet(); + value.component_data = new byte[input.read_long()]; + try + { + input.read(value.component_data); + } + catch (IOException e) + { + MARSHAL m = new MARSHAL(); + m.initCause(e); + throw m; + } return value; } /** - * Write the structure to the CDR output stream. - * Writes the integer identifier of the tag, then the size of the tag data - * and then the specified number of bytes, representing the data - * of the tag. + * Write the structure to the CDR output stream. Writes the integer identifier + * of the tag, then the size of the tag data and then the specified number of + * bytes, representing the data of the tag. * * @param output a org.omg.CORBA.portable stream stream to write into. * @param value a value to write. @@ -161,7 +167,16 @@ public abstract class TaggedComponentHelper { output.write_long(value.tag); output.write_long(value.component_data.length); - for (int i0 = 0; i0 < value.component_data.length; i0++) - output.write_octet(value.component_data [ i0 ]); + + try + { + output.write(value.component_data); + } + catch (IOException e) + { + MARSHAL m = new MARSHAL(); + m.initCause(e); + throw m; + } } }
\ No newline at end of file diff --git a/libjava/classpath/org/omg/IOP/TaggedProfileHelper.java b/libjava/classpath/org/omg/IOP/TaggedProfileHelper.java index 0433e10cf6d..a23122eb975 100644 --- a/libjava/classpath/org/omg/IOP/TaggedProfileHelper.java +++ b/libjava/classpath/org/omg/IOP/TaggedProfileHelper.java @@ -38,8 +38,12 @@ exception statement from your version. */ package org.omg.IOP; +import gnu.CORBA.CDR.cdrBufInput; +import gnu.CORBA.CDR.cdrBufOutput; + import org.omg.CORBA.Any; import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.MARSHAL; import org.omg.CORBA.ORB; import org.omg.CORBA.StructMember; import org.omg.CORBA.TCKind; @@ -47,11 +51,13 @@ import org.omg.CORBA.TypeCode; import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.OutputStream; +import java.io.IOException; + /** -* A helper operations for the structure {@link TaggedProfile}. -* -* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) -*/ + * A helper operations for the structure {@link TaggedProfile}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ public abstract class TaggedProfileHelper { /** @@ -60,49 +66,46 @@ public abstract class TaggedProfileHelper private static TypeCode typeCode; /** - * Create the TaggedProfile typecode (structure, - * named "TaggedProfile"). - * The typecode states that the structure contains the - * following fields: tag, profile_data. + * Create the TaggedProfile typecode (structure, named "TaggedProfile"). The + * typecode states that the structure contains the following fields: tag, + * profile_data. */ public static TypeCode type() { if (typeCode == null) { ORB orb = ORB.init(); - StructMember[] members = new StructMember[ 2 ]; + StructMember[] members = new StructMember[2]; TypeCode field; - field = - orb.create_alias_tc("IDL:omg.org/IOP/ProfileId:1.0", "ProfileId", - orb.get_primitive_tc(TCKind.tk_ulong) - ); - members [ 0 ] = new StructMember("tag", field, null); + field = orb.create_alias_tc("IDL:omg.org/IOP/ProfileId:1.0", + "ProfileId", + orb.get_primitive_tc(TCKind.tk_ulong)); + members[0] = new StructMember("tag", field, null); - field = - orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet)); - members [ 1 ] = new StructMember("profile_data", field, null); + field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet)); + members[1] = new StructMember("profile_data", field, null); typeCode = orb.create_struct_tc(id(), "TaggedProfile", members); } return typeCode; } /** - * Insert the TaggedProfile into the given Any. - * This method uses the TaggedProfileHolder. - * - * @param any the Any to insert into. - * @param that the TaggedProfile to insert. - */ + * Insert the TaggedProfile into the given Any. This method uses the + * TaggedProfileHolder. + * + * @param any the Any to insert into. + * @param that the TaggedProfile to insert. + */ public static void insert(Any any, TaggedProfile that) { any.insert_Streamable(new TaggedProfileHolder(that)); } /** - * Extract the TaggedProfile from given Any. - * This method uses the TaggedProfileHolder. + * Extract the TaggedProfile from given Any. This method uses the + * TaggedProfileHolder. * * @throws BAD_OPERATION if the passed Any does not contain TaggedProfile. */ @@ -139,9 +142,18 @@ public abstract class TaggedProfileHelper { TaggedProfile value = new TaggedProfile(); value.tag = input.read_long(); - value.profile_data = new byte[ input.read_long() ]; - for (int i0 = 0; i0 < value.profile_data.length; i0++) - value.profile_data [ i0 ] = input.read_octet(); + + if (input instanceof cdrBufInput) + { + // Highly probable. + value.profile_data = ((cdrBufInput) input).read_sequence(); + } + else + { + value.profile_data = new byte[input.read_long()]; + for (int i0 = 0; i0 < value.profile_data.length; i0++) + value.profile_data[i0] = input.read_octet(); + } return value; } @@ -154,8 +166,27 @@ public abstract class TaggedProfileHelper public static void write(OutputStream output, TaggedProfile value) { output.write_long(value.tag); - output.write_long(value.profile_data.length); - for (int i0 = 0; i0 < value.profile_data.length; i0++) - output.write_octet(value.profile_data [ i0 ]); + + if (output instanceof cdrBufOutput) + { + // Highly probable. + output.write_long(value.profile_data.length); + try + { + output.write(value.profile_data); + } + catch (IOException e) + { + MARSHAL m = new MARSHAL(); + m.initCause(e); + throw m; + } + } + else + { + output.write_long(value.profile_data.length); + for (int i0 = 0; i0 < value.profile_data.length; i0++) + output.write_octet(value.profile_data[i0]); + } } }
\ No newline at end of file |

