Package io.netty5.handler.adaptor
Class BufferConversionHandler
- java.lang.Object
-
- io.netty5.handler.adaptor.BufferConversionHandler
-
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
@Deprecated @Sharable public final class BufferConversionHandler extends Object implements io.netty5.channel.ChannelHandler
Deprecated.This handler will be moved out of Netty core and into a contrib repository, before Netty 5.0.0.Final is released.ChannelHandlerthat convertsByteBufmessages intoBuffermessages, and vice versa, depending on configuration.This class is useful as an intermediate handler that allows
ByteBuf-based handlers andBuffer-based handlers to work together in the same pipeline.It is, however, recommended that all handlers eventually be converted to use the
BufferAPI, as that is more future-proof.Instances of this handler are
ChannelHandler.Sharableand can be added to multiple pipelines. This is safe because the instances are immutable and thread-safe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBufferConversionHandler.ConversionDeprecated.The particular conversion operation to apply.
-
Constructor Summary
Constructors Constructor Description BufferConversionHandler(BufferConversionHandler.Conversion conversion)Deprecated.Create a conversion handler where incoming reads, and outgoing writes, are passed through the given conversion.BufferConversionHandler(BufferConversionHandler.Conversion onRead, BufferConversionHandler.Conversion onWrite)Deprecated.Create a conversion handler where incoming reads, and outgoing writes, are passed through their configured conversions.BufferConversionHandler(BufferConversionHandler.Conversion onRead, BufferConversionHandler.Conversion onWrite, BufferConversionHandler.Conversion onUserEvent)Deprecated.Create a conversion handler where incoming reads, outgoing writes, and user events, are passed through their configured conversions.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidchannelRead(io.netty5.channel.ChannelHandlerContext ctx, Object msg)Deprecated.voiduserEventTriggered(io.netty5.channel.ChannelHandlerContext ctx, Object evt)Deprecated.io.netty5.util.concurrent.Future<Void>write(io.netty5.channel.ChannelHandlerContext ctx, Object msg)Deprecated.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.ChannelHandler
bind, channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, exceptionCaught, flush, handlerAdded, handlerRemoved, read, register
-
-
-
-
Constructor Detail
-
BufferConversionHandler
public BufferConversionHandler(BufferConversionHandler.Conversion conversion)
Deprecated.Create a conversion handler where incoming reads, and outgoing writes, are passed through the given conversion.
-
BufferConversionHandler
public BufferConversionHandler(BufferConversionHandler.Conversion onRead, BufferConversionHandler.Conversion onWrite)
Deprecated.Create a conversion handler where incoming reads, and outgoing writes, are passed through their configured conversions.- Parameters:
onRead- The conversion to apply to all incoming read messages.onWrite- The conversion to apply to all outgoing write(ChannelHandlerContext, Object) messages.
-
BufferConversionHandler
public BufferConversionHandler(BufferConversionHandler.Conversion onRead, BufferConversionHandler.Conversion onWrite, BufferConversionHandler.Conversion onUserEvent)
Deprecated.Create a conversion handler where incoming reads, outgoing writes, and user events, are passed through their configured conversions.- Parameters:
onRead- The conversion to apply to all incoming read messages.onWrite- The conversion to apply to all outgoing write(ChannelHandlerContext, Object) messages.onUserEvent- The conversion to apply to all incoming user events.
-
-
Method Detail
-
channelRead
public void channelRead(io.netty5.channel.ChannelHandlerContext ctx, Object msg) throws ExceptionDeprecated.- Specified by:
channelReadin interfaceio.netty5.channel.ChannelHandler- Throws:
Exception
-
userEventTriggered
public void userEventTriggered(io.netty5.channel.ChannelHandlerContext ctx, Object evt) throws ExceptionDeprecated.- Specified by:
userEventTriggeredin interfaceio.netty5.channel.ChannelHandler- Throws:
Exception
-
-