org.mule.transport.tcp.protocols
Class SafeProtocol
java.lang.Object
org.mule.transport.tcp.protocols.SafeProtocol
- All Implemented Interfaces:
- TcpProtocol
- Direct Known Subclasses:
- MuleMessageSafeProtocol
public class SafeProtocol
- extends Object
- implements TcpProtocol
This precedes every message with a cookie.
It should probably not be used in production.
We use ths protocol as the default because previously people tended to use DefaultProtocol without considering packet fragmentation etc.
You should probably change to LengthProtocol.
Remember - both sender and receiver must use the same protocol.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COOKIE
public static final String COOKIE
- See Also:
- Constant Field Values
SafeProtocol
public SafeProtocol()
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
- 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,
Object data)
throws IOException
- Description copied from interface:
TcpProtocol
- Write the specified message to the output stream.
- Specified by:
write
in interface TcpProtocol
- Parameters:
os
- the output stream to write todata
- the data to write
- Throws:
IOException
- if an exception occurs
createResponse
public ResponseOutputStream createResponse(Socket socket)
throws IOException
- Description copied from interface:
TcpProtocol
- 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.
- Specified by:
createResponse
in interface TcpProtocol
- Parameters:
socket
- The destination to write to
- Returns:
- A stream whose output will be encoded
- Throws:
IOException
setMaxMessageLength
public void setMaxMessageLength(int maxMessageLength)
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.