Examples of ChannelHandler


Examples of org.jboss.netty.channel.ChannelHandler

            addToPipeline("ssl", channelPipeline, sslHandler);
        }

        List<ChannelHandler> encoders = consumer.getConfiguration().getEncoders();
        for (int x = 0; x < encoders.size(); x++) {
            ChannelHandler encoder = encoders.get(x);
            if (encoder instanceof ChannelHandlerFactory) {
                // use the factory to create a new instance of the channel as it may not be shareable
                encoder = ((ChannelHandlerFactory) encoder).newChannelHandler();
            }
            addToPipeline("encoder-" + x, channelPipeline, encoder);
        }

        List<ChannelHandler> decoders = consumer.getConfiguration().getDecoders();
        for (int x = 0; x < decoders.size(); x++) {
            ChannelHandler decoder = decoders.get(x);
            if (decoder instanceof ChannelHandlerFactory) {
                // use the factory to create a new instance of the channel as it may not be shareable
                decoder = ((ChannelHandlerFactory) decoder).newChannelHandler();
            }
            addToPipeline("decoder-" + x, channelPipeline, decoder);
View Full Code Here

Examples of org.jboss.netty.channel.ChannelHandler

        if (LOG.isTraceEnabled()) {
            LOG.trace("Message received: {}", messageEvent);
        }

        if (producer.getConfiguration().getRequestTimeout() > 0) {
            ChannelHandler handler = ctx.getPipeline().get("timeout");
            if (handler != null) {
                LOG.trace("Removing timeout channel as we received message");
                ctx.getPipeline().remove(handler);
            }
        }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelHandler

        if (LOG.isTraceEnabled()) {
            LOG.trace("Message received: {}", messageEvent);
        }

        if (producer.getConfiguration().getRequestTimeout() > 0) {
            ChannelHandler handler = ctx.getPipeline().get("timeout");
            if (handler != null) {
                LOG.trace("Removing timeout channel as we received message");
                ctx.getPipeline().remove(handler);
            }
        }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelHandler

        if (LOG.isTraceEnabled()) {
            LOG.trace("Message received: {}", messageEvent);
        }

        if (producer.getConfiguration().getRequestTimeout() > 0) {
            ChannelHandler handler = ctx.getPipeline().get("timeout");
            if (handler != null) {
                LOG.trace("Removing timeout channel as we received message");
                ctx.getPipeline().remove(handler);
            }
        }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelHandler

            pipeline.addLast("executionHandler", executionHandler);
            LOG.debug("Using OrderedMemoryAwareThreadPoolExecutor with core pool size: {}", consumer.getConfiguration().getMaximumPoolSize());
        }

        int port = consumer.getConfiguration().getPort();
        ChannelHandler handler = consumer.getEndpoint().getComponent().getMultiplexChannelHandler(port).getChannelHandler();
        pipeline.addLast("handler", handler);

        return pipeline;
    }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelHandler

                    "handlers should contain at least one " +
                    ChannelHandler.class.getSimpleName() + '.');
        }

        for (int i = 0; i < handlers.length; i ++) {
            ChannelHandler h = handlers[i];
            if (h == null) {
                throw new NullPointerException("handlers[" + i + "]");
            }
            pipeline.addLast(String.valueOf(i), handlers[i]);
        }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelHandler

            addToPipeline("ssl", channelPipeline, sslHandler);
        }

        List<ChannelHandler> encoders = consumer.getConfiguration().getEncoders();
        for (int x = 0; x < encoders.size(); x++) {
            ChannelHandler encoder = encoders.get(x);
            if (encoder instanceof ChannelHandlerFactory) {
                // use the factory to create a new instance of the channel as it may not be shareable
                encoder = ((ChannelHandlerFactory) encoder).newChannelHandler();
            }
            addToPipeline("encoder-" + x, channelPipeline, encoder);
        }

        List<ChannelHandler> decoders = consumer.getConfiguration().getDecoders();
        for (int x = 0; x < decoders.size(); x++) {
            ChannelHandler decoder = decoders.get(x);
            if (decoder instanceof ChannelHandlerFactory) {
                // use the factory to create a new instance of the channel as it may not be shareable
                decoder = ((ChannelHandlerFactory) decoder).newChannelHandler();
            }
            addToPipeline("decoder-" + x, channelPipeline, decoder);
View Full Code Here

Examples of org.jboss.netty.channel.ChannelHandler

  }

  static GenericHttpResponseHandler getResponseHandler(Channel clientChannel)
  {
    ChannelPipeline pipe = clientChannel.getPipeline();
    ChannelHandler handler = pipe.get("3");
    Assert.assertNotNull(handler, "unable to find handler. Did client pipeline factory change?");
    Assert.assertTrue(handler instanceof GenericHttpResponseHandler,
                      "expected GenericHttpResponseHandler; found: " + handler.getClass() +
                      ". Did  client pipeline factory change?");
    return (GenericHttpResponseHandler)handler;
  }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelHandler

                    ChannelHandler.class.getSimpleName() + '.');
        }

        pipeline = Channels.pipeline();
        for (int i = 0; i < handlers.length; i ++) {
            ChannelHandler h = handlers[i];
            if (h == null) {
                throw new NullPointerException("handlers[" + i + "]");
            }
            pipeline.addLast(String.valueOf(i), handlers[i]);
        }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelHandler

            new LinkedBlockingQueue<ChannelFuture>();

        ChannelPipeline bossPipeline = pipeline();
        bossPipeline.addLast("binder", new Binder(localAddress, futureQueue));

        ChannelHandler parentHandler = getParentHandler();
        if (parentHandler != null) {
            bossPipeline.addLast("userHandler", parentHandler);
        }

        Channel channel = getFactory().newChannel(bossPipeline);
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.