Package org.apache.qpid.server.txn

Examples of org.apache.qpid.server.txn.AutoCommitTransaction



        // check and deliver if header says body length is zero
        if (currentMessage.allContentReceived())
        {
            ServerTransaction trans = new AutoCommitTransaction(getVirtualHost().getMessageStore());
            final List<? extends BaseQueue> destinationQueues = currentMessage.getDestinationQueues();
            trans.enqueue(currentMessage.getDestinationQueues(), currentMessage, new ServerTransaction.Action() {
                public void postCommit()
                {
                    try
                    {
                        AMQMessage message = new AMQMessage(currentMessage.getStoredMessage());
View Full Code Here


            {
                final List<? extends BaseQueue> rerouteQueues = alternateExchange.route(new InboundMessageAdapter(this));
                final ServerMessage message = getMessage();
                if(rerouteQueues != null && rerouteQueues.size() != 0)
                {
                    ServerTransaction txn = new AutoCommitTransaction(getQueue().getVirtualHost().getTransactionLog());

                    txn.enqueue(rerouteQueues, message, new ServerTransaction.Action() {
                        public void postCommit()
                        {
                            try
                            {
                                for(BaseQueue queue : rerouteQueues)
                                {
                                    queue.enqueue(message);
                                }
                            }
                            catch (AMQException e)
                            {
                                throw new RuntimeException(e);
                            }
                        }

                        public void onRollback()
                        {

                        }
                    });
                    txn.dequeue(currentQueue,message,
                                new ServerTransaction.Action()
                                {
                                    public void postCommit()
                                    {
                                        discard();
View Full Code Here

            msg.enqueue(qs);
            MessageMetaData mmd = msg.headersReceived();
            msg.setStoredMessage(_messageStore.addMessage(mmd));
            if(msg.allContentReceived())
            {
                ServerTransaction txn = new AutoCommitTransaction(_messageStore);
                txn.enqueue(_queue, msg, new ServerTransaction.Action() {
                    public void postCommit()
                    {
                        try
                        {
                            _queue.enqueue(new AMQMessage(msg.getStoredMessage()));
View Full Code Here

        return count;
    }

    private void dequeueEntry(final QueueEntry node)
    {
        ServerTransaction txn = new AutoCommitTransaction(getVirtualHost().getTransactionLog());
        dequeueEntry(node, txn);
    }
View Full Code Here

                             RecordDeliveryMethod recordMethod)
            throws AMQException
        {
            super(channel, consumerTag, filters, creditManager, deliveryMethod, recordMethod);

            _txn = new AutoCommitTransaction(channel.getVirtualHost().getMessageStore());
        }
View Full Code Here

        }
    }

    private void forceDequeue(final MessageInstance entry, final boolean restoreCredit)
    {
        AutoCommitTransaction dequeueTxn = new AutoCommitTransaction(_session.getVirtualHost().getMessageStore());
        dequeueTxn.dequeue(entry.getOwningResource(), entry.getMessage(),
                           new ServerTransaction.Action()
                           {
                               public void postCommit()
                               {
                                   if (restoreCredit)
View Full Code Here

        return count;
    }

    private void dequeueEntry(final QueueEntry node)
    {
        ServerTransaction txn = new AutoCommitTransaction(getVirtualHost().getMessageStore());
        dequeueEntry(node, txn);
    }
View Full Code Here

            final StoredMessage<MessageMetaData> result =_messageStore.addMessage(mmd);

            final StoredMessage storedMessage = result;
            final AMQMessage message = new AMQMessage(storedMessage);
            ServerTransaction txn = new AutoCommitTransaction(_messageStore);
            txn.enqueue(_queue, message,
                        new ServerTransaction.Action()
                        {
                            public void postCommit()
                            {
                                _queue.enqueue(message,null);
View Full Code Here

        }
        else
        {
            _virtualHost.getDefaultDestination().send(response,
                                                      message.getMessageHeader().getReplyTo(), InstanceProperties.EMPTY,
                                                      new AutoCommitTransaction(_virtualHost.getMessageStore()),
                                                      null);
        }
        // TODO - route to a queue

    }
View Full Code Here

        final StoredMessage<MessageMetaData> storedMessage = _virtualHost.getMessageStore().addMessage(mmd);
        final AMQMessage currentMessage = new AMQMessage(storedMessage);



        ServerTransaction trans = new AutoCommitTransaction(_virtualHost.getMessageStore());
        exchange.send(currentMessage, routingKey, InstanceProperties.EMPTY, trans, null);

    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.txn.AutoCommitTransaction

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.