Package org.apache.qpid.server.store

Examples of org.apache.qpid.server.store.Transaction


            {
                return mockQueueId;
            }
        };

        Transaction txn = log.newTransaction();

        txn.enqueueMessage(mockQueue, new MockMessage(21L));
        txn.abortTran();

        txn = log.newTransaction();
        txn.enqueueMessage(mockQueue, new MockMessage(22L));
        txn.enqueueMessage(mockQueue, new MockMessage(23L));
        txn.commitTran();

        List<Long> enqueuedIds = bdbStore.getEnqueuedMessages(mockQueueId);

        assertEquals("Number of enqueued messages is incorrect", 2, enqueuedIds.size());
        Long val = enqueuedIds.get(0);
View Full Code Here


            {
                return mockQueueId;
            }
        };

        Transaction txn = log.newTransaction();

        txn.enqueueMessage(mockQueue, new MockMessage(30L));
        txn.commitTran();

        txn = log.newTransaction();
        txn.enqueueMessage(mockQueue, new MockMessage(31L));
        txn.abortTran();

        txn = log.newTransaction();
        txn.enqueueMessage(mockQueue, new MockMessage(32L));
        txn.commitTran();

        List<Long> enqueuedIds = bdbStore.getEnqueuedMessages(mockQueueId);

        assertEquals("Number of enqueued messages is incorrect", 2, enqueuedIds.size());
        Long val = enqueuedIds.get(0);
View Full Code Here

    }

    public void dequeue(TransactionLogResource queue, EnqueueableMessage message, Action postTransactionAction)
    {
        Transaction txn = null;
        try
        {
            StoreFuture future;
            if(message.isPersistent() && queue.isDurable())
            {
                if (_logger.isDebugEnabled())
                {
                    _logger.debug("Dequeue of message number " + message.getMessageNumber() + " from transaction log. Queue : " + queue.getName());
                }

                txn = _messageStore.newTransaction();
                txn.dequeueMessage(queue, message);
                future = txn.commitTranAsync();

                txn = null;
            }
            else
            {
View Full Code Here

        }
    }

    public void dequeue(Collection<MessageInstance> queueEntries, Action postTransactionAction)
    {
        Transaction txn = null;
        try
        {
            for(MessageInstance entry : queueEntries)
            {
                ServerMessage message = entry.getMessage();
                TransactionLogResource queue = entry.getOwningResource();

                if(message.isPersistent() && queue.isDurable())
                {
                    if (_logger.isDebugEnabled())
                    {
                        _logger.debug("Dequeue of message number " + message.getMessageNumber() + " from transaction log. Queue : " + queue.getName());
                    }

                    if(txn == null)
                    {
                        txn = _messageStore.newTransaction();
                    }

                    txn.dequeueMessage(queue, message);
                }

            }
            StoreFuture future;
            if(txn != null)
            {
                future = txn.commitTranAsync();
                txn = null;
            }
            else
            {
                future = StoreFuture.IMMEDIATE_FUTURE;
View Full Code Here

    }


    public void enqueue(TransactionLogResource queue, EnqueueableMessage message, Action postTransactionAction)
    {
        Transaction txn = null;
        try
        {
            StoreFuture future;
            if(message.isPersistent() && queue.isDurable())
            {
                if (_logger.isDebugEnabled())
                {
                    _logger.debug("Enqueue of message number " + message.getMessageNumber() + " to transaction log. Queue : " + queue.getName());
                }

                txn = _messageStore.newTransaction();
                txn.enqueueMessage(queue, message);
                future = txn.commitTranAsync();
                txn = null;
            }
            else
            {
                future = StoreFuture.IMMEDIATE_FUTURE;
View Full Code Here

    }

    public void enqueue(List<? extends BaseQueue> queues, EnqueueableMessage message, Action postTransactionAction)
    {
        Transaction txn = null;
        try
        {

            if(message.isPersistent())
            {
                for(BaseQueue queue : queues)
                {
                    if (queue.isDurable())
                    {
                        if (_logger.isDebugEnabled())
                        {
                            _logger.debug("Enqueue of message number " + message.getMessageNumber() + " to transaction log. Queue : " + queue.getName());
                        }
                        if (txn == null)
                        {
                            txn = _messageStore.newTransaction();
                        }

                        txn.enqueueMessage(queue, message);


                    }
                }

            }
            StoreFuture future;
            if (txn != null)
            {
                future = txn.commitTranAsync();
                txn = null;
            }
            else
            {
                future = StoreFuture.IMMEDIATE_FUTURE;
View Full Code Here

            {
                return true;
            }
        };

        Transaction txn = log.newTransaction();

        txn.enqueueMessage(mockQueue, new MockMessage(1L));
        txn.enqueueMessage(mockQueue, new MockMessage(5L));
        txn.commitTran();

        List<Long> enqueuedIds = bdbStore.getEnqueuedMessages(mockQueueId);

        assertEquals("Number of enqueued messages is incorrect", 2, enqueuedIds.size());
        Long val = enqueuedIds.get(0);
View Full Code Here

            {
                return true;
            }
        };

        Transaction txn = log.newTransaction();

        txn.enqueueMessage(mockQueue, new MockMessage(21L));
        txn.abortTran();

        txn = log.newTransaction();
        txn.enqueueMessage(mockQueue, new MockMessage(22L));
        txn.enqueueMessage(mockQueue, new MockMessage(23L));
        txn.commitTran();

        List<Long> enqueuedIds = bdbStore.getEnqueuedMessages(mockQueueId);

        assertEquals("Number of enqueued messages is incorrect", 2, enqueuedIds.size());
        Long val = enqueuedIds.get(0);
View Full Code Here

            {
                return true;
            }
        };

        Transaction txn = log.newTransaction();

        txn.enqueueMessage(mockQueue, new MockMessage(30L));
        txn.commitTran();

        txn = log.newTransaction();
        txn.enqueueMessage(mockQueue, new MockMessage(31L));
        txn.abortTran();

        txn = log.newTransaction();
        txn.enqueueMessage(mockQueue, new MockMessage(32L));
        txn.commitTran();

        List<Long> enqueuedIds = bdbStore.getEnqueuedMessages(mockQueueId);

        assertEquals("Number of enqueued messages is incorrect", 2, enqueuedIds.size());
        Long val = enqueuedIds.get(0);
View Full Code Here

        immediateAction.postCommit();
    }

    public void dequeue(TransactionLogResource queue, EnqueueableMessage message, Action postTransactionAction)
    {
        Transaction txn = null;
        try
        {
            if(message.isPersistent() && queue.isDurable())
            {
                if (_logger.isDebugEnabled())
                {
                    _logger.debug("Dequeue of message number " + message.getMessageNumber() + " from transaction log. Queue : " + queue.getName());
                }

                txn = _messageStore.newTransaction();
                txn.dequeueMessage(queue, message);
                txn.commitTran();
                txn = null;
            }
            postTransactionAction.postCommit();
            postTransactionAction = null;
        }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.store.Transaction

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.