Package org.jboss.netty.handler.execution

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


      this.resteasyDecoder = new RestEasyHttpRequestDecoder(dispatcher.getDispatcher(), root, getProtocol(), isKeepAlive);
      this.resteasyEncoder = new RestEasyHttpResponseEncoder(dispatcher);
      this.resteasyRequestHandler = new RequestHandler(dispatcher);
      if (executorThreadCount > 0)
      {
          this.executionHandler = new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(executorThreadCount, 0L, 0L));
      }
      else
      {
          this.executionHandler = null;
      }
View Full Code Here


    super.onInit();
  }

  @Override
  protected void doStart() {
    executionHandler = new ExecutionHandler(executor);
    bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),
        Executors.newCachedThreadPool()));
    bootstrap.setOption("child.tcpNoDelay", true);
    bootstrap.setPipelineFactory(new PipelineFactory());
    bootstrap.bind(new InetSocketAddress(this.port));
View Full Code Here

public class LocalServerPipelineFactory implements ChannelPipelineFactory {

    private final ExecutionHandler executionHandler;

    public LocalServerPipelineFactory(Executor eventExecutor) {
        executionHandler = new ExecutionHandler(eventExecutor);
    }
View Full Code Here

        ChannelPipeline pipeline = Channels.pipeline();
        pipeline.addLast("decoder", new TSODecoder(null));
        pipeline.addLast("encoder", new TSOEncoder());
        synchronized (this) {
            if (x == null)
                x = new ExecutionHandler(pipelineExecutor);
            if (bwhandler == null)
                bwhandler = new BandwidthMeterHandler();
            //          if (timer == null)
            //             timer = new HashedWheelTimer();
        }
View Full Code Here

        bootstrap = new ClientBootstrap(factory);

        int executorThreads = conf.getInt("tso.executor.threads", 3);

        bootstrap.getPipeline().addLast("executor",
                new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(executorThreads, 1024 * 1024, 4 * 1024 * 1024)));
        bootstrap.getPipeline().addLast("handler", this);
        bootstrap.setOption("tcpNoDelay", false);
        bootstrap.setOption("keepAlive", true);
        bootstrap.setOption("reuseAddress", true);
        bootstrap.setOption("connectTimeoutMillis", 100);
View Full Code Here

        sb.getPipeline().addLast("handler", sh);
        cb.getPipeline().addFirst("ssl", new SslHandler(cse));
        cb.getPipeline().addLast("handler", ch);

        if (isExecutorRequired()) {
            sb.getPipeline().addFirst("executor",new ExecutionHandler(eventExecutor));
            cb.getPipeline().addFirst("executor",new ExecutionHandler(eventExecutor));
        }

        Channel sc = sb.bind(new InetSocketAddress(0));
        int port = ((InetSocketAddress) sc.getLocalAddress()).getPort();
View Full Code Here

            NettyServer.cpus, NettyServer.cpus * 4, 60,
            TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(),
            new ThreadFactoryBuilder().setNameFormat("Executor-Thread-%d")
              .setDaemon(false).setPriority(Thread.NORM_PRIORITY).build());
       
        this.executionHandler = new ExecutionHandler(executorThreadPool);
      } else {
        this.executionHandler = null;
      }
    }
View Full Code Here

     * Create a new {@link ExecutionHandler} which is used to execute IO-Bound handlers
     *
     * @return ehandler
     */
    protected ExecutionHandler createExecutionHander() {
        return new ExecutionHandler(new JMXEnabledOrderedMemoryAwareThreadPoolExecutor(maxExecutorThreads, 0, 0, getThreadPoolJMXPath(), "executor"));
    }
View Full Code Here

        // gather all chunks into a single http message
        pipeline.addLast("aggregator", new HttpChunkAggregator(maxContentLength));

        // move response handler to user worker pool
        pipeline.addLast("pipelineExecutor", new ExecutionHandler(executor));

        // response handler
        pipeline.addLast("handler", new NettyHttpResponseChannelHandler(nettyConnectionPool));

        return pipeline;
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

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.