@ChannelHandler.Sharable
public final class MemcachedCommandHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
Modifier and Type | Field and Description |
---|---|
AtomicInteger |
curr_conns |
int |
idle_limit |
protected static org.apache.commons.logging.Log |
logger |
AtomicInteger |
total_conns |
boolean |
verbose |
String |
version
The following state variables are universal for the entire daemon.
|
Constructor and Description |
---|
MemcachedCommandHandler(SpaceCache cache,
String memcachedVersion,
boolean verbosity,
int idle)
Construct the server session handler
|
Modifier and Type | Method and Description |
---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx)
On open we manage some statistics, and add this connection to the channel group.
|
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx)
On close we manage some statistics, and remove this connection from the channel group.
|
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
The actual meat of the matter.
|
protected void |
handleAdd(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handleAppend(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handleCas(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handleDecr(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handleDelete(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handleFlush(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handleGets(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handleIncr(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handleNoOp(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handlePrepend(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handleQuit(io.netty.channel.Channel channel) |
protected void |
handleReplace(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handleSet(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handleStats(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command,
int cmdKeysSize) |
protected void |
handleVerbosity(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
protected void |
handleVersion(io.netty.channel.ChannelHandlerContext ctx,
CommandMessage command) |
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
protected static final org.apache.commons.logging.Log logger
public final AtomicInteger curr_conns
public final AtomicInteger total_conns
public final String version
public final int idle_limit
public final boolean verbose
public MemcachedCommandHandler(SpaceCache cache, String memcachedVersion, boolean verbosity, int idle)
cache
- the cache to usememcachedVersion
- the version string to return to clientsverbosity
- verbosity level for debuggingidle
- how long sessions can be idle forpublic void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelInactive
in interface io.netty.channel.ChannelInboundHandler
channelInactive
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) throws Exception
channelRead
in interface io.netty.channel.ChannelInboundHandler
channelRead
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
protected void handleNoOp(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handleFlush(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handleVerbosity(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handleQuit(io.netty.channel.Channel channel)
protected void handleVersion(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handleStats(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command, int cmdKeysSize)
protected void handleDelete(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handleDecr(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handleIncr(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handlePrepend(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handleAppend(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handleReplace(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handleAdd(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handleCas(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handleSet(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
protected void handleGets(io.netty.channel.ChannelHandlerContext ctx, CommandMessage command)
Copyright © GigaSpaces.