Class HintedReplayingDecoder<S>
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.codec.ByteToMessageDecoder
-
- org.infinispan.client.hotrod.impl.transport.netty.HintedReplayingDecoder<S>
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
- Direct Known Subclasses:
HeaderDecoder
public abstract class HintedReplayingDecoder<S> extends io.netty.handler.codec.ByteToMessageDecoder
Copy-paste ofReplayingDecoder
which is hinted to not attempt decoding unless enough bytes are read. The decoder does not expect pass different message up the pipeline, this is a terminal read operation.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HintedReplayingDecoder()
Creates a new instance with no initial state (i.e:null
).protected
HintedReplayingDecoder(S initialState)
Creates a new instance with the specified initial state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
callDecode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, List<Object> xxx)
void
channelInactive(io.netty.channel.ChannelHandlerContext ctx)
protected void
checkpoint()
Stores the internal cumulative buffer's reader position.protected void
checkpoint(S state)
Stores the internal cumulative buffer's reader position and updates the current decoder state.protected S
state()
Returns the current state of this decoder.protected S
state(S newState)
Sets the current state of this decoder.-
Methods inherited from class io.netty.handler.codec.ByteToMessageDecoder
actualReadableBytes, channelRead, channelReadComplete, decode, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharable
-
-
-
-
Constructor Detail
-
HintedReplayingDecoder
protected HintedReplayingDecoder()
Creates a new instance with no initial state (i.e:null
).
-
HintedReplayingDecoder
protected HintedReplayingDecoder(S initialState)
Creates a new instance with the specified initial state.
-
-
Method Detail
-
checkpoint
protected void checkpoint()
Stores the internal cumulative buffer's reader position.
-
checkpoint
protected void checkpoint(S state)
Stores the internal cumulative buffer's reader position and updates the current decoder state.
-
state
protected S state()
Returns the current state of this decoder.- Returns:
- the current state of this decoder
-
state
protected S state(S newState)
Sets the current state of this decoder.- Returns:
- the old state of this decoder
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
- Specified by:
channelInactive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelInactive
in classio.netty.handler.codec.ByteToMessageDecoder
- Throws:
Exception
-
-