Package org.infinispan.server.resp
Class BaseRespDecoder
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.ByteToMessageDecoder
org.infinispan.server.resp.BaseRespDecoder
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
- Direct Known Subclasses:
RespDecoder
public abstract class BaseRespDecoder
extends io.netty.handler.codec.ByteToMessageDecoder
-
Nested Class Summary
Nested classes/interfaces inherited from class io.netty.handler.codec.ByteToMessageDecoder
io.netty.handler.codec.ByteToMessageDecoder.CumulatorNested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Logprotected final org.infinispan.server.resp.Intrinsics.Resp2LongProcessorprotected static final intprotected io.netty.buffer.ByteBufprotected RespRequestHandlerprotected booleanFields inherited from class io.netty.handler.codec.ByteToMessageDecoder
COMPOSITE_CUMULATOR, MERGE_CUMULATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected io.netty.buffer.ByteBufallocateBuffer(io.netty.channel.ChannelHandlerContext ctx, int size) protected voidattemptReadResume(io.netty.channel.ChannelHandlerContext ctx) voidchannelReadComplete(io.netty.channel.ChannelHandlerContext ctx) voidchannelRegistered(io.netty.channel.ChannelHandlerContext ctx) voidchannelUnregistered(io.netty.channel.ChannelHandlerContext ctx) voidchannelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx) voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) protected booleanhandleCommandAndArguments(io.netty.channel.ChannelHandlerContext ctx, RespCommand command, List<byte[]> arguments) Handles the actual command request.Methods inherited from class io.netty.handler.codec.ByteToMessageDecoder
actualReadableBytes, callDecode, channelInactive, channelRead, decode, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActiveMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded
-
Field Details
-
log
-
MINIMUM_BUFFER_SIZE
protected static final int MINIMUM_BUFFER_SIZE -
longProcessor
protected final org.infinispan.server.resp.Intrinsics.Resp2LongProcessor longProcessor -
requestHandler
-
outboundBuffer
protected io.netty.buffer.ByteBuf outboundBuffer -
resumeAutoReadOnWritability
protected boolean resumeAutoReadOnWritability
-
-
Constructor Details
-
BaseRespDecoder
public BaseRespDecoder()
-
-
Method Details
-
allocateBuffer
protected io.netty.buffer.ByteBuf allocateBuffer(io.netty.channel.ChannelHandlerContext ctx, int size) -
channelRegistered
- Specified by:
channelRegisteredin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelRegisteredin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
channelUnregistered
- Specified by:
channelUnregisteredin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelUnregisteredin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
channelReadComplete
- Specified by:
channelReadCompletein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadCompletein classio.netty.handler.codec.ByteToMessageDecoder- Throws:
Exception
-
channelWritabilityChanged
- Specified by:
channelWritabilityChangedin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelWritabilityChangedin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
attemptReadResume
protected void attemptReadResume(io.netty.channel.ChannelHandlerContext ctx) -
handleCommandAndArguments
protected boolean handleCommandAndArguments(io.netty.channel.ChannelHandlerContext ctx, RespCommand command, List<byte[]> arguments) Handles the actual command request. This entails passing the command to the request handler and if the request is completed the decoder may parse more commands.- Parameters:
ctx- channel context in use for this commandcommand- the actual commandarguments- the arguments provided to the command. The list should not be retained as it is reused- Returns:
- boolean whether the decoder can read more bytes or must wait
-
exceptionCaught
- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter
-