@XmlHints(allowTopLevelDefinition=true) public class CustomProtocol extends Object implements TcpProtocol, org.mule.runtime.api.lifecycle.Initialisable
| Modifier and Type | Field and Description |
|---|---|
String |
clazz
Reference to full qualifier class name that should extend
TcpProtocol that will be used as a custom protocol |
| Constructor and Description |
|---|
CustomProtocol() |
| Modifier and Type | Method and Description |
|---|---|
void |
initialise() |
InputStream |
read(InputStream is)
Reads the input stream and returns a whole message.
|
void |
write(OutputStream os,
Object data,
String encoding)
Write the specified message into the
OutputStream. |
@Parameter @Alias(value="class") @Summary(value="Full qualifier class name that must implement \'TcpProtocol\' that will be used as a custom protocol") @DisplayName(value="Protocol Class Name") public String clazz
TcpProtocol that will be used as a custom protocolpublic InputStream read(InputStream is) throws IOException
TcpProtocolread in interface TcpProtocolis - the input streamInputStream containing a full messageIOException - if an exception occurspublic void write(OutputStream os, Object data, String encoding) throws IOException
TcpProtocolOutputStream.write in interface TcpProtocolos - the OutputStream in which the data is going to be writtendata - data to be writtenencoding - in which the data will be serialized if its type is StringIOException - if an exception occurspublic void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.