gnu.CORBA.GIOP
Class MessageHeader
- IDLEntity, Serializable
The GIOP message header.
static byte | CANCEL_REQUEST - Cancel request message.
|
static byte | CLOSE_CONNECTION - Instruction to close the connection.
|
static byte | FRAGMENT - The fragment messge, following the previous message that has more fragments
flag set.
|
static byte | LOCATE_REPLY - Locate reply message, sent in response to the
MessageHeader
message.
|
static byte | LOCATE_REQUEST - Locate request message, used to check the server ability to process
requests for the object reference.
|
static byte[] | MAGIC - This must always be "GIOP".
|
static byte | MESSAGE_ERROR - Error report.
|
static byte | REPLY - Reply message
|
static byte | REQUEST - Request message.
|
byte | flags - The flags field, introduced since GIOP 1.1.
|
int | message_size - The message size, excluding the message header.
|
byte | message_type - The message type.
|
protected static String[] | types - The message type names.
|
Version | version - The GIOP version.
|
MessageHeader() - Create an empty message header, corresponding version 1.0.
|
MessageHeader(int major, int minor) - Create an empty message header, corresponding the given version.
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
CANCEL_REQUEST
public static final byte CANCEL_REQUEST
Cancel request message.
CLOSE_CONNECTION
public static final byte CLOSE_CONNECTION
Instruction to close the connection.
FRAGMENT
public static final byte FRAGMENT
The fragment messge, following the previous message that has more fragments
flag set. Added in GIOP 1.1
LOCATE_REPLY
public static final byte LOCATE_REPLY
Locate reply message, sent in response to the MessageHeader
message.
LOCATE_REQUEST
public static final byte LOCATE_REQUEST
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.
MAGIC
public static final byte[] MAGIC
This must always be "GIOP".
MESSAGE_ERROR
public static final byte MESSAGE_ERROR
Error report.
REPLY
public static final byte REPLY
Reply message
REQUEST
public static final byte REQUEST
Request message.
flags
public byte flags
The flags field, introduced since GIOP 1.1.
message_size
public int message_size
The message size, excluding the message header.
types
protected static String[] types
The message type names.
MessageHeader
public MessageHeader()
Create an empty message header, corresponding version 1.0.
MessageHeader
public MessageHeader(int major,
int minor)
Create an empty message header, corresponding the given version.
major
- the major message header version.minor
- the minot message header version.
getHeaderSize
public int getHeaderSize()
Get the size of the message header itself. So far, it is always 12 bytes.
getTypeString
public String getTypeString(int type)
Get the message type as string.
type
- the message type as int (the field message_type
).
- the message type as string.
isBigEndian
public boolean isBigEndian()
Checks if the message is encoded in the Big Endian, most significant byte
first.
moreFragmentsFollow
public boolean moreFragmentsFollow()
Checks if the message is partial, and more subsequent fragments follow.
readMessage
public byte[] readMessage(InputStream source,
Socket service,
int to_read,
int to_pause)
Read data, followed by the message header. Handle fragmented messages.
source
- the data source to read from.service
- the socket on that the time outs are set. Can be null (no
timeouts are set).to_read
- the timeout while reading the message.to_pause
- the timeout for pauses between the message parts.
setBigEndian
public void setBigEndian(boolean use_big_endian)
Set the encoding to use.
use_big_endian
- if true (default), the Big Endian encoding is used.
If false, the Little Endian encoding is used.
write
public void write(OutputStream out)
Write the header to stream.
out
- a stream to write into.
MessageHeader.java -- GIOP message header.
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.