Package me.shimi.metrics.dashboard

Source Code of me.shimi.metrics.dashboard.HttpServerPipelineFactory

package me.shimi.metrics.dashboard;

import static org.jboss.netty.channel.Channels.pipeline;

import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.handler.codec.http.HttpRequestDecoder;
import org.jboss.netty.handler.codec.http.HttpResponseEncoder;

public class HttpServerPipelineFactory implements ChannelPipelineFactory {
 
  private HttpServerHandler serverHandler;

  public HttpServerPipelineFactory(HttpServerHandler serverHandler) {
    this.serverHandler = serverHandler;
  }
 
  public ChannelPipeline getPipeline() throws Exception {
   
    ChannelPipeline pipeline = pipeline();
    pipeline.addLast("decoder", new HttpRequestDecoder());
    pipeline.addLast("encoder", new HttpResponseEncoder());
    pipeline.addLast("handler", serverHandler);
    return pipeline;
  }
}
TOP

Related Classes of me.shimi.metrics.dashboard.HttpServerPipelineFactory

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.