Package org.apache.qpid.amqp_1_0.codec

Examples of org.apache.qpid.amqp_1_0.codec.ValueHandler


            _typeRegistry.registerSecurityLayer();
        }

        public MessageMetaData_1_0 createMetaData(ByteBuffer buf)
        {
            ValueHandler valueHandler = new ValueHandler(_typeRegistry);

            ArrayList<Section> sections = new ArrayList<Section>(3);
            ArrayList<ByteBuffer> encodedSections = new ArrayList<ByteBuffer>(3);

            while(buf.hasRemaining())
            {
                try
                {
                    ByteBuffer encodedBuf = buf.duplicate();
                    Object parse = valueHandler.parse(buf);
                    sections.add((Section) parse);
                    encodedBuf.limit(buf.position());
                    encodedSections.add(encodedBuf);

                }
View Full Code Here


            }

            if(queueEntry.getDeliveryCount() != 0)
            {
                payload = payload.duplicate();
                ValueHandler valueHandler = new ValueHandler(_typeRegistry);

                Header oldHeader = null;
                try
                {
                    ByteBuffer encodedBuf = payload.duplicate();
                    Object value = valueHandler.parse(payload);
                    if(value instanceof Header)
                    {
                        oldHeader = (Header) value;
                    }
                    else
View Full Code Here

    {
        private final AMQPDescribedTypeRegistry _typeRegistry = AMQPDescribedTypeRegistry.newInstance();

        public MessageMetaData_1_0 createMetaData(ByteBuffer buf)
        {
            ValueHandler valueHandler = new ValueHandler(_typeRegistry);

            ArrayList<Section> sections = new ArrayList<Section>(3);
            ArrayList<ByteBuffer> encodedSections = new ArrayList<ByteBuffer>(3);

            while(buf.hasRemaining())
            {
                try
                {
                    ByteBuffer encodedBuf = buf.duplicate();
                    sections.add((Section) valueHandler.parse(buf));
                    encodedBuf.limit(buf.position());
                    encodedSections.add(encodedBuf);

                }
                catch (AmqpErrorException e)
View Full Code Here

            System.out.println((midTime - startTime));

        }


        ValueHandler handler = new ValueHandler(registry);
        System.out.println("------ Decode (time in ms for 1 million opens)");
        for(int n = 0; n < 100; n++)
        {
            long startTime = System.currentTimeMillis();
            for(int i = 1000000; i !=0; i--)
            {
                buf.flip();
                handler.parse(buf);
                handler.parse(buf);
                handler.parse(buf);

            }
            long midTime = System.currentTimeMillis();
            System.out.println((midTime - startTime));
        }
View Full Code Here

    private static void readBytes(final InputStream inputStream) throws IOException, AmqpErrorException
    {
        byte[] bytes = new byte[4096];

        ValueHandler valueHandler = new ValueHandler(AMQPDescribedTypeRegistry.newInstance());

        int count;

        while((count = inputStream.read(bytes))!=-1)
        {
            ByteBuffer buf = ByteBuffer.wrap(bytes);
            buf.limit(count);
            while(buf.hasRemaining())
            {

                    final Object value = valueHandler.parse(buf);
                    System.out.print((value == null ? "" : value.getClass().getName() + ":") +value +"\n");

            }
        }
View Full Code Here

        }

        if(queueEntry.getDeliveryCount() != 0)
        {
            payload = payload.duplicate();
            ValueHandler valueHandler = new ValueHandler(_typeRegistry);

            Header oldHeader = null;
            try
            {
                ByteBuffer encodedBuf = payload.duplicate();
                Object value = valueHandler.parse(payload);
                if(value instanceof Header)
                {
                    oldHeader = (Header) value;
                }
                else
View Full Code Here


    public SASLFrameHandler(final ConnectionEndpoint connection)
    {
        _connection = connection;
        _typeHandler = new ValueHandler(connection.getDescribedTypeRegistry());

    }
View Full Code Here


    public FrameHandler(final ConnectionEndpoint connection)
    {
        _connection = connection;
        _typeHandler = new ValueHandler(connection.getDescribedTypeRegistry());

    }
View Full Code Here

            System.out.println((midTime - startTime));

        }


        ValueHandler handler = new ValueHandler(registry);
        System.out.println("------ Decode (time in ms for 1 million opens)");
        for(int n = 0; n < 100; n++)
        {
            long startTime = System.currentTimeMillis();
            for(int i = 1000000; i !=0; i--)
            {
                buf.flip();
                handler.parse(buf);
                handler.parse(buf);
                handler.parse(buf);

            }
            long midTime = System.currentTimeMillis();
            System.out.println((midTime - startTime));
        }
View Full Code Here

    private ValueHandler _valueHandler;


    public SectionDecoderImpl(final AMQPDescribedTypeRegistry describedTypeRegistry)
    {
        _valueHandler = new ValueHandler(describedTypeRegistry);
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.amqp_1_0.codec.ValueHandler

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.