|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.net.msg.MessageHead | +--gumbo.net.msg.ascii.AsciiMessageHead
Subclass of MessageHead containing all aspects of ASCII transport of a message head.
When a message is received via ASCII transport its type is unknown until the head is read. Once the head is read, a message object of the type specified by the head can be created (using the factory method in the AsciiMessage class), and the rest of the message, i.e. the body (parameters and data), can then be read from the stream by that message object.
Field Summary |
Fields inherited from class gumbo.net.msg.MessageHead |
_bodyVersion, _headVersion, _messageType, _sourceTime, _targetTime, HEAD_VERSION |
Constructor Summary | |
AsciiMessageHead(AsciiMessageReader reader)
Constructs a head and initializes its contents by reading a complete message head unit from a message reader. |
|
AsciiMessageHead(java.lang.String messageType,
java.lang.String bodyVersion)
Constructs a head that is empty except for the head version, message type, and body version. |
Method Summary | |
AsciiMessageReader |
getAsciiReader()
Gets the message reader for this head. |
AsciiMessageWriter |
getAsciiWriter()
Gets the message writer for this head. |
void |
readAsciiHead(AsciiMessageReader reader)
Sets the reader and reads this head as a complete message head unit from a message reader. |
void |
writeAsciiHead(AsciiMessageWriter writer,
java.lang.String bodyVersion)
Sets the writer and writes this head as a complete message head unit to a message writer. |
Methods inherited from class gumbo.net.msg.MessageHead |
afterHeadRead, beforeHeadWrite, getBodyVersion, getHeadVersion, getMessageType, getSourceTime, getTargetTime, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AsciiMessageHead(AsciiMessageReader reader) throws java.io.IOException, MessageIOException
MessageIOException
- Reader not at message head, or bad message
head format.
java.io.IOException
public AsciiMessageHead(java.lang.String messageType, java.lang.String bodyVersion)
messageType
- Fully qualified java class name of the message.
Never null.bodyVersion
- Message body version. Never null.Method Detail |
public void readAsciiHead(AsciiMessageReader reader) throws java.io.IOException, MessageIOException
MessageIOException
- Reader not at message head, or bad message
head format.
java.io.IOException
public void writeAsciiHead(AsciiMessageWriter writer, java.lang.String bodyVersion) throws java.io.IOException, MessageIOException
writer
- The message writer. Never null.bodyVersion
- The version of the message body data. Never null.
java.io.IOException
- No writer.
MessageIOException
- Writer not at message head.public AsciiMessageReader getAsciiReader()
public AsciiMessageWriter getAsciiWriter()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |