Package org.apache.qpid.server.message

Examples of org.apache.qpid.server.message.MessageReference


        StoredMessage storedMessage = _store.addMessage(mmd);

        AMQMessage message = new AMQMessage(storedMessage);


        MessageReference ref = message.newReference();
        // we call routing complete to set up the handle
     //   message.routingComplete(_store, _storeContext, new MessageHandleFactory());

        assertEquals(1, _store.getMessageCount());
        MessageReference ref2 = message.newReference();
        ref.release();
        assertEquals(1, _store.getMessageCount());
    }
View Full Code Here


            try
            {
                final boolean immediate = _incommingMessage.isImmediate();

                final AMQMessage amqMessage = createAMQMessage(_incommingMessage);
                MessageReference ref = amqMessage.newReference();

                for(int i = 0; i < _destinationQueues.size(); i++)
                {
                    BaseQueue queue = _destinationQueues.get(i);

                    BaseQueue.PostEnqueueAction action;

                    if(immediate)
                    {
                        action = new ImmediateAction(queue);
                    }
                    else
                    {
                        action = null;
                    }

                    queue.enqueue(amqMessage, isTransactional(), action);

                    if(queue instanceof AMQQueue)
                    {
                        ((AMQQueue)queue).checkCapacity(AMQChannel.this);
                    }

                }

                _incommingMessage.getStoredMessage().flushToStore();
                ref.release();
            }
            catch (AMQException e)
            {
                // TODO
                throw new RuntimeException(e);
View Full Code Here

            {
                if(_messageNumber == message.getMessageNumber())
                {
                    try
                    {
                        MessageReference reference = message.newReference();
                        try
                        {
                            _messageObject = convertToObject(entry, true);
                        }
                        finally
                        {
                            reference.release();
                        }
                        return true;
                    }
                    catch (MessageDeletedException e)
                    {
View Full Code Here

            {
                if(_messageNumber == message.getMessageNumber())
                {
                    try
                    {
                        MessageReference reference = message.newReference();
                        try
                        {
                            _mimeType = message.getMessageHeader().getMimeType();
                            _size = message.getSize();
                            _content = new byte[(int) _size];
                            _found = true;
                            message.getContent(ByteBuffer.wrap(_content), 0);
                        }
                        finally
                        {
                            reference.release();
                        }
                        return true;
                    }
                    catch (MessageDeletedException e)
                    {
View Full Code Here

            try
            {
                final boolean immediate = _incommingMessage.isImmediate();

                final AMQMessage amqMessage = createAMQMessage(_incommingMessage);
                MessageReference ref = amqMessage.newReference();

                for(final BaseQueue queue : _destinationQueues)
                {
                    BaseQueue.PostEnqueueAction action;

                    if(immediate)
                    {
                        action = new ImmediateAction(queue);
                    }
                    else
                    {
                        action = null;
                    }

                    queue.enqueue(amqMessage, action);

                    if(queue instanceof AMQQueue)
                    {
                        ((AMQQueue)queue).checkCapacity(AMQChannel.this);
                    }

                }
                ref.release();
            }
            catch (AMQException e)
            {
                // TODO
                throw new RuntimeException(e);
View Full Code Here

            ServerMessage message = entry.getMessage();
            if(message != null)
            {
                if(_messageNumber == message.getMessageNumber())
                {
                    MessageReference reference = message.newReference();

                    _mimeType = message.getMessageHeader().getMimeType();
                    _size = message.getSize();
                    _content = new byte[(int)_size];
                    _found = true;
                    message.getContent(ByteBuffer.wrap(_content),0);
                    reference.release();
                    return true;
                }

            }
            return false;
View Full Code Here

            ServerMessage message = entry.getMessage();
            if(message != null)
            {
                if(_messageNumber == message.getMessageNumber())
                {
                    MessageReference reference = message.newReference();
                    _messageObject = convertToObject(entry, true);
                    reference.release();
                    return true;
                }
            }
            return false;
        }
View Full Code Here

                final ServerMessage message = _recoveredMessages.get(messageId);
                _unusedMessages.remove(messageId);

                if(message != null)
                {
                    final MessageReference ref = message.newReference();


                    branch.enqueue(queue,message);

                    branch.addPostTransactionAction(new ServerTransaction.Action()
                    {

                        public void postCommit()
                        {
                            queue.enqueue(message, null);
                            ref.release();
                        }

                        public void onRollback()
                        {
                            ref.release();
                        }
                    });
                }
                else
                {
View Full Code Here

            ServerMessage message = entry.getMessage();
            if(message != null)
            {
                if(_messageNumber == message.getMessageNumber())
                {
                    MessageReference reference = message.newReference();

                    _mimeType = message.getMessageHeader().getMimeType();
                    _size = message.getSize();
                    _content = new byte[(int)_size];
                    _found = true;
                    message.getContent(ByteBuffer.wrap(_content),0);
                    reference.release();
                    return true;
                }

            }
            return false;
View Full Code Here

            ServerMessage message = entry.getMessage();
            if(message != null)
            {
                if(_messageNumber == message.getMessageNumber())
                {
                    MessageReference reference = message.newReference();
                    _messageObject = convertToObject(entry, true);
                    reference.release();
                    return true;
                }
            }
            return false;
        }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.message.MessageReference

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.