Package org.apache.mina.filter.codec

Examples of org.apache.mina.filter.codec.ProtocolDecoder


        Object actual = osis.readObject();
        assertEquals(expected, actual);

        // Test ProtocolDecoder
        ProtocolDecoder decoder = new ObjectSerializationDecoder();
        MockProtocolDecoderOutput decoderOut = new MockProtocolDecoderOutput();
        IoSession session = new MockIoSession();
        decoder.decode(session, in.duplicate(), decoderOut);

        Assert.assertEquals(expected, decoderOut.result.get(0));
        Assert.assertEquals(1, decoderOut.result.size());
    }
View Full Code Here


            };

        }

        public ProtocolDecoder getDecoder() throws Exception {
            return new ProtocolDecoder() {
                public void decode(IoSession ioSession, ByteBuffer in,
                                   ProtocolDecoderOutput out) throws Exception {
                    in.acquire();
                    out.write(in);
                }
View Full Code Here

                        }
                    };
                }

                public ProtocolDecoder getDecoder() throws Exception {
                    return new ProtocolDecoder() {
                        public void decode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception {
                            // must acquire the bytebuffer since we just pass it below instead of creating a new one (CAMEL-257)
                            in.acquire();

                            // lets just pass the ByteBuffer in
View Full Code Here

        Object actual = osis.readObject();
        assertEquals(expected, actual);

        // Test ProtocolDecoder
        ProtocolDecoder decoder = new ObjectSerializationDecoder();
        MockProtocolDecoderOutput decoderOut = new MockProtocolDecoderOutput();
        IoSession session = new MockIoSession();
        decoder.decode(session, in.duplicate(), decoderOut);

        Assert.assertEquals(expected, decoderOut.result.get(0));
        Assert.assertEquals(1, decoderOut.result.size());
    }
View Full Code Here

            }
        };
    }

    public ProtocolDecoder getDecoder() throws Exception {
        return new ProtocolDecoder() {
            public void decode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception {

                // find position where we have the end1 end2 combination
                int posEnd = 0;
                int posStart = 0;
View Full Code Here

                        }
                    };
                }

                public ProtocolDecoder getDecoder() throws Exception {
                    return new ProtocolDecoder() {
                        public void decode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception {
                            // must acquire the bytebuffer since we just pass it below instead of creating a new one (CAMEL-257)
                            in.acquire();

                            // lets just pass the ByteBuffer in
View Full Code Here

            };

        }

        public ProtocolDecoder getDecoder() throws Exception {
            return new ProtocolDecoder() {
                public void decode(IoSession ioSession, ByteBuffer in,
                                   ProtocolDecoderOutput out) throws Exception {
                    // close session instead of returning a reply
                    ioSession.close();
                }
View Full Code Here

            };

        }

        public ProtocolDecoder getDecoder(IoSession session) throws Exception {
            return new ProtocolDecoder() {

                public void decode(IoSession ioSession, IoBuffer in,
                                   ProtocolDecoderOutput out) throws Exception {
                    // close session instead of returning a reply
                    ioSession.close(true);
View Full Code Here

            }
        };
    }

    public ProtocolDecoder getDecoder(IoSession session) throws Exception {
        return new ProtocolDecoder() {

            public void decode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws Exception {
                // convert to bytes to write, we can not pass in the byte buffer as it could be sent to
                // multiple mina sessions so we must convert it to bytes
                byte[] bytes = context.getTypeConverter().convertTo(byte[].class, in);
View Full Code Here

        Object actual = osis.readObject();
        assertEquals( expected, actual );
       
        // Test ProtocolDecoder
        ProtocolDecoder decoder = new ObjectSerializationDecoder();
        MockProtocolDecoderOutput decoderOut = new MockProtocolDecoderOutput();
        IoSession session = new MockIoSession();
        decoder.decode( session, in.duplicate(), decoderOut );

        Assert.assertEquals( expected, decoderOut.result.get( 0 ) );
        Assert.assertEquals( 1, decoderOut.result.size() );
    }
View Full Code Here

TOP

Related Classes of org.apache.mina.filter.codec.ProtocolDecoder

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.