com.hs.mail.imap.server.codec
Class ImapMessageDecoder

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelUpstreamHandler
      extended by org.jboss.netty.handler.codec.replay.ReplayingDecoder<ImapMessageDecoder.State>
          extended by com.hs.mail.imap.server.codec.ImapMessageDecoder
All Implemented Interfaces:
org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler
Direct Known Subclasses:
ImapRequestDecoder

public abstract class ImapMessageDecoder
extends org.jboss.netty.handler.codec.replay.ReplayingDecoder<ImapMessageDecoder.State>

Decodes ChannelBuffer into ImapMessage.

Since:
Jan 22, 2010
Author:
Won Chul Doh

Nested Class Summary
protected static class ImapMessageDecoder.State
          The internal state of ImapMessageDecoder.
 
Field Summary
protected  ImapMessage message
           
 
Constructor Summary
protected ImapMessageDecoder()
          Creates a new instance with the default.
protected ImapMessageDecoder(int maxLineLength)
          Creates a new instance with the specific parameter.
 
Method Summary
protected abstract  ImapMessage createMessage(String line)
           
protected  Object decode(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.Channel channel, org.jboss.netty.buffer.ChannelBuffer buffer, ImapMessageDecoder.State state)
           
 
Methods inherited from class org.jboss.netty.handler.codec.replay.ReplayingDecoder
actualReadableBytes, channelClosed, channelDisconnected, checkpoint, checkpoint, decodeLast, exceptionCaught, getState, messageReceived, setState
 
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
 

Field Detail

message

protected volatile ImapMessage message
Constructor Detail

ImapMessageDecoder

protected ImapMessageDecoder()
Creates a new instance with the default. maxLineLength (8192)


ImapMessageDecoder

protected ImapMessageDecoder(int maxLineLength)
Creates a new instance with the specific parameter.

Method Detail

decode

protected Object decode(org.jboss.netty.channel.ChannelHandlerContext ctx,
                        org.jboss.netty.channel.Channel channel,
                        org.jboss.netty.buffer.ChannelBuffer buffer,
                        ImapMessageDecoder.State state)
                 throws Exception
Specified by:
decode in class org.jboss.netty.handler.codec.replay.ReplayingDecoder<ImapMessageDecoder.State>
Throws:
Exception

createMessage

protected abstract ImapMessage createMessage(String line)
                                      throws Exception
Throws:
Exception


Copyright © 2011. All Rights Reserved.