- 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.ChannelHandler
that convertsByteBuf
messages intoBuffer
messages, 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
Buffer
API, as that is more future-proof.Instances of this handler are
ChannelHandler.Sharable
and 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 class
BufferConversionHandler.Conversion
Deprecated.The particular conversion operation to apply.
-
Constructor Summary
Constructors Constructor Description BufferConversionHandler(BufferConversionHandler.Conversion conversion)
Deprecated.Create a conversion handler where incoming reads are passed through the given conversion, and outgoing writes are passed through its inverse.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 Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static BufferConversionHandler
bufferToByteBuf()
Deprecated.Create a conversion handler to insert afterBuffer
-reading handles, and beforeByteBuf
-reading handles.static BufferConversionHandler
byteBufToBuffer()
Deprecated.Create a conversion handler to insert afterByteBuf
-reading handles, and beforeBuffer
-reading handles.void
channelRead(io.netty5.channel.ChannelHandlerContext ctx, Object msg)
Deprecated.void
userEventTriggered(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 are passed through the given conversion, and outgoing writes are passed through its inverse.
-
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
-
bufferToByteBuf
public static BufferConversionHandler bufferToByteBuf()
Deprecated.Create a conversion handler to insert afterBuffer
-reading handles, and beforeByteBuf
-reading handles. For writes, the handler will convert in the opposite direction.- Returns:
- A conversion handler.
-
byteBufToBuffer
public static BufferConversionHandler byteBufToBuffer()
Deprecated.Create a conversion handler to insert afterByteBuf
-reading handles, and beforeBuffer
-reading handles. For writes, the handler will convert in the opposite direction.- Returns:
- A conversion handler.
-
channelRead
public void channelRead(io.netty5.channel.ChannelHandlerContext ctx, Object msg) throws Exception
Deprecated.- Specified by:
channelRead
in interfaceio.netty5.channel.ChannelHandler
- Throws:
Exception
-
userEventTriggered
public void userEventTriggered(io.netty5.channel.ChannelHandlerContext ctx, Object evt) throws Exception
Deprecated.- Specified by:
userEventTriggered
in interfaceio.netty5.channel.ChannelHandler
- Throws:
Exception
-
-