|
GigaSpaces XAP 9.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.netty.channel.SimpleChannelUpstreamHandler
org.openspaces.memcached.protocol.MemcachedCommandHandler
@ChannelHandler.Sharable public final class MemcachedCommandHandler
The actual command handler, which is responsible for processing the CommandMessage instances that are inbound from the protocol decoders.
One instance is shared among the entire pipeline, since this handler is stateless, apart from some globals for the entire daemon.
The command handler produces ResponseMessages which are destined for the response encoder.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler |
---|
org.jboss.netty.channel.ChannelHandler.Sharable |
Field Summary | |
---|---|
AtomicInteger |
curr_conns
|
int |
idle_limit
|
protected static Log |
logger
|
AtomicInteger |
total_conns
|
boolean |
verbose
|
String |
version
The following state variables are universal for the entire daemon. |
Constructor Summary | |
---|---|
MemcachedCommandHandler(SpaceCache cache,
String memcachedVersion,
boolean verbosity,
int idle,
org.jboss.netty.channel.group.DefaultChannelGroup channelGroup)
Construct the server session handler |
Method Summary | |
---|---|
void |
channelClosed(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
org.jboss.netty.channel.ChannelStateEvent channelStateEvent)
On close we manage some statistics, and remove this connection from the channel group. |
void |
channelOpen(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
org.jboss.netty.channel.ChannelStateEvent channelStateEvent)
On open we manage some statistics, and add this connection to the channel group. |
protected void |
handleAdd(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleAppend(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleCas(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleDecr(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleDelete(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleFlush(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleGets(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleIncr(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleNoOp(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command)
|
protected void |
handlePrepend(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleQuit(org.jboss.netty.channel.Channel channel)
|
protected void |
handleReplace(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleSet(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleStats(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
int cmdKeysSize,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleVerbosity(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
protected void |
handleVersion(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
CommandMessage command,
org.jboss.netty.channel.Channel channel)
|
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext,
org.jboss.netty.channel.MessageEvent messageEvent)
The actual meat of the matter. |
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler |
---|
channelBound, channelConnected, channelDisconnected, channelInterestChanged, channelUnbound, childChannelClosed, childChannelOpen, exceptionCaught, handleUpstream, writeComplete |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final 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
Constructor Detail |
---|
public MemcachedCommandHandler(SpaceCache cache, String memcachedVersion, boolean verbosity, int idle, org.jboss.netty.channel.group.DefaultChannelGroup channelGroup)
cache
- the cache to usememcachedVersion
- the version string to return to clientsverbosity
- verbosity level for debuggingidle
- how long sessions can be idle forchannelGroup
- Method Detail |
---|
public void channelOpen(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, org.jboss.netty.channel.ChannelStateEvent channelStateEvent) throws Exception
channelOpen
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelHandlerContext
- channelStateEvent
-
Exception
public void channelClosed(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, org.jboss.netty.channel.ChannelStateEvent channelStateEvent) throws Exception
channelClosed
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelHandlerContext
- channelStateEvent
-
Exception
public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, org.jboss.netty.channel.MessageEvent messageEvent) throws Exception
messageReceived
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelHandlerContext
- messageEvent
-
Exception
protected void handleNoOp(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command)
protected void handleFlush(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
protected void handleVerbosity(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
protected void handleQuit(org.jboss.netty.channel.Channel channel)
protected void handleVersion(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
protected void handleStats(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, int cmdKeysSize, org.jboss.netty.channel.Channel channel)
protected void handleDelete(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
protected void handleDecr(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
protected void handleIncr(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
protected void handlePrepend(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
protected void handleAppend(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
protected void handleReplace(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
protected void handleAdd(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
protected void handleCas(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
protected void handleSet(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
protected void handleGets(org.jboss.netty.channel.ChannelHandlerContext channelHandlerContext, CommandMessage command, org.jboss.netty.channel.Channel channel)
|
GigaSpaces XAP 9.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |