Package org.jboss.netty.channel

Examples of org.jboss.netty.channel.ChannelHandler


            return pipeline;
        }      
       
        // Create the play Handler (always the last one)
        String handler = handlers[handlers.length - 1];
        ChannelHandler instance = getInstance(handler);
        PlayHandler playHandler = (PlayHandler) instance;
        if (playHandler == null) {
            Logger.error("The last handler must be the playHandler in \"play.netty.pipeline\"");
            return pipeline;
        }
View Full Code Here


class NettyChannelPipeline {
    private static ChannelHandler getFrameDecoder() {
        /* Frame decoder. Splits stream by \r\n terminated lines */
        ChannelBuffer delimiterBuffer = ChannelBuffers.wrappedBuffer(new byte[] { '\r', '\n' });
        ChannelHandler frameDecoder = new DelimiterBasedFrameDecoder(1024, delimiterBuffer);

        return frameDecoder;
    }
View Full Code Here

                    "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

        }

        final BlockingQueue<ChannelFuture> futureQueue =
            new LinkedBlockingQueue<ChannelFuture>();

        ChannelHandler binder = new Binder(localAddress, futureQueue);
        ChannelHandler parentHandler = getParentHandler();

        ChannelPipeline bossPipeline = pipeline();
        bossPipeline.addLast("binder", binder);
        if (parentHandler != null) {
            bossPipeline.addLast("userHandler", parentHandler);
View Full Code Here

        final BlockingQueue<ChannelFuture> futureQueue =
            new LinkedBlockingQueue<ChannelFuture>();

        ChannelPipeline bossPipeline;
        ChannelHandler binder = new Binder(localAddress, futureQueue);
        ChannelHandler parentHandler = getParentHandler();

    //如果用户自己指定了一个Handler,则使用DefaultChannelPipeline
    //否则使用StaticChannelPipeline
    DEBUG.P("parentHandler="+parentHandler);
        if (parentHandler != null) {
View Full Code Here

                    "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

        String[] handlers = pipelineConfig.split(",");
        for (int i = 0; i < handlers.length - 1; i++) {
            String handler = handlers[i];
            try {
                String name = getName(handler.trim());
                ChannelHandler instance = getInstance(handler);
                if (instance != null) {
                    pipeline.addLast(name, instance);
                    Server.pipelines.put("Ssl" + name, instance);
                }
            } catch (Throwable e) {
                Logger.error(" error adding " + handler, e);
            }

        }

        // The last one is always the yalp handler
        String handler = handlers[handlers.length - 1];
        ChannelHandler instance = getInstance(handler);
        if (instance != null) {
            pipeline.addLast("handler", instance);
            Server.pipelines.put("SslHandler", instance);
        }
View Full Code Here

        String[] handlers = pipelineConfig.split(",");
        for (int i = 0; i < handlers.length - 1; i++) {
            String handler = handlers[i];
            try {
                String name = getName(handler.trim());
                ChannelHandler instance = getInstance(handler);
                if (instance != null) {
                    pipeline.addLast(name, instance);
                    Server.pipelines.put(name, instance);
                }
            } catch (Throwable e) {
                Logger.error(" error adding " + handler, e);
            }

        }

        // The last one is always the yalp handler
        String handler = handlers[handlers.length - 1];
        ChannelHandler instance = getInstance(handler);
        if (instance != null) {
            pipeline.addLast("handler", instance);
            Server.pipelines.put("handler", instance);
        }
View Full Code Here

    public ChannelFuture bindAsync(final SocketAddress localAddress) {
        if (localAddress == null) {
            throw new NullPointerException("localAddress");
        }
        Binder binder = new Binder(localAddress);
        ChannelHandler parentHandler = getParentHandler();

        ChannelPipeline bossPipeline = pipeline();
        bossPipeline.addLast("binder", binder);
        if (parentHandler != null) {
            bossPipeline.addLast("userHandler", parentHandler);
View Full Code Here

                    "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

TOP

Related Classes of org.jboss.netty.channel.ChannelHandler

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.