GigaSpaces XAP 9.7.2 API

org.openspaces.memcached.protocol.text
Class MemcachedFrameDecoder

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelUpstreamHandler
      extended by org.jboss.netty.handler.codec.frame.FrameDecoder
          extended by org.openspaces.memcached.protocol.text.MemcachedFrameDecoder
All Implemented Interfaces:
org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler

public final class MemcachedFrameDecoder
extends org.jboss.netty.handler.codec.frame.FrameDecoder

The frame decoder is responsible for breaking the original stream up into a series of lines.

The code here is heavily based on Netty's DelimiterBasedFrameDecoder, but has been modified because the memcached protocol has two states: 1) processing CRLF delimited lines and 2) spooling results for SET/ADD


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
MemcachedFrameDecoder(SessionStatus status, int maxFrameLength)
          Creates a new instance.
 
Method Summary
protected  Object decode(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.Channel channel, org.jboss.netty.buffer.ChannelBuffer buffer)
           
 
Methods inherited from class org.jboss.netty.handler.codec.frame.FrameDecoder
channelClosed, channelDisconnected, decodeLast, exceptionCaught, messageReceived
 
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelConnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemcachedFrameDecoder

public MemcachedFrameDecoder(SessionStatus status,
                             int maxFrameLength)
Creates a new instance.

Parameters:
status - session status instance for holding state of the session
maxFrameLength - the maximum length of the decoded frame. A TooLongFrameException is thrown if frame length is exceeded
Method Detail

decode

protected Object decode(org.jboss.netty.channel.ChannelHandlerContext ctx,
                        org.jboss.netty.channel.Channel channel,
                        org.jboss.netty.buffer.ChannelBuffer buffer)
                 throws Exception
Specified by:
decode in class org.jboss.netty.handler.codec.frame.FrameDecoder
Throws:
Exception

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.