From 3b3101d8b5ae4f08a16c0b7111da6cad41bbd282 Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 15 Nov 2005 23:20:01 +0000 Subject: 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 --- libjava/classpath/gnu/CORBA/GIOP/CharSets_OSF.java | 5 +- libjava/classpath/gnu/CORBA/GIOP/CloseMessage.java | 10 +- .../gnu/CORBA/GIOP/CodeSetServiceContext.java | 224 +++++++++++++++++++++ .../classpath/gnu/CORBA/GIOP/ContextHandler.java | 76 +++++++ libjava/classpath/gnu/CORBA/GIOP/ErrorMessage.java | 23 ++- .../classpath/gnu/CORBA/GIOP/MessageHeader.java | 200 +++++++++++++----- libjava/classpath/gnu/CORBA/GIOP/ReplyHeader.java | 10 +- .../classpath/gnu/CORBA/GIOP/RequestHeader.java | 10 +- .../classpath/gnu/CORBA/GIOP/ServiceContext.java | 88 ++++++-- .../gnu/CORBA/GIOP/contextSupportingHeader.java | 76 ------- libjava/classpath/gnu/CORBA/GIOP/cxCodeSet.java | 224 --------------------- .../classpath/gnu/CORBA/GIOP/v1_0/ReplyHeader.java | 14 +- .../gnu/CORBA/GIOP/v1_0/RequestHeader.java | 14 +- .../classpath/gnu/CORBA/GIOP/v1_2/ReplyHeader.java | 16 +- .../gnu/CORBA/GIOP/v1_2/RequestHeader.java | 27 ++- 15 files changed, 599 insertions(+), 418 deletions(-) create mode 100644 libjava/classpath/gnu/CORBA/GIOP/CodeSetServiceContext.java create mode 100644 libjava/classpath/gnu/CORBA/GIOP/ContextHandler.java delete mode 100644 libjava/classpath/gnu/CORBA/GIOP/contextSupportingHeader.java delete mode 100644 libjava/classpath/gnu/CORBA/GIOP/cxCodeSet.java (limited to 'libjava/classpath/gnu/CORBA/GIOP') diff --git a/libjava/classpath/gnu/CORBA/GIOP/CharSets_OSF.java b/libjava/classpath/gnu/CORBA/GIOP/CharSets_OSF.java index f3f35dbaa21..bffb02678aa 100644 --- a/libjava/classpath/gnu/CORBA/GIOP/CharSets_OSF.java +++ b/libjava/classpath/gnu/CORBA/GIOP/CharSets_OSF.java @@ -47,7 +47,10 @@ import java.util.Set; /** * This class contains the codes, used to identify character sets * in CORBA. These codes are defined in Open Software Foundation (OSF) - * code set registry + * code set registry. + * + * The name of this class specially sets "OSF" apart if somebody would start + * searching Open Software Foundation abbreviation. * * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) */ diff --git a/libjava/classpath/gnu/CORBA/GIOP/CloseMessage.java b/libjava/classpath/gnu/CORBA/GIOP/CloseMessage.java index d884329c440..38039c2ed21 100644 --- a/libjava/classpath/gnu/CORBA/GIOP/CloseMessage.java +++ b/libjava/classpath/gnu/CORBA/GIOP/CloseMessage.java @@ -38,15 +38,13 @@ exception statement from your version. */ package gnu.CORBA.GIOP; -import gnu.CORBA.IOR; +import gnu.CORBA.Minor; import org.omg.CORBA.MARSHAL; import java.io.IOException; import java.io.OutputStream; -import java.net.Socket; - /** * The explicit command to close the connection. * @@ -60,6 +58,11 @@ import java.net.Socket; public class CloseMessage extends MessageHeader { + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1; + /** * The singleton close message is typically enough, despite new * instances may be instantiated if the specific version field @@ -95,6 +98,7 @@ public class CloseMessage catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to flush the stream"); + m.minor = Minor.Header; m.initCause(ex); throw m; } diff --git a/libjava/classpath/gnu/CORBA/GIOP/CodeSetServiceContext.java b/libjava/classpath/gnu/CORBA/GIOP/CodeSetServiceContext.java new file mode 100644 index 00000000000..ab565db3797 --- /dev/null +++ b/libjava/classpath/gnu/CORBA/GIOP/CodeSetServiceContext.java @@ -0,0 +1,224 @@ +/* CodeSet_sctx.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 gnu.CORBA.GIOP; + +import gnu.CORBA.CDR.AbstractCdrInput; +import gnu.CORBA.CDR.AbstractCdrOutput; +import gnu.CORBA.IOR; +import gnu.CORBA.IOR.CodeSets_profile; + +import java.io.IOException; + +/** + * The code set service context. This context must be included in all + * messages that use wide characters. + * + * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) + */ +public class CodeSetServiceContext + extends ServiceContext +{ + /** + * The context code sets id. + */ + public static final int ID = 1; + + /** + * The standard component to include in the messages. + */ + public static final CodeSetServiceContext STANDARD = new CodeSetServiceContext(); + + /** + * The encoding, used to transfer the narrow (1 byte) character data. + * The default value is taken from {@link CharSets_OSF#NATIVE_CHARACTER}. + */ + public int char_data = CharSets_OSF.NATIVE_CHARACTER; + + /** + * The encoding, used to transfer the wide character data. + * The default value is taken from + * {@link CharSets_OSF#NATIVE_WIDE_CHARACTER}. + */ + public int wide_char_data = CharSets_OSF.NATIVE_WIDE_CHARACTER; + + /** + * Find and return the code set service context in the give + * contexts array. Returns {@link #STANDARD} if no code set + * context is present. + * + * @param contexts the array of contexts, can be null. + */ + public static CodeSetServiceContext find(ServiceContext[] contexts) + { + if (contexts != null) + for (int i = 0; i < contexts.length; i++) + { + if (contexts [ i ] instanceof CodeSetServiceContext) + return (CodeSetServiceContext) contexts [ i ]; + } + return STANDARD; + } + + /** + * Select the suitable encoding that is defined in the provided profile. + * + * TODO character encoding. Now the encoding can be set, but it is ignored. + * If you take this task, scan 'TODO character encoding' for + * relevant places. + */ + public static CodeSetServiceContext negotiate(IOR.CodeSets_profile profile) + { + if (profile.negotiated != null) + return profile.negotiated; + + CodeSetServiceContext use = new CodeSetServiceContext(); + + use.char_data = + negotiate(profile.narrow, STANDARD.char_data, CharSets_OSF.ISO8859_1); + + use.wide_char_data = + negotiate(profile.wide, STANDARD.wide_char_data, CharSets_OSF.UTF16); + + profile.negotiated = use; + + return use; + } + + /** + * Read the context from the given stream. Does not read the + * code sets id. + */ + public void readContext(AbstractCdrInput input) + { + AbstractCdrInput encap = input.read_encapsulation(); + + char_data = encap.read_ulong(); + wide_char_data = encap.read_ulong(); + } + + /** + * Return a string representation. + */ + public String toString() + { + return " Encoding: narrow " + name(char_data) + ", wide " + + name(wide_char_data) + ". "; + } + + /** + * Write the context to the given stream, including the code + * sets id. + */ + public void write(AbstractCdrOutput output) + { + output.write_ulong(ID); + + AbstractCdrOutput enout = output.createEncapsulation(); + + enout.write_long(char_data); + enout.write_ulong(wide_char_data); + + try + { + enout.close(); + } + catch (IOException ex) + { + InternalError t = new InternalError(); + t.initCause(ex); + throw t; + } + } + + /** + * Negotiate about the character encoding. Prefer our native encoding, + * if no, prefer IORs native encoding, if no, find any encoding, + * supported by both sides, if no, return the specified final decission. + * + * @param profile the component profile in IOR. + * @param our_native our native encoding + * @param final_decission the encoding that must be returned if no + * compromise is found. + * + * @return the resulted encoding. + */ + protected static int negotiate(IOR.CodeSets_profile.CodeSet_component profile, + int our_native, int final_decission + ) + { + // If our and IORs native sets match, use the native set. + if (profile.native_set == our_native) + return our_native; + + // If the native sets do not match, but the IOR says it + // supports our native set, use our native set. + if (profile.conversion != null) + for (int i = 0; i < profile.conversion.length; i++) + { + if (our_native == profile.conversion [ i ]) + return our_native; + } + + // At this point, we suggest to use the IORs native set. + int[] allSupported = CharSets_OSF.getSupportedCharSets(); + + for (int s = 0; s < allSupported.length; s++) + if (allSupported [ s ] == profile.native_set) + return profile.native_set; + + // Any compromise left? + if (profile.conversion != null) + for (int s = 0; s < allSupported.length; s++) + for (int i = 0; i < profile.conversion.length; i++) + if (allSupported [ s ] == profile.conversion [ i ]) + return allSupported [ s ]; + + // Return the CORBA default char encoding. + return final_decission; + } + + /** + * Conveniency method, used in toString() + */ + private String name(int set) + { + return "0x" + Integer.toHexString(set) + " (" + CharSets_OSF.getName(set) + + ") "; + } +} diff --git a/libjava/classpath/gnu/CORBA/GIOP/ContextHandler.java b/libjava/classpath/gnu/CORBA/GIOP/ContextHandler.java new file mode 100644 index 00000000000..77ea20e38f0 --- /dev/null +++ b/libjava/classpath/gnu/CORBA/GIOP/ContextHandler.java @@ -0,0 +1,76 @@ +/* ContextHandler.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 gnu.CORBA.GIOP; + +import org.omg.CORBA.BAD_INV_ORDER; + +/** + * A header, supporting the service contexts. Such header has a context field + * and methods for adding the new contexts. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ContextHandler +{ + + /** + * Empty array, indicating that no service context is available. + */ + protected static final ServiceContext[] NO_CONTEXT = new ServiceContext[0]; + + /** + * The context data. + */ + public ServiceContext[] service_context = NO_CONTEXT; + + /** + * Add service context to this header. + * + * @param context_to_add context to add. + * @param replace if true, the existing context with this ID is replaced. + * Otherwise, BAD_INV_ORDER is throwsn. + */ + public void addContext(org.omg.IOP.ServiceContext context_to_add, + boolean replace) + throws BAD_INV_ORDER + { + service_context = ServiceContext.add(service_context, context_to_add, + replace); + } +} diff --git a/libjava/classpath/gnu/CORBA/GIOP/ErrorMessage.java b/libjava/classpath/gnu/CORBA/GIOP/ErrorMessage.java index 8d3b3539be5..99942fee359 100644 --- a/libjava/classpath/gnu/CORBA/GIOP/ErrorMessage.java +++ b/libjava/classpath/gnu/CORBA/GIOP/ErrorMessage.java @@ -38,7 +38,9 @@ exception statement from your version. */ package gnu.CORBA.GIOP; +import gnu.CORBA.OrbFunctional; import gnu.CORBA.IOR; +import gnu.CORBA.Minor; import java.io.IOException; import java.io.OutputStream; @@ -46,6 +48,7 @@ import java.io.OutputStream; import java.net.Socket; import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.ORB; /** * The error message is sent in response to the message, encoded @@ -59,6 +62,11 @@ import org.omg.CORBA.MARSHAL; public class ErrorMessage extends MessageHeader { + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1; + /** * Create a new error message, setting the message field * to the {@link MESSAGE_ERROR} and the version number to @@ -73,14 +81,22 @@ public class ErrorMessage /** * Send the error message to the given IOR address. * - * @param to the IOR address (host and port, other fields + * @param ior the IOR address (host and port, other fields * are not used). + * + * @param orb the ORB, sending the error message. */ - public void send(IOR ior) + public void send(IOR ior, ORB orb) { try { - Socket socket = new Socket(ior.Internet.host, ior.Internet.port); + Socket socket; + + if (orb instanceof OrbFunctional) + socket = ((OrbFunctional) orb).socketFactory.createClientSocket( + ior.Internet.host, ior.Internet.port); + else + socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); write(socketOutput); @@ -90,6 +106,7 @@ public class ErrorMessage catch (IOException ex) { MARSHAL t = new MARSHAL(); + t.minor = Minor.Header; t.initCause(ex); throw t; } diff --git a/libjava/classpath/gnu/CORBA/GIOP/MessageHeader.java b/libjava/classpath/gnu/CORBA/GIOP/MessageHeader.java index 61c46e11ea4..e1bdb512bfb 100644 --- a/libjava/classpath/gnu/CORBA/GIOP/MessageHeader.java +++ b/libjava/classpath/gnu/CORBA/GIOP/MessageHeader.java @@ -1,4 +1,4 @@ -/* MessageHeader.java -- GIOP 1.0 message header. +/* MessageHeader.java -- GIOP message header. Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,32 +38,38 @@ exception statement from your version. */ package gnu.CORBA.GIOP; +import gnu.CORBA.Minor; +import gnu.CORBA.Version; +import gnu.CORBA.CDR.BigEndianInputStream; import gnu.CORBA.CDR.BigEndianOutputStream; import gnu.CORBA.CDR.LittleEndianInputStream; import gnu.CORBA.CDR.LittleEndianOutputStream; -import gnu.CORBA.CDR.abstractDataOutputStream; -import gnu.CORBA.Version; +import gnu.CORBA.CDR.AbstractDataInput; +import gnu.CORBA.CDR.AbstractDataOutput; import org.omg.CORBA.MARSHAL; import org.omg.CORBA.portable.IDLEntity; -import java.io.DataInputStream; +import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.io.InputStream; import java.io.OutputStream; - +import java.net.Socket; import java.util.Arrays; -import gnu.CORBA.CDR.BigEndianInputStream; -import gnu.CORBA.CDR.abstractDataInputStream; -import java.io.InputStream; /** * The GIOP message header. - * + * * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) */ public class MessageHeader implements IDLEntity { + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1; + /** * Request message. */ @@ -80,16 +86,15 @@ public class MessageHeader public static final byte CANCEL_REQUEST = 2; /** - * Locate request message, used to check the server ability to - * process requests for the object reference. - * This message is also used to get the + * Locate request message, used to check the server ability to process + * requests for the object reference. This message is also used to get the * address where the object reference should be sent. */ public static final byte LOCATE_REQUEST = 3; /** - * Locate reply message, sent in response to the - * {@link #LocateRequest} message. + * Locate reply message, sent in response to the {@link #LocateRequest} + * message. */ public static final byte LOCATE_REPLY = 4; @@ -104,8 +109,8 @@ public class MessageHeader public static final byte MESSAGE_ERROR = 6; /** - * The fragment messge, following the previous message that - * has more fragments flag set. Added in GIOP 1.1 + * The fragment messge, following the previous message that has more fragments + * flag set. Added in GIOP 1.1 */ public static final byte FRAGMENT = 7; @@ -117,12 +122,9 @@ public class MessageHeader /** * The message type names. */ - protected static String[] types = - new String[] - { - "Request", "Reply", "Cancel", "Locate request", "Locate reply", - "Close connection", "Error", "Fragment" - }; + protected static String[] types = new String[] { "Request", "Reply", + "Cancel", "Locate request", "Locate reply", "Close connection", "Error", + "Fragment" }; /** * The GIOP version. Initialised to 1.0 . @@ -154,7 +156,7 @@ public class MessageHeader /** * Create an empty message header, corresponding the given version. - * + * * @param major the major message header version. * @param minor the minot message header version. */ @@ -164,19 +166,27 @@ public class MessageHeader } /** - * Checks if the message is encoded in the Big Endian, most significant - * byte first. + * Checks if the message is encoded in the Big Endian, most significant byte + * first. */ public boolean isBigEndian() { return (flags & 0x1) == 0; } + /** + * Checks if the message is partial, and more subsequent fragments follow. + */ + public boolean moreFragmentsFollow() + { + return (flags & 0x2) != 0; + } + /** * Set the encoding to use. - * - * @param use_big_endian if true (default), the Big Endian - * encoding is used. If false, the Little Endian encoding is used. + * + * @param use_big_endian if true (default), the Big Endian encoding is used. + * If false, the Little Endian encoding is used. */ public void setBigEndian(boolean use_big_endian) { @@ -196,16 +206,16 @@ public class MessageHeader /** * Get the message type as string. - * + * * @param type the message type as int (the field {@link message_type}). - * + * * @return the message type as string. */ public String getTypeString(int type) { try { - return types [ type ]; + return types[type]; } catch (ArrayIndexOutOfBoundsException ex) { @@ -215,10 +225,10 @@ public class MessageHeader /** * Creates reply header, matching the message header version number. - * + * * @return one of {@link gnu.CORBA.GIOP.v1_0.ReplyHeader}, - * {@link gnu.CORBA.GIOP.v1_2.ReplyHeader}, etc - depending on - * the version number in this header. + * {@link gnu.CORBA.GIOP.v1_2.ReplyHeader}, etc - depending on the version + * number in this header. */ public ReplyHeader create_reply_header() { @@ -230,10 +240,10 @@ public class MessageHeader /** * Creates request header, matching the message header version number. - * + * * @return one of {@link gnu.CORBA.GIOP.v1_0.RequestHeader}, - * {@link gnu.CORBA.GIOP.v1_2.RequestHeader}, etc - depending on - * the version number in this header. + * {@link gnu.CORBA.GIOP.v1_2.RequestHeader}, etc - depending on the version + * number in this header. */ public RequestHeader create_request_header() { @@ -261,24 +271,28 @@ public class MessageHeader /** * Read the header from the stream. - * + * * @param istream a stream to read from. - * + * * @throws MARSHAL if this is not a GIOP 1.0 header. */ public void read(java.io.InputStream istream) - throws MARSHAL + throws MARSHAL { try { - byte[] xMagic = new byte[ MAGIC.length ]; + byte[] xMagic = new byte[MAGIC.length]; istream.read(xMagic); if (!Arrays.equals(xMagic, MAGIC)) - throw new MARSHAL("Not a GIOP message"); + { + MARSHAL m = new MARSHAL("Not a GIOP message"); + m.minor = Minor.Giop; + throw m; + } version = Version.read_version(istream); - abstractDataInputStream din; + AbstractDataInput din; flags = (byte) istream.read(); @@ -295,6 +309,7 @@ public class MessageHeader catch (IOException ex) { MARSHAL t = new MARSHAL(); + t.minor = Minor.Header; t.initCause(ex); throw t; } @@ -302,26 +317,26 @@ public class MessageHeader /** * Get the short string summary of the message. - * + * * @return a short message summary. */ public String toString() { - return "GIOP " + version + ", " + (isBigEndian() ? "Big" : "Little") + - " endian, " + getTypeString(message_type) + ", " + message_size + - " bytes. "; + return "GIOP " + version + ", " + (isBigEndian() ? "Big" : "Little") + + " endian, " + getTypeString(message_type) + ", " + message_size + + " bytes. "; } /** * Write the header to stream. - * + * * @param out a stream to write into. */ public void write(java.io.OutputStream out) { try { - abstractDataOutputStream dout; + AbstractDataOutput dout; if (isBigEndian()) dout = new BigEndianOutputStream(out); @@ -333,18 +348,99 @@ public class MessageHeader // Write version number. version.write((OutputStream) dout); - dout.write(flags); - dout.write(message_type); - dout.writeInt(message_size); } catch (IOException ex) { MARSHAL t = new MARSHAL(); + t.minor = Minor.Header; t.initCause(ex); throw t; } } + + /** + * Read data, followed by the message header. Handle fragmented messages. + * + * @param source the data source to read from. + * @param service the socket on that the time outs are set. Can be null (no + * timeouts are set). + * @param to_read the timeout while reading the message. + * @param to_pause the timeout for pauses between the message parts. + */ + public byte[] readMessage(InputStream source, Socket service, int to_read, + int to_pause) + { + try + { + byte[] r = new byte[message_size]; + + int n = 0; + if (service != null) + service.setSoTimeout(to_read); + + reading: while (n < r.length) + { + n += source.read(r, n, r.length - n); + } + if (service != null) + service.setSoTimeout(to_pause); + + // Read the message remainder if the message is fragmented. + if (moreFragmentsFollow()) + { + ByteArrayOutputStream buffer = new ByteArrayOutputStream( + 2 * r.length); + buffer.write(r); + + if (r.length < 10) + // Increase the buffer size if the default value (size of the + // previous message) is really too small. + r = new byte[1024]; + + MessageHeader h2 = new MessageHeader(); + + do + { + h2.read(source); + + int dn; + + n = 0; + reading: while (n < h2.message_size) + { + dn = source.read(r, 0, h2.message_size - n); + + if (n == 0 && service != null) + service.setSoTimeout(to_read); + + if (n == 0 && version.since_inclusive(1, 2)) + { + // Skip the four byte request id. + buffer.write(r, 4, dn - 4); + } + else + buffer.write(r, 0, dn); + n = +dn; + } + + if (service != null) + service.setSoTimeout(to_pause); + } + while (h2.moreFragmentsFollow()); + return buffer.toByteArray(); + } + else + return r; + } + catch (IOException ioex) + { + MARSHAL m = new MARSHAL("Unable to read the message continuation."); + m.minor = Minor.Header; + m.initCause(ioex); + throw m; + } + } } \ No newline at end of file diff --git a/libjava/classpath/gnu/CORBA/GIOP/ReplyHeader.java b/libjava/classpath/gnu/CORBA/GIOP/ReplyHeader.java index f0f409394e6..d1448290331 100644 --- a/libjava/classpath/gnu/CORBA/GIOP/ReplyHeader.java +++ b/libjava/classpath/gnu/CORBA/GIOP/ReplyHeader.java @@ -38,8 +38,8 @@ exception statement from your version. */ package gnu.CORBA.GIOP; -import gnu.CORBA.CDR.cdrInput; -import gnu.CORBA.CDR.cdrOutput; +import gnu.CORBA.CDR.AbstractCdrInput; +import gnu.CORBA.CDR.AbstractCdrOutput; /** * The header of the standard reply. @@ -47,7 +47,7 @@ import gnu.CORBA.CDR.cdrOutput; * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) */ public abstract class ReplyHeader - extends contextSupportingHeader + extends ContextHandler { /** * Reply status, if no exception occured. @@ -121,7 +121,7 @@ public abstract class ReplyHeader * * @param in a stream to read from. */ - public abstract void read(cdrInput in); + public abstract void read(AbstractCdrInput in); /** * Returns a short string representation. @@ -141,5 +141,5 @@ public abstract class ReplyHeader * * @param out a stream to write into. */ - public abstract void write(cdrOutput out); + public abstract void write(AbstractCdrOutput out); } diff --git a/libjava/classpath/gnu/CORBA/GIOP/RequestHeader.java b/libjava/classpath/gnu/CORBA/GIOP/RequestHeader.java index 17cccb8834a..3cfadfd7867 100644 --- a/libjava/classpath/gnu/CORBA/GIOP/RequestHeader.java +++ b/libjava/classpath/gnu/CORBA/GIOP/RequestHeader.java @@ -38,8 +38,8 @@ exception statement from your version. */ package gnu.CORBA.GIOP; -import gnu.CORBA.CDR.cdrInput; -import gnu.CORBA.CDR.cdrOutput; +import gnu.CORBA.CDR.AbstractCdrInput; +import gnu.CORBA.CDR.AbstractCdrOutput; import org.omg.CORBA.portable.IDLEntity; @@ -49,7 +49,7 @@ import org.omg.CORBA.portable.IDLEntity; * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) */ public abstract class RequestHeader - extends contextSupportingHeader + extends ContextHandler implements IDLEntity { /** @@ -137,7 +137,7 @@ public abstract class RequestHeader * * @param in a stream to read from. */ - public abstract void read(cdrInput in); + public abstract void read(AbstractCdrInput in); /** * Return a string representation. @@ -149,6 +149,6 @@ public abstract class RequestHeader * * @param out a stream to write into. */ - public abstract void write(cdrOutput out); + public abstract void write(AbstractCdrOutput out); } diff --git a/libjava/classpath/gnu/CORBA/GIOP/ServiceContext.java b/libjava/classpath/gnu/CORBA/GIOP/ServiceContext.java index 29a8ea8ac77..78519510cb7 100644 --- a/libjava/classpath/gnu/CORBA/GIOP/ServiceContext.java +++ b/libjava/classpath/gnu/CORBA/GIOP/ServiceContext.java @@ -38,8 +38,8 @@ exception statement from your version. */ package gnu.CORBA.GIOP; -import gnu.CORBA.CDR.cdrInput; -import gnu.CORBA.CDR.cdrOutput; +import gnu.CORBA.CDR.AbstractCdrInput; +import gnu.CORBA.CDR.AbstractCdrOutput; import org.omg.CORBA.BAD_INV_ORDER; import org.omg.CORBA.BAD_PARAM; @@ -48,7 +48,7 @@ import org.omg.CORBA.portable.IDLEntity; /** * Contains the ORB service data being passed. - * + * * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) */ public class ServiceContext @@ -59,6 +59,50 @@ public class ServiceContext */ private static final long serialVersionUID = 1; + /* Standard values for the context_id. */ + public static final int TransactionService = 0; + + /** + * Defines code sets, used to encode wide and narrow characters. Required for + * messages with data structures, involving wide characters. + */ + public static final int CodeSets = 1; + + public static final int ChainBypassCheck = 2; + + public static final int ChainBypassInfo = 3; + + public static final int LogicalThreadId = 4; + + public static final int BI_DIR_IIOP = 5; + + public static final int SendingContextRunTime = 6; + + public static final int INVOCATION_POLICIES = 7; + + public static final int FORWARDED_IDENTITY = 8; + + /** + * Contains exception details if exception being transferred is other than + * System or User exception. javax.rmi uses this context to transfer arbitrary + * java exceptions as CORBA value types. + */ + public static final int UnknownExceptionInfo = 9; + + public static final int RTCorbaPriority = 10; + + public static final int RTCorbaPriorityRange = 11; + + public static final int FT_GROUP_VERSION = 12; + + public static final int FT_REQUEST = 13; + + public static final int ExceptionDetailMessage = 14; + + public static final int SecurityAttributeService = 15; + + public static final int ActivityService = 16; + /** * The context id (for instance, 0x1 for code sets context). At the moment of * writing, the OMG defines 16 standard values and provides rules to register @@ -90,18 +134,18 @@ public class ServiceContext /** * Read the context values from the stream. - * + * * @param istream a stream to read from. */ - public static ServiceContext read(cdrInput istream) + public static ServiceContext read(AbstractCdrInput istream) { int id = istream.read_ulong(); switch (id) { - case cxCodeSet.ID: + case CodeSetServiceContext.ID: - cxCodeSet codeset = new cxCodeSet(); + CodeSetServiceContext codeset = new CodeSetServiceContext(); codeset.readContext(istream); return codeset; @@ -117,7 +161,7 @@ public class ServiceContext /** * Read a sequence of contexts from the input stream. */ - public static ServiceContext[] readSequence(cdrInput istream) + public static ServiceContext[] readSequence(AbstractCdrInput istream) { int size = istream.read_long(); ServiceContext[] value = new gnu.CORBA.GIOP.ServiceContext[size]; @@ -128,10 +172,10 @@ public class ServiceContext /** * Write the context values into the stream. - * + * * @param ostream a stream to write the data to. */ - public void write(cdrOutput ostream) + public void write(AbstractCdrOutput ostream) { ostream.write_ulong(context_id); ostream.write_sequence(context_data); @@ -140,7 +184,7 @@ public class ServiceContext /** * Write the sequence of contexts into the input stream. */ - public static void writeSequence(cdrOutput ostream, ServiceContext[] value) + public static void writeSequence(AbstractCdrOutput ostream, ServiceContext[] value) { ostream.write_long(value.length); for (int i = 0; i < value.length; i++) @@ -172,8 +216,7 @@ public class ServiceContext // Replace context. if (!replace) throw new BAD_INV_ORDER("Repetetive setting of the context " - + service_context.context_id, 15, - CompletionStatus.COMPLETED_NO); + + service_context.context_id, 15, CompletionStatus.COMPLETED_NO); else cx[exists] = service_context; } @@ -205,15 +248,13 @@ public class ServiceContext // Replace context. if (!replace) throw new BAD_INV_ORDER("Repetetive setting of the context " - + service_context.context_id, 15, - CompletionStatus.COMPLETED_NO); + + service_context.context_id, 15, CompletionStatus.COMPLETED_NO); else cx[exists] = new ServiceContext(service_context); return cx; } } - /** * Find context with the given name in the context array. */ @@ -227,8 +268,8 @@ public class ServiceContext } /** - * Find context with the given name in the context array, - * converting into org.omg.IOP.ServiceContext. + * Find context with the given name in the context array, converting into + * org.omg.IOP.ServiceContext. */ public static org.omg.IOP.ServiceContext findContext(int ctx_name, ServiceContext[] cx) @@ -239,6 +280,17 @@ public class ServiceContext throw new BAD_PARAM("No context with id " + ctx_name); } + /** + * Find context with the given name in the context array without conversions. + */ + public static ServiceContext find(int ctx_name, ServiceContext[] cx) + { + for (int i = 0; i < cx.length; i++) + if (cx[i].context_id == ctx_name) + return cx[i]; + return null; + } + /** * Return a string representation. */ diff --git a/libjava/classpath/gnu/CORBA/GIOP/contextSupportingHeader.java b/libjava/classpath/gnu/CORBA/GIOP/contextSupportingHeader.java deleted file mode 100644 index ba6c1f88d8f..00000000000 --- a/libjava/classpath/gnu/CORBA/GIOP/contextSupportingHeader.java +++ /dev/null @@ -1,76 +0,0 @@ -/* contextSupportingHeader.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 gnu.CORBA.GIOP; - -import org.omg.CORBA.BAD_INV_ORDER; - -/** - * A header, supporting the service contexts. Such header has a context field - * and methods for adding the new contexts. - * - * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) - */ -public abstract class contextSupportingHeader -{ - - /** - * Empty array, indicating that no service context is available. - */ - protected static final ServiceContext[] NO_CONTEXT = new ServiceContext[0]; - - /** - * The context data. - */ - public ServiceContext[] service_context = NO_CONTEXT; - - /** - * Add service context to this header. - * - * @param context_to_add context to add. - * @param replace if true, the existing context with this ID is replaced. - * Otherwise, BAD_INV_ORDER is throwsn. - */ - public void addContext(org.omg.IOP.ServiceContext context_to_add, - boolean replace) - throws BAD_INV_ORDER - { - service_context = ServiceContext.add(service_context, context_to_add, - replace); - } -} diff --git a/libjava/classpath/gnu/CORBA/GIOP/cxCodeSet.java b/libjava/classpath/gnu/CORBA/GIOP/cxCodeSet.java deleted file mode 100644 index 7f42c07f236..00000000000 --- a/libjava/classpath/gnu/CORBA/GIOP/cxCodeSet.java +++ /dev/null @@ -1,224 +0,0 @@ -/* CodeSet_sctx.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 gnu.CORBA.GIOP; - -import gnu.CORBA.CDR.cdrInput; -import gnu.CORBA.CDR.cdrOutput; -import gnu.CORBA.IOR; -import gnu.CORBA.IOR.CodeSets_profile; - -import java.io.IOException; - -/** - * The code set service context. This context must be included in all - * messages that use wide characters. - * - * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) - */ -public class cxCodeSet - extends ServiceContext -{ - /** - * The context code sets id. - */ - public static final int ID = 1; - - /** - * The standard component to include in the messages. - */ - public static final cxCodeSet STANDARD = new cxCodeSet(); - - /** - * The encoding, used to transfer the narrow (1 byte) character data. - * The default value is taken from {@link CharSets_OSF#NATIVE_CHARACTER}. - */ - public int char_data = CharSets_OSF.NATIVE_CHARACTER; - - /** - * The encoding, used to transfer the wide character data. - * The default value is taken from - * {@link CharSets_OSF#NATIVE_WIDE_CHARACTER}. - */ - public int wide_char_data = CharSets_OSF.NATIVE_WIDE_CHARACTER; - - /** - * Find and return the code set service context in the give - * contexts array. Returns {@link #STANDARD} if no code set - * context is present. - * - * @param contexts the array of contexts, can be null. - */ - public static cxCodeSet find(ServiceContext[] contexts) - { - if (contexts != null) - for (int i = 0; i < contexts.length; i++) - { - if (contexts [ i ] instanceof cxCodeSet) - return (cxCodeSet) contexts [ i ]; - } - return STANDARD; - } - - /** - * Select the suitable encoding that is defined in the provided profile. - * - * TODO character encoding. Now the encoding can be set, but it is ignored. - * If you take this task, scan 'TODO character encoding' for - * relevant places. - */ - public static cxCodeSet negotiate(IOR.CodeSets_profile profile) - { - if (profile.negotiated != null) - return profile.negotiated; - - cxCodeSet use = new cxCodeSet(); - - use.char_data = - negotiate(profile.narrow, STANDARD.char_data, CharSets_OSF.ISO8859_1); - - use.wide_char_data = - negotiate(profile.wide, STANDARD.wide_char_data, CharSets_OSF.UTF16); - - profile.negotiated = use; - - return use; - } - - /** - * Read the context from the given stream. Does not read the - * code sets id. - */ - public void readContext(cdrInput input) - { - cdrInput encap = input.read_encapsulation(); - - char_data = encap.read_ulong(); - wide_char_data = encap.read_ulong(); - } - - /** - * Return a string representation. - */ - public String toString() - { - return " Encoding: narrow " + name(char_data) + ", wide " + - name(wide_char_data) + ". "; - } - - /** - * Write the context to the given stream, including the code - * sets id. - */ - public void write(cdrOutput output) - { - output.write_ulong(ID); - - cdrOutput enout = output.createEncapsulation(); - - enout.write_long(char_data); - enout.write_ulong(wide_char_data); - - try - { - enout.close(); - } - catch (IOException ex) - { - InternalError t = new InternalError(); - t.initCause(ex); - throw t; - } - } - - /** - * Negotiate about the character encoding. Prefer our native encoding, - * if no, prefer IORs native encoding, if no, find any encoding, - * supported by both sides, if no, return the specified final decission. - * - * @param profile the component profile in IOR. - * @param our_native our native encoding - * @param final_decission the encoding that must be returned if no - * compromise is found. - * - * @return the resulted encoding. - */ - protected static int negotiate(IOR.CodeSets_profile.CodeSet_component profile, - int our_native, int final_decission - ) - { - // If our and IORs native sets match, use the native set. - if (profile.native_set == our_native) - return our_native; - - // If the native sets do not match, but the IOR says it - // supports our native set, use our native set. - if (profile.conversion != null) - for (int i = 0; i < profile.conversion.length; i++) - { - if (our_native == profile.conversion [ i ]) - return our_native; - } - - // At this point, we suggest to use the IORs native set. - int[] allSupported = CharSets_OSF.getSupportedCharSets(); - - for (int s = 0; s < allSupported.length; s++) - if (allSupported [ s ] == profile.native_set) - return profile.native_set; - - // Any compromise left? - if (profile.conversion != null) - for (int s = 0; s < allSupported.length; s++) - for (int i = 0; i < profile.conversion.length; i++) - if (allSupported [ s ] == profile.conversion [ i ]) - return allSupported [ s ]; - - // Return the CORBA default char encoding. - return final_decission; - } - - /** - * Conveniency method, used in toString() - */ - private String name(int set) - { - return "0x" + Integer.toHexString(set) + " (" + CharSets_OSF.getName(set) + - ") "; - } -} diff --git a/libjava/classpath/gnu/CORBA/GIOP/v1_0/ReplyHeader.java b/libjava/classpath/gnu/CORBA/GIOP/v1_0/ReplyHeader.java index 27181ca6347..c085c17fb9b 100644 --- a/libjava/classpath/gnu/CORBA/GIOP/v1_0/ReplyHeader.java +++ b/libjava/classpath/gnu/CORBA/GIOP/v1_0/ReplyHeader.java @@ -38,10 +38,10 @@ exception statement from your version. */ package gnu.CORBA.GIOP.v1_0; -import gnu.CORBA.CDR.cdrInput; -import gnu.CORBA.CDR.cdrOutput; +import gnu.CORBA.CDR.AbstractCdrInput; +import gnu.CORBA.CDR.AbstractCdrOutput; import gnu.CORBA.GIOP.ServiceContext; -import gnu.CORBA.GIOP.cxCodeSet; +import gnu.CORBA.GIOP.CodeSetServiceContext; /** * The header of the standard reply. @@ -98,13 +98,13 @@ public class ReplyHeader * @param in a stream to read from. */ - public void read(cdrInput in) + public void read(AbstractCdrInput in) { service_context = ServiceContext.readSequence(in); request_id = in.read_ulong(); reply_status = in.read_ulong(); - in.setCodeSet(cxCodeSet.find(service_context)); + in.setCodeSet(CodeSetServiceContext.find(service_context)); } /** @@ -128,12 +128,12 @@ public class ReplyHeader * * @param out a stream to write into. */ - public void write(cdrOutput out) + public void write(AbstractCdrOutput out) { ServiceContext.writeSequence(out, service_context); out.write_ulong(request_id); out.write_ulong(reply_status); - out.setCodeSet(cxCodeSet.find(service_context)); + out.setCodeSet(CodeSetServiceContext.find(service_context)); } } diff --git a/libjava/classpath/gnu/CORBA/GIOP/v1_0/RequestHeader.java b/libjava/classpath/gnu/CORBA/GIOP/v1_0/RequestHeader.java index 7ede4e5b926..5cf723cbc42 100644 --- a/libjava/classpath/gnu/CORBA/GIOP/v1_0/RequestHeader.java +++ b/libjava/classpath/gnu/CORBA/GIOP/v1_0/RequestHeader.java @@ -38,10 +38,10 @@ exception statement from your version. */ package gnu.CORBA.GIOP.v1_0; -import gnu.CORBA.CDR.cdrInput; -import gnu.CORBA.CDR.cdrOutput; +import gnu.CORBA.CDR.AbstractCdrInput; +import gnu.CORBA.CDR.AbstractCdrOutput; import gnu.CORBA.GIOP.ServiceContext; -import gnu.CORBA.GIOP.cxCodeSet; +import gnu.CORBA.GIOP.CodeSetServiceContext; import org.omg.CORBA.portable.IDLEntity; @@ -112,7 +112,7 @@ public class RequestHeader * * @param in a stream to read from. */ - public void read(cdrInput in) + public void read(AbstractCdrInput in) { service_context = ServiceContext.readSequence(in); request_id = in.read_ulong(); @@ -121,7 +121,7 @@ public class RequestHeader operation = in.read_string(); requesting_principal = in.read_sequence(); - in.setCodeSet(cxCodeSet.find(service_context)); + in.setCodeSet(CodeSetServiceContext.find(service_context)); } /** @@ -143,7 +143,7 @@ public class RequestHeader * * @param out a stream to write into. */ - public void write(cdrOutput out) + public void write(AbstractCdrOutput out) { ServiceContext.writeSequence(out, service_context); out.write_ulong(request_id); @@ -152,6 +152,6 @@ public class RequestHeader out.write_string(operation); out.write_sequence(requesting_principal); - out.setCodeSet(cxCodeSet.find(service_context)); + out.setCodeSet(CodeSetServiceContext.find(service_context)); } } diff --git a/libjava/classpath/gnu/CORBA/GIOP/v1_2/ReplyHeader.java b/libjava/classpath/gnu/CORBA/GIOP/v1_2/ReplyHeader.java index c3f51a37b91..3fc1541d9ab 100644 --- a/libjava/classpath/gnu/CORBA/GIOP/v1_2/ReplyHeader.java +++ b/libjava/classpath/gnu/CORBA/GIOP/v1_2/ReplyHeader.java @@ -38,10 +38,10 @@ exception statement from your version. */ package gnu.CORBA.GIOP.v1_2; -import gnu.CORBA.CDR.cdrInput; -import gnu.CORBA.CDR.cdrOutput; +import gnu.CORBA.CDR.AbstractCdrInput; +import gnu.CORBA.CDR.AbstractCdrOutput; import gnu.CORBA.GIOP.ServiceContext; -import gnu.CORBA.GIOP.cxCodeSet; +import gnu.CORBA.GIOP.CodeSetServiceContext; /** * GIOP 1.2 reply header. @@ -56,7 +56,7 @@ public class ReplyHeader */ public ReplyHeader() { - service_context = new ServiceContext[] { cxCodeSet.STANDARD }; + service_context = new ServiceContext[] { CodeSetServiceContext.STANDARD }; } /** @@ -89,13 +89,13 @@ public class ReplyHeader * * @param in a stream to read from. */ - public void read(cdrInput in) + public void read(AbstractCdrInput in) { request_id = in.read_ulong(); reply_status = in.read_ulong(); service_context = gnu.CORBA.GIOP.ServiceContext.readSequence(in); - in.setCodeSet(cxCodeSet.find(service_context)); + in.setCodeSet(CodeSetServiceContext.find(service_context)); } /** @@ -107,12 +107,12 @@ public class ReplyHeader * * @param out a stream to write into. */ - public void write(cdrOutput out) + public void write(AbstractCdrOutput out) { out.write_ulong(request_id); out.write_ulong(reply_status); gnu.CORBA.GIOP.ServiceContext.writeSequence(out, service_context); - out.setCodeSet(cxCodeSet.find(service_context)); + out.setCodeSet(CodeSetServiceContext.find(service_context)); } } diff --git a/libjava/classpath/gnu/CORBA/GIOP/v1_2/RequestHeader.java b/libjava/classpath/gnu/CORBA/GIOP/v1_2/RequestHeader.java index d294d006723..6b37b6c676c 100644 --- a/libjava/classpath/gnu/CORBA/GIOP/v1_2/RequestHeader.java +++ b/libjava/classpath/gnu/CORBA/GIOP/v1_2/RequestHeader.java @@ -38,10 +38,11 @@ exception statement from your version. */ package gnu.CORBA.GIOP.v1_2; -import gnu.CORBA.CDR.cdrInput; -import gnu.CORBA.CDR.cdrOutput; +import gnu.CORBA.Minor; +import gnu.CORBA.CDR.AbstractCdrInput; +import gnu.CORBA.CDR.AbstractCdrOutput; import gnu.CORBA.GIOP.ServiceContext; -import gnu.CORBA.GIOP.cxCodeSet; +import gnu.CORBA.GIOP.CodeSetServiceContext; import java.io.IOException; @@ -58,6 +59,11 @@ import org.omg.CORBA.NO_IMPLEMENT; public class RequestHeader extends gnu.CORBA.GIOP.v1_0.RequestHeader { + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1; + /** * Indicates that the object is addressed by the object key. */ @@ -89,7 +95,7 @@ public class RequestHeader */ public RequestHeader() { - service_context = new ServiceContext[] { cxCodeSet.STANDARD }; + service_context = new ServiceContext[] { CodeSetServiceContext.STANDARD }; } /** @@ -123,7 +129,7 @@ public class RequestHeader * * @param in a stream to read from. */ - public void read(cdrInput in) + public void read(AbstractCdrInput in) { try { @@ -150,20 +156,23 @@ public class RequestHeader throw new NO_IMPLEMENT("Object addressing by by IOR addressing info"); default : - throw new MARSHAL("Unknow addressing method in request, " + + MARSHAL m = new MARSHAL("Unknow addressing method in request, " + AddressingDisposition ); + m.minor = Minor.UnsupportedAddressing; + throw m; } operation = in.read_string(); service_context = gnu.CORBA.GIOP.ServiceContext.readSequence(in); // No requesting principal in this new format. - in.setCodeSet(cxCodeSet.find(service_context)); + in.setCodeSet(CodeSetServiceContext.find(service_context)); } catch (IOException ex) { MARSHAL t = new MARSHAL(); + t.minor = Minor.Header; t.initCause(ex); throw t; } @@ -186,7 +195,7 @@ public class RequestHeader * * @param out a stream to write into. */ - public void write(cdrOutput out) + public void write(AbstractCdrOutput out) { out.write_ulong(request_id); @@ -208,6 +217,6 @@ public class RequestHeader ServiceContext.writeSequence(out, service_context); // No requesting principal in this new format. - out.setCodeSet(cxCodeSet.find(service_context)); + out.setCodeSet(CodeSetServiceContext.find(service_context)); } } -- cgit v1.2.3