TcpProtocol (Mule ESB 2.2.1 API)
Keywords: org.mule.transport.tcp.TcpProtocol interface

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.transport.tcp
Interface TcpProtocol

All Known Implementing Classes:
  AbstractByteProtocol, DirectProtocol, EOFProtocol, LengthProtocol, MuleMessageDirectProtocol, MuleMessageEOFProtocol, MuleMessageLengthProtocol, MuleMessageSafeProtocol, SafeProtocol, StreamingProtocol, XmlMessageEOFProtocol, XmlMessageProtocol

    public interface TcpProtocol

The TcpProtocol interface enables to plug different application level protocols on a TcpConnector. Note that this interface has lost the direct byte array write method. Standard callers should (and will, since it matches the same signature, which is why the method has not been deprecated) use the generic method instead..

Method Summary
`ResponseOutputStream` | `createResponse(Socket socket)` This lets protocols encode a response stream.
`Object` | `read(InputStream is)` Reads the input stream and returns a whole message.
`void` | `write(OutputStream os, Object data)` Write the specified message to the output stream.

Method Detail

### read

    Object read(InputStream is)
                throws IOException

  Reads the input stream and returns a whole message.

  Parameters:
    `is` - the input stream
  Returns:
    an array of byte containing a full message
  Throws:
    `IOException` - if an exception occurs

### write

    void write(OutputStream os,
               Object data)
               throws IOException

  Write the specified message to the output stream.

  Parameters:
    `os` - the output stream to write to
    `data` - the data to write
  Throws:
    `IOException` - if an exception occurs

### createResponse

    ResponseOutputStream createResponse(Socket socket)
                                        throws IOException

  This lets protocols encode a response stream. If the protocol does not support a response stream (ie does not support streaming) then the stream should thrown an exception when used.

  Parameters:
    `socket` - The destination to write to
  Returns:
    A stream whose output will be encoded
  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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