public final class PipelineUtil
extends java.lang.Object
Constructor and Description |
---|
PipelineUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.Object> |
callDecode(io.netty.handler.codec.ByteToMessageDecoder decoder,
io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object input)
Call the decode method on a netty ByteToMessageDecoder
|
static java.util.List<java.lang.Object> |
callDecode(io.netty.handler.codec.MessageToMessageDecoder decoder,
io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg) |
static void |
callEncode(io.netty.handler.codec.MessageToByteEncoder encoder,
io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg,
io.netty.buffer.ByteBuf output)
Call the encode method on a netty MessageToByteEncoder
|
static boolean |
containsCause(java.lang.Throwable t,
java.lang.Class<?> c)
Check if a stack trace contains a certain exception
|
static <T> T |
getCause(java.lang.Throwable t,
java.lang.Class<T> c)
Check if a stack trace contains a certain exception and returns it if present.
|
static io.netty.channel.ChannelHandlerContext |
getContextBefore(java.lang.String name,
io.netty.channel.ChannelPipeline pipeline)
Get the context for a the channel handler before a certain name.
|
static io.netty.channel.ChannelHandlerContext |
getPreviousContext(java.lang.String name,
io.netty.channel.ChannelPipeline pipeline) |
public static java.util.List<java.lang.Object> callDecode(io.netty.handler.codec.ByteToMessageDecoder decoder, io.netty.channel.ChannelHandlerContext ctx, java.lang.Object input) throws java.lang.reflect.InvocationTargetException
decoder
- The decoderctx
- The current contextinput
- The packet to decodejava.lang.reflect.InvocationTargetException
- If an exception happens while executingpublic static void callEncode(io.netty.handler.codec.MessageToByteEncoder encoder, io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg, io.netty.buffer.ByteBuf output) throws java.lang.reflect.InvocationTargetException
encoder
- The encoderctx
- The current contextmsg
- The packet to encodeoutput
- The bytebuf to write the output tojava.lang.reflect.InvocationTargetException
- If an exception happens while executingpublic static java.util.List<java.lang.Object> callDecode(io.netty.handler.codec.MessageToMessageDecoder decoder, io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
public static boolean containsCause(java.lang.Throwable t, java.lang.Class<?> c)
t
- The throwablec
- The exception to look forpublic static <T> T getCause(java.lang.Throwable t, java.lang.Class<T> c)
t
- throwablec
- the exception to look forpublic static io.netty.channel.ChannelHandlerContext getContextBefore(java.lang.String name, io.netty.channel.ChannelPipeline pipeline)
name
- The name of the channel handlerpipeline
- The pipeline to targetpublic static io.netty.channel.ChannelHandlerContext getPreviousContext(java.lang.String name, io.netty.channel.ChannelPipeline pipeline)