java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.MessageToMessageDecoder<RQ>
stincmale.server.netty4.RequestMetadataDecoder<RQ>
- Type Parameters:
RQ
- A type of the request thisChannelInboundHandlerAdapter
expects.
- All Implemented Interfaces:
ChannelHandler
,ChannelInboundHandler
@Sharable @ThreadSafe public abstract class RequestMetadataDecoder<RQ> extends MessageToMessageDecoder<RQ>
A
MessageToMessageDecoder
that wraps messages of type RQ
into messages of type
RequestWithMetadata
<RQ>
.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
Constructor Summary
Constructors Modifier Constructor Description protected
RequestMetadataDecoder()
-
Method Summary
Modifier and Type Method Description protected abstract Metadata
createMetadata(ChannelHandlerContext ctx, RQ request)
Is called fromdecode(ChannelHandlerContext, Object, List)
.protected void
decode(ChannelHandlerContext ctx, RQ request, List<Object> out)
Methods inherited from class io.netty.handler.codec.MessageToMessageDecoder
acceptInboundMessage, channelRead
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
Constructor Details
-
RequestMetadataDecoder
protected RequestMetadataDecoder()
-
-
Method Details
-
decode
protected final void decode(ChannelHandlerContext ctx, RQ request, List<Object> out) throws Exception- Specified by:
decode
in classMessageToMessageDecoder<RQ>
- Parameters:
request
- Note that ReferenceCountUtil.retain(java.lang.Object) is called for themsg
. This method automatically callsretain
on therequest
.- Throws:
Exception
-
createMetadata
Is called fromdecode(ChannelHandlerContext, Object, List)
.
-