public class CommandHandler<K,V>
extends org.jboss.netty.channel.SimpleChannelHandler
ChannelHandler
responsible for writing redis commands and
reading responses from the server.Modifier and Type | Field and Description |
---|---|
protected org.jboss.netty.buffer.ChannelBuffer |
buffer |
protected BlockingQueue<Command<K,V,?>> |
queue |
protected RedisStateMachine<K,V> |
rsm |
Constructor and Description |
---|
CommandHandler(BlockingQueue<Command<K,V,?>> queue)
Initialize a new instance that handles commands from the supplied queue.
|
Modifier and Type | Method and Description |
---|---|
void |
channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e) |
protected void |
decode(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.buffer.ChannelBuffer buffer) |
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e) |
void |
writeRequested(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e) |
bindRequested, channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelUnbound, childChannelClosed, childChannelOpen, closeRequested, connectRequested, disconnectRequested, exceptionCaught, handleDownstream, handleUpstream, setInterestOpsRequested, unbindRequested, writeComplete
protected BlockingQueue<Command<K,V,?>> queue
protected org.jboss.netty.buffer.ChannelBuffer buffer
protected RedisStateMachine<K,V> rsm
public CommandHandler(BlockingQueue<Command<K,V,?>> queue)
queue
- The command queue.public void channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e) throws Exception
channelOpen
in class org.jboss.netty.channel.SimpleChannelHandler
Exception
public void writeRequested(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent e) throws Exception
writeRequested
in class org.jboss.netty.channel.SimpleChannelHandler
Exception
public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent e) throws Exception
messageReceived
in class org.jboss.netty.channel.SimpleChannelHandler
Exception
protected void decode(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.buffer.ChannelBuffer buffer) throws InterruptedException
InterruptedException
Copyright © 2016. All rights reserved.