@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, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharableprotected 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.ChannelInboundHandlerchannelActive in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelInactive in interface io.netty.channel.ChannelInboundHandlerchannelInactive in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.channel.ChannelInboundHandlerAdapterExceptionprotected 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.