Package org.jboss.netty.handler.codec.oneone

Examples of org.jboss.netty.handler.codec.oneone.OneToOneEncoder


        } else {
            ChannelFuture handshake = this.handshaker.handshake(ctx.getChannel(), req);
            if (handshake.isSuccess()) {
                // we need to insert an encoder that takes the underlying ChannelBuffer of a StompFrame.toHornetQBuffer and
                // wrap it in a binary web socket frame before letting the wsencoder send it on the wire
                ctx.getPipeline().addAfter("wsencoder", "binary-websocket-encoder", new OneToOneEncoder() {
                    @Override
                    protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception {
                        if (msg instanceof ChannelBuffer) {
                            return new BinaryWebSocketFrame((ChannelBuffer) msg);
                        }
View Full Code Here


    }

    public abstract void encode(ChannelBuffer buf);

    public static OneToOneEncoder encoder() {
        return new OneToOneEncoder () {

            protected Object encode(
                    ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception {
                GraphLabMessage glMessage = (GraphLabMessage) msg;
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.codec.oneone.OneToOneEncoder

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.