Package org.jboss.netty.channel.socket.nio

Examples of org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory


  public static void initializeConnections() throws Exception {
    // start server
    System.out.println("starting server...");
    mailService = new MailImpl();
    Responder responder = new SpecificResponder(Mail.class, mailService);
    ChannelFactory channelFactory = new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(),
        Executors.newCachedThreadPool()
    );
    server = new NettyServer(responder, new InetSocketAddress(0),
                             channelFactory, new SSLChannelPipelineFactory(),
View Full Code Here


          .build();
      ThreadFactory workerFactory = new ThreadFactoryBuilder()
          .setNameFormat("PullServerAuxService Netty Worker #%d")
          .build();

      selector = new NioServerSocketChannelFactory(
          Executors.newCachedThreadPool(bossFactory),
          Executors.newCachedThreadPool(workerFactory));

      localFS = new LocalFileSystem();
      super.init(new Configuration(conf));
View Full Code Here

          .build();
      ThreadFactory workerFactory = new ThreadFactoryBuilder()
          .setNameFormat("PullServerAuxService Netty Worker #%d")
          .build();

      selector = new NioServerSocketChannelFactory(
          Executors.newCachedThreadPool(bossFactory),
          Executors.newCachedThreadPool(workerFactory));

      localFS = new LocalFileSystem();
      super.init(new Configuration(conf));
View Full Code Here

  private ChannelGroup channelGroup = null;

  public HttpDataServer(final InetSocketAddress addr,
      final DataRetriever retriever) {
    this.addr = addr;
    this.factory = new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(), Executors.newCachedThreadPool(),
        Runtime.getRuntime().availableProcessors() * 2);

    // Configure the server.
    this.bootstrap = new ServerBootstrap(factory);
View Full Code Here

        // Configure the server.
        int buffer_size = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_BUFFER_SIZE));
        int maxWorkers = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_SERVER_WORKER_THREADS));

        if (maxWorkers > 0) {
            factory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool(), maxWorkers);
        } else {
            factory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
        }
        bootstrap = new ServerBootstrap(factory);
        bootstrap.setOption("child.tcpNoDelay", true);
        bootstrap.setOption("child.receiveBufferSize", buffer_size);
        bootstrap.setOption("child.keepAlive", true);
View Full Code Here

  }

  private ServerBootstrap startHttpServer(int port,
      final Token<DelegationTokenIdentifier> token, final URI url) {
    ServerBootstrap bootstrap = new ServerBootstrap(
        new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),
            Executors.newCachedThreadPool()));

    bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      @Override
      public ChannelPipeline getPipeline() throws Exception {
View Full Code Here

      .build();
    ThreadFactory workerFactory = new ThreadFactoryBuilder()
      .setNameFormat("ShuffleHandler Netty Worker #%d")
      .build();
   
    selector = new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(bossFactory),
        Executors.newCachedThreadPool(workerFactory),
        maxShuffleThreads);
    super.serviceInit(new Configuration(conf));
  }
View Full Code Here

public class RpcServer extends RpcPeer {

    ServerBootstrap bootstrap;

    public RpcServer() {
        ChannelFactory channelFactory = new NioServerSocketChannelFactory(
                Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool());
        bootstrap = new ServerBootstrap(channelFactory);
        bootstrap.setPipelineFactory(new RpcChannelPiplineFactory(this));
    }
View Full Code Here

         else
         {
            threadsToUse = this.nioRemotingThreads;
         }

         channelFactory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor, threadsToUse);
      }
      else
      {
         channelFactory = new OioServerSocketChannelFactory(bossExecutor, workerExecutor);
      }
View Full Code Here

    @Override
    protected void startInner() {

        // Configure the server.
        this.workerPool = (ThreadPoolExecutor) Executors.newFixedThreadPool(config.getNumRestServiceNettyWorkerThreads());
        this.bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newFixedThreadPool(config.getNumRestServiceNettyBossThreads()),
                                                                               workerPool));
        this.bootstrap.setOption("backlog", config.getRestServiceNettyServerBacklog());
        this.bootstrap.setOption("child.tcpNoDelay", true);
        this.bootstrap.setOption("child.keepAlive", true);
        this.bootstrap.setOption("child.reuseAddress", true);
View Full Code Here

TOP

Related Classes of org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory

Copyright © 2018 www.massapicom. 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.