public final class NettyHelper extends Object
Modifier and Type | Method and Description |
---|---|
static void |
close(io.netty.channel.Channel channel)
Closes the given channel asynchronously
|
static io.netty.util.concurrent.EventExecutorGroup |
createExecutorGroup(org.apache.camel.CamelContext camelContext,
String name,
int threads)
Creates a
DefaultEventExecutorGroup with the given name and maximum thread pool size. |
static String |
getTextlineBody(Object body,
org.apache.camel.Exchange exchange,
TextLineDelimiter delimiter,
boolean autoAppendDelimiter)
Gets the string body to be used when sending with the textline codec.
|
static void |
writeBodyAsync(org.slf4j.Logger log,
io.netty.channel.Channel channel,
SocketAddress remoteAddress,
Object body,
org.apache.camel.Exchange exchange,
io.netty.channel.ChannelFutureListener listener)
Writes the given body to Netty channel.
|
public static String getTextlineBody(Object body, org.apache.camel.Exchange exchange, TextLineDelimiter delimiter, boolean autoAppendDelimiter) throws org.apache.camel.NoTypeConversionAvailableException
body
- the current bodyexchange
- the exchangedelimiter
- the textline delimiterautoAppendDelimiter
- whether absent delimiter should be auto appendedorg.apache.camel.NoTypeConversionAvailableException
- is thrown if the current body could not be converted to a String typepublic static void writeBodyAsync(org.slf4j.Logger log, io.netty.channel.Channel channel, SocketAddress remoteAddress, Object body, org.apache.camel.Exchange exchange, io.netty.channel.ChannelFutureListener listener)
log
- logger to usechannel
- the Netty channelremoteAddress
- the remote address when using UDPbody
- the body to write (send)exchange
- the exchangelistener
- listener with work to be executed when the operation is completepublic static void close(io.netty.channel.Channel channel)
channel
- the channel to closepublic static io.netty.util.concurrent.EventExecutorGroup createExecutorGroup(org.apache.camel.CamelContext camelContext, String name, int threads)
DefaultEventExecutorGroup
with the given name and maximum thread pool size.Apache Camel