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/gnu/CORBA/bufferedResponseHandler.java | |
| 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/gnu/CORBA/bufferedResponseHandler.java')
| -rw-r--r-- | libjava/classpath/gnu/CORBA/bufferedResponseHandler.java | 88 |
1 files changed, 45 insertions, 43 deletions
diff --git a/libjava/classpath/gnu/CORBA/bufferedResponseHandler.java b/libjava/classpath/gnu/CORBA/bufferedResponseHandler.java index e7f00baebe2..0fe945ca1f0 100644 --- a/libjava/classpath/gnu/CORBA/bufferedResponseHandler.java +++ b/libjava/classpath/gnu/CORBA/bufferedResponseHandler.java @@ -41,6 +41,7 @@ package gnu.CORBA; import gnu.CORBA.CDR.cdrBufOutput; import gnu.CORBA.GIOP.MessageHeader; import gnu.CORBA.GIOP.ReplyHeader; +import gnu.CORBA.GIOP.RequestHeader; import gnu.CORBA.GIOP.cxCodeSet; import org.omg.CORBA.ORB; @@ -48,31 +49,33 @@ import org.omg.CORBA.portable.OutputStream; import org.omg.CORBA.portable.ResponseHandler; /** - * Provides the CDR output streams for writing the response to the given - * buffer. + * Provides the CDR output streams for writing the response to the given buffer. * * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) */ -class bufferedResponseHandler +public class bufferedResponseHandler implements ResponseHandler { /** - * The message header. - * This field is used to compute the size and alignments. + * The message header. This field is used to compute the size and alignments. * It is, however, never directly written to the buffer stream. */ - final MessageHeader message_header; + public final MessageHeader message_header; /** * The associated orb. */ - final ORB orb; + public final ORB orb; /** - * The reply header. This field is used to compute the size and alignments. - * It is, however, never directly written to the buffer stream. + * The reply header. + */ + public final ReplyHeader reply_header; + + /** + * The request header. */ - final ReplyHeader reply_header; + public final RequestHeader request_header; /** * True if the stream was obtained by invoking {@link #createExceptionReply()}, @@ -86,28 +89,27 @@ class bufferedResponseHandler private cdrBufOutput buffer; /** - * Create a new buffered response handler that uses the given message - * headers. The headers are used to compute sizes and check the versions. - * They are not written into a stream inside this class. + * Create a new buffered response handler that uses the given message headers. + * The headers are used to compute sizes and check the versions. They are not + * written into a stream inside this class. * * @param m_header a message header. * @param r_header a reply header. */ bufferedResponseHandler(ORB an_orb, MessageHeader m_header, - ReplyHeader r_header - ) + ReplyHeader r_header, RequestHeader rq_header) { message_header = m_header; reply_header = r_header; + request_header = rq_header; orb = an_orb; prepareStream(); } /** - * Get an output stream for providing details about the exception. - * Before returning the stream, the handler automatically writes - * the message header and the reply about exception header, - * but not the message header. + * Get an output stream for providing details about the exception. Before + * returning the stream, the handler automatically writes the message header + * and the reply about exception header, but not the message header. * * @return the stream to write exception details into. */ @@ -121,8 +123,8 @@ class bufferedResponseHandler /** * Get an output stream for writing a regular reply (not an exception). * - * Before returning the stream, the handler automatically writes - * the regular reply header, but not the message header. + * Before returning the stream, the handler automatically writes the regular + * reply header, but not the message header. * * @return the output stream for writing a regular reply. */ @@ -135,27 +137,26 @@ class bufferedResponseHandler } /** - * Get the buffer, normally containing the written reply. - * The reply includes the reply header (or the exception header) - * but does not include the message header. + * Get the buffer, normally containing the written reply. The reply includes + * the reply header (or the exception header) but does not include the message + * header. * - * The stream buffer can also be empty if no data have been written - * into streams, returned by {@link #createReply()} or + * The stream buffer can also be empty if no data have been written into + * streams, returned by {@link #createReply()} or * {@link #createExceptionReply()}. * * @return the CDR output stream, containing the written output. */ - cdrBufOutput getBuffer() + public cdrBufOutput getBuffer() { return buffer; } /** - * True if the stream was obtained by invoking - * {@link #createExceptionReply()}, false otherwise - * (usually no-exception reply). + * True if the stream was obtained by invoking {@link #createExceptionReply()}, + * false otherwise (usually no-exception reply). */ - boolean isExceptionReply() + public boolean isExceptionReply() { return exceptionReply; } @@ -167,21 +168,22 @@ class bufferedResponseHandler { buffer = new cdrBufOutput(); buffer.setOrb(orb); - buffer.setOffset(message_header.getHeaderSize()); - - // Get the position after the reply header would be written. - reply_header.write(buffer); + buffer.setVersion(message_header.version); + buffer.setCodeSet(cxCodeSet.find(reply_header.service_context)); - int new_offset = message_header.getHeaderSize() + buffer.buffer.size(); + // Since 1.2, the data section is always aligned on the 8 byte boundary. + // In older versions, it is necessary to set the offset correctly. + if (message_header.version.until_inclusive(1, 1)) + { + buffer.setOffset(message_header.getHeaderSize()); - buffer.buffer.reset(); - buffer.setOffset(new_offset); + // Get the position after the reply header would be written. + reply_header.write(buffer); - if (message_header.version.since_inclusive(1, 2)) - buffer.align(8); + int new_offset = message_header.getHeaderSize() + buffer.buffer.size(); - buffer.setVersion(message_header.version); - - buffer.setCodeSet(cxCodeSet.find(reply_header.service_context)); + buffer.buffer.reset(); + buffer.setOffset(new_offset); + } } } |

