com.lambdaworks.redis.protocol
Class CommandHandler<K,V>
java.lang.Object
org.jboss.netty.channel.SimpleChannelHandler
com.lambdaworks.redis.protocol.CommandHandler<K,V>
- All Implemented Interfaces:
- ChannelDownstreamHandler, ChannelHandler, ChannelUpstreamHandler
- Direct Known Subclasses:
- PubSubCommandHandler
public class CommandHandler<K,V>
- extends SimpleChannelHandler
A netty ChannelHandler responsible for writing redis commands and
reading responses from the server.
- Author:
- Will Glozer
| Methods inherited from class org.jboss.netty.channel.SimpleChannelHandler |
bindRequested, channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelUnbound, childChannelClosed, childChannelOpen, closeRequested, connectRequested, disconnectRequested, exceptionCaught, handleDownstream, handleUpstream, setInterestOpsRequested, unbindRequested, writeComplete |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
queue
protected BlockingQueue<Command<K,V,?>> queue
buffer
protected ChannelBuffer buffer
rsm
protected RedisStateMachine<K,V> rsm
CommandHandler
public CommandHandler(BlockingQueue<Command<K,V,?>> queue)
- Initialize a new instance that handles commands from the supplied queue.
- Parameters:
queue - The command queue.
channelOpen
public void channelOpen(ChannelHandlerContext ctx,
ChannelStateEvent e)
throws Exception
- Overrides:
channelOpen in class SimpleChannelHandler
- Throws:
Exception
writeRequested
public void writeRequested(ChannelHandlerContext ctx,
MessageEvent e)
throws Exception
- Overrides:
writeRequested in class SimpleChannelHandler
- Throws:
Exception
messageReceived
public void messageReceived(ChannelHandlerContext ctx,
MessageEvent e)
throws Exception
- Overrides:
messageReceived in class SimpleChannelHandler
- Throws:
Exception
decode
protected void decode(ChannelHandlerContext ctx,
ChannelBuffer buffer)
throws InterruptedException
- Throws:
InterruptedException
Copyright © 2013. All Rights Reserved.