|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.net.msg.AbstractMessageIO | +--gumbo.net.msg.ObjectMessageWriter
Writes a message as a Java object to an object stream. Note that the output stream is reset before and flushed after writing a message. This assures that a message is always sent in its entirety even if it or a component was previously sent (and in the cache), and that the message is immediately received and available in its entirety at the receiver.
Constructor Summary | |
ObjectMessageWriter(java.io.ObjectOutputStream stream)
|
Method Summary | |
void |
close()
Closes this writer. |
void |
flush()
Flushes this writer. |
void |
writeMessage(Message msg)
Resets the output stream before writing the message, and flushes the output stream after writing the message. |
void |
writeMessageEnd()
Writes the message end delimiter. |
Methods inherited from class gumbo.net.msg.AbstractMessageIO |
addMessageIOListener, fireMessageRead, fireMessageWrite, getMessageIOListeners, removeMessageIOListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gumbo.net.msg.MessageIO |
addMessageIOListener, getMessageIOListeners, removeMessageIOListener |
Constructor Detail |
public ObjectMessageWriter(java.io.ObjectOutputStream stream)
Method Detail |
public void writeMessageEnd() throws java.io.IOException, MessageIOException
java.io.IOException
- Reader is closed.
MessageIOException
- Message end object is ill-formed.public void flush() throws java.io.IOException
MessageWriter
flush
in interface MessageWriter
java.io.IOException
public void close() throws java.io.IOException
MessageWriter
close
in interface MessageWriter
java.io.IOException
public void writeMessage(Message msg) throws java.io.IOException, MessageIOException, MessageDataException
writeMessage
in interface MessageWriter
MessageDataException
- Message is ill-formed for writing.
java.io.IOException
- Writer is closed.
MessageIOException
- Message stream is out of sync.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |