Package org.openstreetmap.osmosis.replicationhttp.v0_6.impl

Source Code of org.openstreetmap.osmosis.replicationhttp.v0_6.impl.SequenceServerChannelPipelineFactory

// This software is released into the Public Domain.  See copying.txt for details.
package org.openstreetmap.osmosis.replicationhttp.v0_6.impl;

import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.handler.codec.http.HttpServerCodec;


/**
* Builds Netty channel pipelines for new client connections.
*
* @author Brett Henderson
*/
public abstract class SequenceServerChannelPipelineFactory implements ChannelPipelineFactory {

  private SequenceServerControl centralControl;


  /**
   * Provides handlers with access to server control functions.
   *
   * @param control
   *            The new control object.
   */
  public void setControl(SequenceServerControl control) {
    this.centralControl = control;
  }


  /**
   * Creates a handler to be used for processing channel messages.
   *
   * @param control
   *            The control object used to send event notifications.
   * @return The channel handler.
   */
  protected abstract SequenceServerHandler createHandler(SequenceServerControl control);


  @Override
  public ChannelPipeline getPipeline() throws Exception {
    return Channels.pipeline(new HttpServerCodec(), createHandler(centralControl));
  }
}
TOP

Related Classes of org.openstreetmap.osmosis.replicationhttp.v0_6.impl.SequenceServerChannelPipelineFactory

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.