Package org.apache.qpid.amqp_1_0.codec

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


    protected SessionImpl(final ConnectionImpl connection, final AcknowledgeMode acknowledgeMode) throws JMSException
    {
        _connection = connection;
        _acknowledgeMode = acknowledgeMode;
        Connection clientConn = _connection.getClientConnection();
        try
        {
            _session = clientConn.createSession();
        }
        catch (ConnectionException e)
        {
            JMSException jmsException;
            if (e instanceof ChannelsExhaustedException)
View Full Code Here


                            return;
                        }
                    }
                    while(!_closed && (_started && (_recoveredMessage != null || !_messageConsumerList.isEmpty())))
                    {
                        Message msg;

                        MessageConsumerImpl consumer;

                        boolean recoveredMessage =  _recoveredMessage != null;
                        if(recoveredMessage)
                        {
                            consumer = _recoveredConsumer;
                            msg = _recoveredMessage;
                            _recoveredMessage = null;
                            _recoveredConsumer = null;
                        }
                        else
                        {
                            consumer = _messageConsumerList.remove(0);
                            msg = consumer.receive0(0L);
                        }

                        MessageListener listener = consumer._messageListener;

                        MessageImpl message = consumer.createJMSMessage(msg, recoveredMessage);

                        if(message != null)
                        {
                            if(_acknowledgeMode == AcknowledgeMode.CLIENT_ACKNOWLEDGE)
                            {
                                consumer.setLastUnackedMessage(msg.getDeliveryTag());
                            }
                            _currentConsumer = consumer;
                            _currentMessage = msg;
                            try
                            {
View Full Code Here

        Target target = new Target();
        target.setAddress(UUID.randomUUID().toString());

        try
        {
            Receiver receiver = new Receiver(getClientSession(), s, target, null,
                                             org.apache.qpid.amqp_1_0.client.AcknowledgeMode.ALO, false);

            final org.apache.qpid.amqp_1_0.type.Source receiverSource = receiver.getSource();
            if(receiverSource instanceof Source)
            {
                Source source = (Source) receiverSource;
                receiver.close();
                receiver = new Receiver(getClientSession(), s, target, source,
                        org.apache.qpid.amqp_1_0.client.AcknowledgeMode.ALO, false);

            }
            receiver.close();
        }
        catch(ConnectionErrorException  e)
        {
            if(e.getRemoteError().getCondition() == AmqpError.NOT_FOUND)
            {
View Full Code Here

    {
        checkClosed();
        checkNotTopicSession();
        try
        {
            Sender send = _session.createTemporaryQueueSender();

            TemporaryQueueImpl tempQ = new TemporaryQueueImpl(((Target)send.getTarget()).getAddress(), send, this);
            return tempQ;
        }
        catch (Sender.SenderCreationException e)
        {
            throw new JMSException("Unable to create temporary queue");
View Full Code Here

    {
        checkClosed();
        checkNotQueueSession();
        try
        {
            Sender send = _session.createTemporaryQueueSender();

            TemporaryTopicImpl tempQ = new TemporaryTopicImpl(((Target)send.getTarget()).getAddress(), send, this);
            return tempQ;
        }
        catch (Sender.SenderCreationException e)
        {
            throw new JMSException("Unable to create temporary queue");
View Full Code Here

        private final ByteBuffer _buffer = ByteBuffer.wrap(_bytes);

        public FrameToBytesSourceAdapter(final FrameSource frameSource, ValueWriter.Registry registry)
        {
            _frameSource = frameSource;
            _writer =  new FrameWriter(registry);
        }
View Full Code Here

                {
                    _network.close();
                }
            }
        });
        _frameWriter =  new FrameWriter(_conn.getDescribedTypeRegistry());
        _frameHandler = new SASLFrameHandler(_conn);

        _sender.send(HEADER.duplicate());
        _sender.flush();
View Full Code Here

                getLocalAddress())));
        _conn.setConnectionEventListener(new Connection_1_0(_appRegistry, _conn, _connectionId));
        _conn.setFrameOutputHandler(this);
        _conn.setRemoteAddress(_network.getRemoteAddress());

        _frameWriter =  new FrameWriter(_conn.getDescribedTypeRegistry());
        _frameHandler = new FrameHandler(_conn);

        _sender.send(HEADER.duplicate());
        _sender.flush();
    }
View Full Code Here

                {
                    _network.close();
                }
            }
        });
        _frameWriter =  new FrameWriter(_conn.getDescribedTypeRegistry());
        _frameHandler = new SASLFrameHandler(_conn);

        _sender.send(HEADER.duplicate());
        _sender.flush();
View Full Code Here

        byte[] result = new byte[10000];
        int pos = 0;

        final AMQPDescribedTypeRegistry typeRegistry = AMQPDescribedTypeRegistry.newInstance();
        AMQFrame frame = AMQFrame.createAMQFrame((short) 0, (FrameBody) vals[0]);
        FrameWriter writer =  new FrameWriter(typeRegistry);
        /*for(Object obj : vals)
        {
            final AMQPDescribedTypeRegistry typeRegistry = AMQPDescribedTypeRegistry.newInstance();
            ValueWriter writer = typeRegistry.getValueWriter(obj);
*/
            int count;

            ByteBuffer buf = ByteBuffer.wrap(result, pos, size);

            do
            {

                writer.writeToBuffer(buf);
                pos = buf.position();
                buf = ByteBuffer.wrap(result, pos, size);
                if(!writer.isComplete())
                {
                    count = 3;
                }

            } while (!writer.isComplete());
/*

        }
*/

 
View Full Code Here

TOP

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

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.