Examples of NioServerSocketChannelFactory


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

    {
    case LOCAL: channelFactory = new DefaultLocalServerChannelFactory(); break;
    case NIO:
    {
      channelFactory =
          new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),
                                            Executors.newCachedThreadPool());
      break;
    }
    case OIO:
    {
View Full Code Here

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

      if (bossExecutor == null) { bossExecutor = Executors.newCachedThreadPool(); }
      ExecutorService workerExecutor = config.workerExecutor();
      if (workerExecutor == null) { workerExecutor = Executors.newCachedThreadPool(); }
     
        final ServerBootstrap bootstrap = new ServerBootstrap(
                new NioServerSocketChannelFactory(bossExecutor, workerExecutor));

        bootstrap.setPipelineFactory(pipelineFactory);
        return bootstrap;
    }
View Full Code Here

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

    }

    private ServerBootstrap buildBootstrapFlashPolicy() {
        // Configure the server.
        final ServerBootstrap bootstrap = new ServerBootstrap(
                new NioServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool()));

        // Set up the event pipeline factory.
        bootstrap.setPipelineFactory(new FlashPolicyServerPipelineFactory());
View Full Code Here

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

    }

    @Override
    public void run()
    {
      _bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(
          Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));

      // Set up the event pipeline factory.
      _bootstrap.setPipelineFactory(new HttpServerPipelineFactory());
View Full Code Here

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

  protected void initializeContainerNetworking(ByteOrder byteOrder) throws IOException, DatabusException
  {
    //instruct netty not to rename our threads in the I/O and boss thread pools
    ThreadRenamingRunnable.setThreadNameDeterminer(ThreadNameDeterminer.CURRENT);

    _httpBootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(_bossExecutorService,
                                                                           _ioExecutorService));
    _httpBootstrap.setPipelineFactory(new HttpServerPipelineFactory(this));
    _httpBootstrap.setOption("bufferFactory", DirectChannelBufferFactory.getInstance(byteOrder));
    _httpBootstrap.setOption("child.bufferFactory", DirectChannelBufferFactory.getInstance(byteOrder));

    if (_containerStaticConfig.getTcp().isEnabled())
    {
      _tcpBootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(_bossExecutorService,
                                                                            _ioExecutorService));
      _tcpBootstrap.setPipelineFactory(new TcpServerPipelineFactory(this, byteOrder));
      _tcpBootstrap.setOption("bufferFactory", DirectChannelBufferFactory.getInstance(byteOrder));
      _tcpBootstrap.setOption("child.bufferFactory", DirectChannelBufferFactory.getInstance(byteOrder));
View Full Code Here

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

    }
  }

  @Override
  public void start() {
    ChannelFactory factory = new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(), Executors.newCachedThreadPool());

    ServerBootstrap serverBootstrap = new ServerBootstrap(factory);
    serverBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      @Override
View Full Code Here

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

  private Server createSslServer(AvroSourceProtocol protocol)
      throws IllegalAccessException, InstantiationException {
    Server server = new NettyServer(new SpecificResponder(
        AvroSourceProtocol.class, protocol), new InetSocketAddress(hostname, port),
            new NioServerSocketChannelFactory(
                    Executors.newCachedThreadPool(),
                    Executors.newCachedThreadPool()),
            new SSLChannelPipelineFactory(),
            null);
View Full Code Here

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

  public void start() {
    logger.info("Starting {}...", this);

    Responder responder = new SpecificResponder(AvroSourceProtocol.class, this);

    NioServerSocketChannelFactory socketChannelFactory = initSocketChannelFactory();

    ChannelPipelineFactory pipelineFactory = initChannelPipelineFactory();

    server = new NettyServer(responder, new InetSocketAddress(bindAddress, port),
          socketChannelFactory, pipelineFactory, null);
View Full Code Here

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

    logger.info("Avro source {} started.", getName());
  }

  private NioServerSocketChannelFactory initSocketChannelFactory() {
    NioServerSocketChannelFactory socketChannelFactory;
    if (maxThreads <= 0) {
      socketChannelFactory = new NioServerSocketChannelFactory
        (Executors.newCachedThreadPool(new ThreadFactoryBuilder().
          setNameFormat("Avro " + NettyTransceiver.class.getSimpleName()
            + " Boss-%d").build()),
          Executors.newCachedThreadPool(new ThreadFactoryBuilder().
            setNameFormat("Avro " + NettyTransceiver.class.getSimpleName()
              + "  I/O Worker-%d").build()));
    } else {
      socketChannelFactory = new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(new ThreadFactoryBuilder().
          setNameFormat(
            "Avro " + NettyTransceiver.class.getSimpleName()
              + " Boss-%d").build()),
        Executors.newFixedThreadPool(maxThreads, new ThreadFactoryBuilder().
View Full Code Here

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

    listenerSocket = new InetSocketAddress("0.0.0.0", port);
    bossThreadFactory = new ExecutorThreadFactory("BossPool-[" + port + "]", true);
    workerThreadFactory = new ExecutorThreadFactory("WorkerPool-[" + port + "]", true);
    bossPool = Executors.newCachedThreadPool(bossThreadFactory);
    workerPool = Executors.newCachedThreadPool(workerThreadFactory);
    channelFactory = new NioServerSocketChannelFactory(bossPool, workerPool);
    pipelineFactory = new ChannelPipelineFactoryImpl(providers);
    bootstrap = new CustomServerBootstrap(channelFactory);
    bootstrap.setOptions(channelOptions);
    bootstrap.setPipelineFactory(pipelineFactory);
    new BootstrapJMXManager(bootstrap, "org.helios.netty:service=ServerBootstrap,name=SimpleNIOServer");
View Full Code Here
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.