Examples of ExecutionHandler


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

        if (consumer.getConfiguration().isOrderedThreadPoolExecutor()) {
            // this must be added just before the ServerChannelHandler
            // use ordered thread pool, to ensure we process the events in order, and can send back
            // replies in the expected order. eg this is required by TCP.
            // and use a Camel thread factory so we have consistent thread namings
            ExecutionHandler executionHandler = new ExecutionHandler(consumer.getEndpoint().getComponent().getExecutorService());
            addToPipeline("executionHandler", channelPipeline, executionHandler);
            LOG.debug("Using OrderedMemoryAwareThreadPoolExecutor with core pool size: {}", consumer.getConfiguration().getMaximumPoolSize());
        }

        // our handler must be added last
View Full Code Here

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

    }

    public 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

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

        if (consumer.getConfiguration().isOrderedThreadPoolExecutor()) {
            // this must be added just before the HttpServerMultiplexChannelHandler
            // use ordered thread pool, to ensure we process the events in order, and can send back
            // replies in the expected order. eg this is required by TCP.
            // and use a Camel thread factory so we have consistent thread namings
            ExecutionHandler executionHandler = new ExecutionHandler(consumer.getEndpoint().getComponent().getExecutorService());
            pipeline.addLast("executionHandler", executionHandler);
            LOG.debug("Using OrderedMemoryAwareThreadPoolExecutor with core pool size: {}", consumer.getConfiguration().getMaximumPoolSize());
        }

        int port = consumer.getConfiguration().getPort();
View Full Code Here

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

    }

    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

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

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

        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

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

    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

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

  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

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

    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

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

   * @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
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.