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 Authenticationauthprotected EmbeddedCacheManagercacheManagerprotected org.infinispan.server.hotrod.TransactionRequestProcessorcacheProcessorprotected org.infinispan.server.hotrod.CounterRequestProcessorcounterProcessorprotected java.util.concurrent.Executorexecutorprotected static org.infinispan.server.hotrod.logging.Loglogprotected org.infinispan.server.hotrod.MultimapRequestProcessormultimapProcessorprotected HotRodServerserverprotected TaskRequestProcessortaskProcessorprotected static booleantrace
-
Constructor Summary
Constructors Constructor Description HotRodDecoder(EmbeddedCacheManager cacheManager, java.util.concurrent.Executor executor, HotRodServer server)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> java.util.List<T>allocList(int size)protected <K,V>
java.util.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> java.util.Set<T>allocSet(int size)voidchannelActive(io.netty.channel.ChannelHandlerContext ctx)voidchannelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx)voiddecode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf buf, java.util.List<java.lang.Object> out)protected intdefaultExpiration(int duration, int flags, ProtocolFlag defaultFlag)voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable t)java.util.concurrent.ExecutorgetExecutor()protected HotRodHeadergetHeader()voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx)intrequestBytes()-
Methods inherited from class io.netty.handler.codec.ByteToMessageDecoder
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, 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 java.util.concurrent.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, java.util.concurrent.Executor executor, HotRodServer server)
-
-
Method Detail
-
getHeader
protected HotRodHeader getHeader()
-
decode
public void decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf buf, java.util.List<java.lang.Object> out) throws java.lang.Exception- Specified by:
decodein classio.netty.handler.codec.ByteToMessageDecoder- Throws:
java.lang.Exception
-
requestBytes
public int requestBytes()
-
getExecutor
public java.util.concurrent.Executor getExecutor()
-
handlerAdded
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classio.netty.channel.ChannelHandlerAdapter
-
channelActive
public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception- Specified by:
channelActivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelActivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
channelWritabilityChanged
public void channelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception- Specified by:
channelWritabilityChangedin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelWritabilityChangedin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable t) throws java.lang.Exception- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
defaultExpiration
protected int defaultExpiration(int duration, int flags, ProtocolFlag defaultFlag)
-
allocMap
protected <K,V> java.util.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> java.util.List<T> allocList(int size)
-
allocSet
protected <T> java.util.Set<T> allocSet(int size)
-
-