Package org.jboss.netty.handler.execution

Examples of org.jboss.netty.handler.execution.ExecutionHandler


        this.protocol = protocol;
        this.context = context;
    }
   
    protected ExecutionHandler createExecutionHandler(int size) {
        return new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(size, 0, 0));
    }
View Full Code Here


        Executors.newCachedThreadPool(), Executors.newCachedThreadPool()), conf);
  }

  public NettyServer(InetSocketAddress addr, ChannelFactory channelFactory,
      Configuration conf) {
    this(addr, channelFactory, new ExecutionHandler(
        new MemoryAwareThreadPoolExecutor(128, 1024 * 1024 * 32,
            1024 * 1024 * 32)), conf);
  }
View Full Code Here

    server = new NettyServer(
        new SpecificResponder(Simple.class, new SimpleImpl(waitLatch)),
        new InetSocketAddress(0),
        new NioServerSocketChannelFactory
          (Executors.newCachedThreadPool(), Executors.newCachedThreadPool()),
        new ExecutionHandler(Executors.newCachedThreadPool()));
    server.start();
   
    transceiver = new NettyTransceiver(new InetSocketAddress(
        server.getPort()), TestNettyServer.CONNECT_TIMEOUT_MILLIS);
   
View Full Code Here

  private static ExecutionHandler EXECUTION_HANDLER;

  public synchronized static ExecutionHandler getExecutionHandler()
  {
    if(null == EXECUTION_HANDLER){
      EXECUTION_HANDLER = new ExecutionHandler( new OrderedMemoryAwareThreadPoolExecutor(16, 1048576, 1048576));
    }
    return EXECUTION_HANDLER;
  }
View Full Code Here

    this.xmppSecret = checkNotNull(xmppSecret);
  }

  @Override
  protected void startUp() throws Exception {
    executionHandler = new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(4, 0, 0));
    bootstrap = new ClientBootstrap(new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));
    bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      @Override
      public ChannelPipeline getPipeline() throws Exception {
        final ChannelPipeline pipeline = Channels.pipeline();
View Full Code Here

   * @param sslContext
   */
  public StrestServerPipelineFactory(StrestRouter router, SSLContext sslContext) {
    this.router = router;
    this.sslContext = sslContext;
    this.handler = new ExecutionHandler(
               new MemoryAwareThreadPoolExecutor(
                   router.getServer().getConfig().getInteger("threads.worker", 16), 1048576, 1048576)
      );
  }
View Full Code Here

    }

    private void run()
    {
        // Configure the server.
        executionHandler = new ExecutionHandler(new RequestThreadPoolExecutor());
        factory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
        ServerBootstrap bootstrap = new ServerBootstrap(factory);

        bootstrap.setOption("child.tcpNoDelay", true);
View Full Code Here

            isRunning.compareAndSet(true, false);
            return;
        }

        // Configure the server.
        executionHandler = new ExecutionHandler(new RequestThreadPoolExecutor());
        factory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
        ServerBootstrap bootstrap = new ServerBootstrap(factory);

        bootstrap.setOption("child.tcpNoDelay", true);
View Full Code Here

        GiraphConstants.NETTY_SERVER_EXECUTION_AFTER_HANDLER.get(conf);
    boolean useExecutionHandler =
        GiraphConstants.NETTY_SERVER_USE_EXECUTION_HANDLER.get(conf);
    if (useExecutionHandler) {
      int executionThreads = conf.getNettyServerExecutionThreads();
      executionHandler = new ExecutionHandler(
          new MemoryAwareThreadPoolExecutor(
              executionThreads, 1048576, 1048576, 1, TimeUnit.HOURS,
              new ThreadFactoryBuilder().setNameFormat("netty-server-exec-%d").
                  build()));
      if (LOG.isInfoEnabled()) {
View Full Code Here

    handlerBeforeExecutionHandler =
        NETTY_CLIENT_EXECUTION_AFTER_HANDLER.get(conf);
    boolean useExecutionHandler = NETTY_CLIENT_USE_EXECUTION_HANDLER.get(conf);
    if (useExecutionHandler) {
      int executionThreads = NETTY_CLIENT_EXECUTION_THREADS.get(conf);
      executionHandler = new ExecutionHandler(
          new MemoryAwareThreadPoolExecutor(
              executionThreads, 1048576, 1048576, 1, TimeUnit.HOURS,
              new ThreadFactoryBuilder().setNameFormat("netty-client-exec-%d")
                  .build()));
      if (LOG.isInfoEnabled()) {
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.execution.ExecutionHandler

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.