|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.mule.providers.tcp.protocols.XmlMessageProtocol
The XmlMessageProtocol is an application level tcp protocol that can be used to read streaming xml documents. The only requirement is that each document include an xml declaration at the beginning of the document of the form "SHOULD begin with an XML declaration which specifies the version of XML being used" while the xml 1.1 standard contains "Definition: XML 1.1 documents MUST begin with an XML declaration which specifies the version of XML being used". The SHOULD indicates a recommendation that, if not followed, needs to be carefully checked for unintended consequences. MUST indicates a mandatory requirement for a well-formed document. Please make sure that the xml documents being streamed begin with an xml declaration when using this class.
Also, the default character encoding for the platform is used to decode the message bytes when looking for the XML declaration. Some caution with message character encodings is warranted.
Finally, this class uses a PushbackInputStream to enable parsing of individual messages. The stream stores any pushed-back bytes into it's own internal buffer and not the original stream. Therefore, the read buffer size is intentionally limited to insure that unread characters remain on the stream so that all data may be read later.
| Constructor Summary | |
XmlMessageProtocol()
|
|
| Method Summary | |
byte[] |
read(InputStream is)
Adapted from DefaultProtocol |
void |
write(OutputStream os,
byte[] data)
Write the specified message to the output stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XmlMessageProtocol()
| Method Detail |
public byte[] read(InputStream is)
throws IOException
read in interface TcpProtocolis - the input stream
IOException - if an exception occursDefaultProtocol.read(java.io.InputStream)
public void write(OutputStream os,
byte[] data)
throws IOException
TcpProtocol
write in interface TcpProtocolos - the output stream to write todata - the data to write
IOException - if an exception occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||