org.mule.providers.tcp.protocols
Class MuleMessageProtocol

java.lang.Object
  extended by org.mule.providers.tcp.protocols.ByteProtocol
      extended by org.mule.providers.tcp.protocols.DefaultProtocol
          extended by org.mule.providers.tcp.protocols.MuleMessageProtocol
All Implemented Interfaces:
TcpProtocol

public class MuleMessageProtocol
extends DefaultProtocol

This Protocol will send the actual Mule Message over the TCP channel, and in this way we are preserving any headers which might be needed, for example Correlation IDs in order to be able to aggregate messages after chunking. Data are read until no more are (momentarily) available.


Field Summary
 
Fields inherited from class org.mule.providers.tcp.protocols.ByteProtocol
EOF, NO_STREAM, STREAM_OK
 
Constructor Summary
MuleMessageProtocol()
           
 
Method Summary
 Object read(InputStream is)
          Reads the input stream and returns a whole message.
 void write(OutputStream os, byte[] data)
           
 
Methods inherited from class org.mule.providers.tcp.protocols.DefaultProtocol
isRepeat, read
 
Methods inherited from class org.mule.providers.tcp.protocols.ByteProtocol
copy, copy, nullEmptyArray, safeRead, safeRead, write, writeByteArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MuleMessageProtocol

public MuleMessageProtocol()
Method Detail

read

public Object read(InputStream is)
            throws IOException
Description copied from interface: TcpProtocol
Reads the input stream and returns a whole message.

Specified by:
read in interface TcpProtocol
Overrides:
read in class DefaultProtocol
Parameters:
is - the input stream
Returns:
an array of byte containing a full message
Throws:
IOException - if an exception occurs

write

public void write(OutputStream os,
                  byte[] data)
           throws IOException
Throws:
IOException


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.