Examples of OrderedMemoryAwareThreadPoolExecutor


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

        // replies in the expected order. eg this is required by TCP.
        // and use a Camel thread factory so we have consistent thread namings
        // we should use a shared thread pool as recommended by Netty
        String pattern = getCamelContext().getExecutorServiceManager().getThreadNamePattern();
        ThreadFactory factory = new CamelThreadFactory(pattern, "NettyOrderedWorker", true);
        return new OrderedMemoryAwareThreadPoolExecutor(configuration.getMaximumPoolSize(),
                0L, 0L, 30, TimeUnit.SECONDS, factory);
    }
View Full Code Here

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

        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.OrderedMemoryAwareThreadPoolExecutor

  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.OrderedMemoryAwareThreadPoolExecutor

    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.OrderedMemoryAwareThreadPoolExecutor

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

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

        // replies in the expected order. eg this is required by TCP.
        // and use a Camel thread factory so we have consistent thread namings
        // we should use a shared thread pool as recommended by Netty
        String pattern = getCamelContext().getExecutorServiceManager().getThreadNamePattern();
        ThreadFactory factory = new CamelThreadFactory(pattern, "NettyOrderedWorker", true);
        return new OrderedMemoryAwareThreadPoolExecutor(configuration.getMaximumPoolSize(),
                0L, 0L, 30, TimeUnit.SECONDS, factory);
    }
View Full Code Here

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

  public void setup() {
    serverBootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));

    serverBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      Executor executor = new OrderedMemoryAwareThreadPoolExecutor(
          Runtime.getRuntime().availableProcessors(),
          1024 * 1024,
          128 * 1024 * 1024
      );

View Full Code Here

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

  public void setup() {
    serverBootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));

    serverBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      Executor executor = new OrderedMemoryAwareThreadPoolExecutor(
          Runtime.getRuntime().availableProcessors(),
          1024 * 1024,
          128 * 1024 * 1024
      );

View Full Code Here

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

        // replies in the expected order. eg this is required by TCP.
        // and use a Camel thread factory so we have consistent thread namings
        // we should use a shared thread pool as recommended by Netty
        String pattern = getCamelContext().getExecutorServiceManager().getThreadNamePattern();
        ThreadFactory factory = new CamelThreadFactory(pattern, "NettyOrderedWorker", true);
        return new OrderedMemoryAwareThreadPoolExecutor(configuration.getMaximumPoolSize(),
                0L, 0L, 30, TimeUnit.SECONDS, factory);
    }
View Full Code Here

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

      if (AppContext.scWorkerThreadPool == null) {
        AppContext.scWorkerThreadPool = Executors.newCachedThreadPool(new NamedPriorityThreadFactory("SC_WORKER"));
      }

      if (AppContext.orderedSCWorkerThreadPool == null) {
        AppContext.orderedSCWorkerThreadPool = new OrderedMemoryAwareThreadPoolExecutor(
            Constants.DEFAULT_MAX_ORDERED_IO_THREADS, 0, 0, 10, TimeUnit.SECONDS, new NamedPriorityThreadFactory(
                "ORDERED_SC_WORKER"));
      }
    }
  }
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.