gumbo.net.msg
Interface MessageWriter

All Superinterfaces:
MessageIO
All Known Implementing Classes:
AsciiMessageWriter, ObjectMessageWriter

public interface MessageWriter
extends MessageIO

Interface for writing whole messages.

Version:
$Revision: 1.6 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Method Summary
 void close()
          Closes this writer.
 void flush()
          Flushes this writer.
 void writeMessage(Message msg)
          Writes a message, including its end delimiter, in a thread-safe manner.
 
Methods inherited from interface gumbo.net.msg.MessageIO
addMessageIOListener, getMessageIOListeners, removeMessageIOListener
 

Method Detail

flush

public void flush()
           throws java.io.IOException
Flushes this writer.

java.io.IOException

close

public void close()
           throws java.io.IOException
Closes this writer.

java.io.IOException

writeMessage

public void writeMessage(Message msg)
                  throws java.io.IOException,
                         MessageIOException,
                         MessageDataException
Writes a message, including its end delimiter, in a thread-safe manner. Blocks until the message is completely sent. Typically, this method is synchronized on this message writer, which is used by all threads in the application to send messages.

Throws:
java.io.IOException - Writer is closed.
MessageIOException - Message stream is out of sync.
MessageDataException - Message is ill-formed for writing.