com.hs.mail.imap.server
Class DebuggingHandler

java.lang.Object
  extended by com.hs.mail.imap.server.DebuggingHandler
All Implemented Interfaces:
org.jboss.netty.channel.ChannelDownstreamHandler, org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler

@ChannelPipelineCoverage(value="all")
public class DebuggingHandler
extends Object
implements org.jboss.netty.channel.ChannelUpstreamHandler, org.jboss.netty.channel.ChannelDownstreamHandler

A ChannelHandler that logs all protocol streams.

Since:
Jul 7, 2010
Author:
Won Chul Doh

Constructor Summary
DebuggingHandler()
           
 
Method Summary
 void debug(org.jboss.netty.channel.ChannelEvent e)
          Logs the specified event to the out returned by getDebugOut().
 PrintStream getDebugOut()
          Returns the stream to be used for debugging output.
 void handleDownstream(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelEvent e)
           
 void handleUpstream(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelEvent e)
           
 void setDebugOut(PrintStream out)
          Set the stream to be used for debugging output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebuggingHandler

public DebuggingHandler()
Method Detail

setDebugOut

public void setDebugOut(PrintStream out)
Set the stream to be used for debugging output. If out is null, System.out will be used.

Parameters:
out - the PrintStream to use for debugging output

getDebugOut

public PrintStream getDebugOut()
Returns the stream to be used for debugging output. If no stream has been set, System.out is returned.

Returns:
the PrintStream to use for debugging output.

debug

public void debug(org.jboss.netty.channel.ChannelEvent e)
Logs the specified event to the out returned by getDebugOut().


handleUpstream

public void handleUpstream(org.jboss.netty.channel.ChannelHandlerContext ctx,
                           org.jboss.netty.channel.ChannelEvent e)
                    throws Exception
Specified by:
handleUpstream in interface org.jboss.netty.channel.ChannelUpstreamHandler
Throws:
Exception

handleDownstream

public void handleDownstream(org.jboss.netty.channel.ChannelHandlerContext ctx,
                             org.jboss.netty.channel.ChannelEvent e)
                      throws Exception
Specified by:
handleDownstream in interface org.jboss.netty.channel.ChannelDownstreamHandler
Throws:
Exception


Copyright © 2011. All Rights Reserved.