public class PipelineUtil extends Object
Constructor and Description |
---|
PipelineUtil() |
Modifier and Type | Method and Description |
---|---|
static List<Object> |
callDecode(io.netty.handler.codec.ByteToMessageDecoder decoder,
io.netty.channel.ChannelHandlerContext ctx,
Object input)
Call the decode method on a netty ByteToMessageDecoder
|
static List<Object> |
callDecode(io.netty.handler.codec.MessageToMessageDecoder decoder,
io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
static void |
callEncode(io.netty.handler.codec.MessageToByteEncoder encoder,
io.netty.channel.ChannelHandlerContext ctx,
Object msg,
io.netty.buffer.ByteBuf output)
Call the encode method on a netty MessageToByteEncoder
|
static boolean |
containsCause(Throwable t,
Class<?> c)
Check if a stack trace contains a certain exception
|
static io.netty.channel.ChannelHandlerContext |
getContextBefore(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(String name,
io.netty.channel.ChannelPipeline pipeline) |
public static List<Object> callDecode(io.netty.handler.codec.ByteToMessageDecoder decoder, io.netty.channel.ChannelHandlerContext ctx, Object input) throws InvocationTargetException
decoder
- The decoderctx
- The current contextinput
- The packet to decodeInvocationTargetException
- If an exception happens while executingpublic static void callEncode(io.netty.handler.codec.MessageToByteEncoder encoder, io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.buffer.ByteBuf output) throws InvocationTargetException
encoder
- The encoderctx
- The current contextmsg
- The packet to encodeoutput
- The bytebuf to write the output toInvocationTargetException
- If an exception happens while executingpublic static List<Object> callDecode(io.netty.handler.codec.MessageToMessageDecoder decoder, io.netty.channel.ChannelHandlerContext ctx, Object msg) throws InvocationTargetException
InvocationTargetException
public static boolean containsCause(Throwable t, Class<?> c)
t
- The throwablec
- The exception to look forpublic static io.netty.channel.ChannelHandlerContext getContextBefore(String name, io.netty.channel.ChannelPipeline pipeline)
name
- The name of the channel handlerpipeline
- The pipeline to targetpublic static io.netty.channel.ChannelHandlerContext getPreviousContext(String name, io.netty.channel.ChannelPipeline pipeline)
Copyright © 2016–2021. All rights reserved.