Package org.jboss.netty.handler.execution

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


            // 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
            String pattern = consumer.getContext().getExecutorServiceManager().getThreadNamePattern();
            ThreadFactory factory = new CamelThreadFactory(pattern, "NettyOrderedWorker", true);
            final ExecutionHandler executionHandler = new ExecutionHandler(
                    new OrderedMemoryAwareThreadPoolExecutor(consumer.getConfiguration().getMaximumPoolSize(),
                            0L, 0L, 30, TimeUnit.SECONDS, factory));
            // this must be added just before the ServerChannelHandler
            addToPipeline("executionHandler", channelPipeline, executionHandler);
            LOG.debug("Using OrderedMemoryAwareThreadPoolExecutor with core pool size: {}", consumer.getConfiguration().getMaximumPoolSize());
View Full Code Here

        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

    public Network() {
        bootstrap.getPipeline().addLast("encoder", new Encoder());
        bootstrap.getPipeline().addLast("decoder", new Decoder());
        bootstrap.getPipeline().addLast("handler", new NetworkManager());
        bootstrap.getPipeline().addLast("pipelineExecutor", new ExecutionHandler
                (
                        new OrderedMemoryAwareThreadPoolExecutor(
                                200,
                                1048576,
                                1073741824,
View Full Code Here

     *                        to handle inbound {@link de.uniluebeck.itm.ncoap.message.CoapRequest}s targeting
     *                        unknown {@link de.uniluebeck.itm.ncoap.application.server.webservice.Webservice}s.
     */
    public ServerChannelPipelineFactory(ScheduledExecutorService executor, NotFoundHandler notFoundHandler){

        addChannelHandler(EXECUTION_HANDLER, new ExecutionHandler(executor));

        addChannelHandler(ENCODER, new CoapMessageEncoder());
        addChannelHandler(DECODER, new CoapMessageDecoder());

        addChannelHandler(OUTBOUND_RELIABILITY_HANDLER, new OutboundReliabilityHandler(executor));
View Full Code Here

     *                     for generating {@link de.uniluebeck.itm.ncoap.communication.dispatching.client.Token}s for
     *                     outbound {@link de.uniluebeck.itm.ncoap.message.CoapRequest}s
     */
    public ClientChannelPipelineFactory(ScheduledExecutorService executor, TokenFactory tokenFactory){

        addChannelHandler(EXECUTION_HANDLER, new ExecutionHandler(executor));

        addChannelHandler(ENCODER, new CoapMessageEncoder());
        addChannelHandler(DECODER, new CoapMessageDecoder());

        addChannelHandler(OUTBOUND_RELIABILITY_HANDLER, new OutboundReliabilityHandler(executor));
View Full Code Here

        ThreadPoolExecutor executorThreadPool = new ThreadPoolExecutor(
            NettyServer.cpus, NettyServer.cpus * 4, 60,
            TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(),
            new DescriptiveThreadFactory("Executor-Thread"));

        this.executionHandler = new ExecutionHandler(executorThreadPool);
      } else {
        this.executionHandler = null;
      }
    }
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.