Package org.infinispan.server.hotrod
Class HotRodDecoder
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.codec.ByteToMessageDecoder
-
- org.infinispan.server.hotrod.HotRodDecoder
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
public class HotRodDecoder extends io.netty.handler.codec.ByteToMessageDecoder
-
-
Field Summary
Fields Modifier and Type Field Description protected Authentication
auth
protected EmbeddedCacheManager
cacheManager
protected org.infinispan.server.hotrod.TransactionRequestProcessor
cacheProcessor
protected org.infinispan.server.hotrod.CounterRequestProcessor
counterProcessor
protected Executor
executor
protected static org.infinispan.server.hotrod.logging.Log
log
protected org.infinispan.server.hotrod.MultimapRequestProcessor
multimapProcessor
protected HotRodServer
server
protected TaskRequestProcessor
taskProcessor
protected static boolean
trace
-
Constructor Summary
Constructors Constructor Description HotRodDecoder(EmbeddedCacheManager cacheManager, Executor executor, HotRodServer server)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> List<T>
allocList(int size)
protected <K,V>
Map<K,V>allocMap(int size)
We usually know the size of the map ahead, and we want to return static empty map if we're not going to add anything.protected <T> Set<T>
allocSet(int size)
void
channelActive(io.netty.channel.ChannelHandlerContext ctx)
void
channelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx)
void
decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf buf, List<Object> out)
protected int
defaultExpiration(int duration, int flags, ProtocolFlag defaultFlag)
void
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable t)
Executor
getExecutor()
protected HotRodHeader
getHeader()
void
handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
protected void
handlerRemoved0(io.netty.channel.ChannelHandlerContext ctx)
int
requestBytes()
-
Methods inherited from class io.netty.handler.codec.ByteToMessageDecoder
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
-
-
-
-
Field Detail
-
log
protected static final org.infinispan.server.hotrod.logging.Log log
-
trace
protected static final boolean trace
-
cacheManager
protected final EmbeddedCacheManager cacheManager
-
executor
protected final Executor executor
-
server
protected final HotRodServer server
-
auth
protected Authentication auth
-
cacheProcessor
protected org.infinispan.server.hotrod.TransactionRequestProcessor cacheProcessor
-
counterProcessor
protected org.infinispan.server.hotrod.CounterRequestProcessor counterProcessor
-
multimapProcessor
protected org.infinispan.server.hotrod.MultimapRequestProcessor multimapProcessor
-
taskProcessor
protected TaskRequestProcessor taskProcessor
-
-
Constructor Detail
-
HotRodDecoder
public HotRodDecoder(EmbeddedCacheManager cacheManager, Executor executor, HotRodServer server)
-
-
Method Detail
-
getHeader
protected HotRodHeader getHeader()
-
decode
public void decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf buf, List<Object> out) throws Exception
- Specified by:
decode
in classio.netty.handler.codec.ByteToMessageDecoder
- Throws:
Exception
-
requestBytes
public int requestBytes()
-
getExecutor
public Executor getExecutor()
-
handlerAdded
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
handlerAdded
in interfaceio.netty.channel.ChannelHandler
- Overrides:
handlerAdded
in classio.netty.channel.ChannelHandlerAdapter
-
handlerRemoved0
protected void handlerRemoved0(io.netty.channel.ChannelHandlerContext ctx) throws Exception
- Overrides:
handlerRemoved0
in classio.netty.handler.codec.ByteToMessageDecoder
- Throws:
Exception
-
channelActive
public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
- Specified by:
channelActive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelActive
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
channelWritabilityChanged
public void channelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx) throws Exception
- Specified by:
channelWritabilityChanged
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelWritabilityChanged
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable t) throws Exception
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelHandler
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
exceptionCaught
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
defaultExpiration
protected int defaultExpiration(int duration, int flags, ProtocolFlag defaultFlag)
-
allocMap
protected <K,V> Map<K,V> allocMap(int size)
We usually know the size of the map ahead, and we want to return static empty map if we're not going to add anything.
-
allocList
protected <T> List<T> allocList(int size)
-
allocSet
protected <T> Set<T> allocSet(int size)
-
-