public class XmlSocketUtility extends Object
Modifier and Type | Field and Description |
---|---|
protected static Sequencer |
stringEncoderSeq |
protected static Sequencer |
xmlFrameDecoderSeq |
protected static Sequencer |
xmlStringDecoderSeq |
Constructor and Description |
---|
XmlSocketUtility() |
Modifier and Type | Method and Description |
---|---|
static void |
addServer(org.apache.camel.CamelContext camelContext,
String serverUri,
boolean syncFlag,
String toUri,
String topLevelTagName,
Charset messageCharset,
int maxMessageBytes)
Creates a XML protocol based socket server in Camel.
在Camel中,创建一个基于XML的Socket接口服务器。 |
static String |
stripTopLevelTag(String xmlString)
Strips off the top level tag from XML string.
从XML字符串中去掉最上层的Tag。 |
protected static Sequencer xmlFrameDecoderSeq
protected static Sequencer xmlStringDecoderSeq
protected static Sequencer stringEncoderSeq
public static void addServer(org.apache.camel.CamelContext camelContext, String serverUri, boolean syncFlag, String toUri, String topLevelTagName, Charset messageCharset, int maxMessageBytes) throws Exception
camelContext
- CamelContext which must be based on CombinedRegistry, because additional entries must
be added to the Registry.serverUri
- URI of the socket server which will be used by Camel Netty component
to create an Endpoint.For example: tcp://localhost:9000
syncFlag
- The sync parameter that will be send to Camel Netty component,
true means sync and false means async.toUri
- The Pipe that receives the messages, usually it should be either direct or seda.topLevelTagName
- Name of the top level tag that will be used to find the boundaries of XML messages.messageCharset
- Charset that the XML messages received are supposed to be encoded in.maxMessageBytes
- The maximum possible length of the XML messages received.Exception
- Exception if the routes could not be created for whatever reasonCopyright © 2014. All Rights Reserved.