Class EndDelimitedProtocol
- java.lang.Object
-
- org.apache.synapse.transport.pipe.EndDelimitedProtocol
-
- All Implemented Interfaces:
Protocol
public class EndDelimitedProtocol extends Object implements Protocol
End delimited protocol implementation.In the end delimited protocol datagrams are encapsulated in the stream without modification. After each datagram an end byte is appended. Since datagrams may contain arbitrary byte sequences and no escape algorithm is defined, this protocol is only suitable if it can be assumed that the end byte never appears inside a datagram.
This protocol implementation is mainly useful with legacy protocols. For example, in conjunction with
PipeListenerandorg.apache.synapse.format.syslog.SyslogMessageBuilderit can be used to receive syslog events via a UNIX pipe. In this case the end byte is 10.This protocol recognizes a single mandatory parameter delimiter that must be configured in the transport and that specifies the end byte. The value must be given as an integer. An example transport receiver configuration looks like:
<transportReceiver name="pipe" class="org.apache.synapse.transport.pipe.PipeListener"> <parameter name="protocol">org.apache.synapse.transport.pipe.EndDelimitedProtocol</parameter> <parameter name="delimiter">10</parameter> </transportReceiver>
-
-
Constructor Summary
Constructors Constructor Description EndDelimitedProtocol()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProtocolDecodercreateProtocolDecoder()Create a new protocol decoder for this protocol implementation.bytegetDelimiter()voidinit(org.apache.axis2.description.ParameterInclude paramInclude)Initialize this protocol implementation using a given set of parameters.voidsetDelimiter(byte delimiter)
-
-
-
Method Detail
-
init
public void init(org.apache.axis2.description.ParameterInclude paramInclude) throws org.apache.axis2.AxisFaultDescription copied from interface:ProtocolInitialize this protocol implementation using a given set of parameters.
-
getDelimiter
public byte getDelimiter()
-
setDelimiter
public void setDelimiter(byte delimiter)
-
createProtocolDecoder
public ProtocolDecoder createProtocolDecoder()
Description copied from interface:ProtocolCreate a new protocol decoder for this protocol implementation.- Specified by:
createProtocolDecoderin interfaceProtocol- Returns:
- the protocol decoder
-
-