Package org.rzo.netty.ahessian.stopable

Source Code of org.rzo.netty.ahessian.stopable.StopablePipeline

package org.rzo.netty.ahessian.stopable;

import org.jboss.netty.channel.ChannelHandler;
import org.jboss.netty.channel.DefaultChannelPipeline;

public class StopablePipeline extends DefaultChannelPipeline
{
  public void stop()
  {
    ChannelHandler handler = this.getFirst();
    while (handler != null)
    {
      if (handler instanceof StopableHandler)
      {
        StopableHandler stopableHandler = (StopableHandler) handler;
        if (stopableHandler.isStopEnabled())
          try
        {
          stopableHandler.stop();
        }
        catch (Exception ex)
        {
         
        }
      }
      this.removeFirst();
      handler = this.getFirst();
    }
  }
 
  public static StopablePipeline pipeline()
  {
    return new StopablePipeline();
  }

}
TOP

Related Classes of org.rzo.netty.ahessian.stopable.StopablePipeline

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.