Package org.codehaus.activemq.service

Examples of org.codehaus.activemq.service.TransactionTask


        Set set = destinationMap.get(message.getJMSActiveMQDestination());
        for (Iterator i = set.iterator();i.hasNext();) {
            QueueMessageContainer container = (QueueMessageContainer) i.next();
            container.addMessage(message);
            // Once transaction has completed.. dispatch the message.
            TransactionManager.getContexTransaction().addPostCommitTask(new TransactionTask(){
                public void execute() throws Throwable {
                    dispatcher.wakeup();
                    updateSendStats(client, message);
                }
            });     
View Full Code Here


    public void addMessage(ActiveMQMessage message) throws JMSException {
        messageStore.addMessage(message);
        final MessageIdentity answer = message.getJMSMessageIdentity();
       
        // If there is no transaction.. then this executes directly.
        TransactionManager.getContexTransaction().addPostCommitTask(new TransactionTask(){
            public void execute() throws Throwable {
                synchronized( this ) {
                  messagesToBeDelivered.add(answer);
                }
            }
View Full Code Here

    public synchronized void delete(final MessageIdentity messageID, MessageAck ack) throws JMSException {
       
        messageStore.removeMessage(ack);         

        TransactionManager.getContexTransaction().addPostCommitTask(new TransactionTask(){
            public void execute() throws Throwable {
              doDelete(messageID);
            }
        });     
       
View Full Code Here

        final ActiveMQDestination destination = message.getJMSActiveMQDestination();
        if (destination == null || !destination.isTopic()) {
            return;
        }
       
        TransactionManager.getContexTransaction().addPostCommitTask(new TransactionTask(){
            public void execute() throws Throwable {
                doSendMessage(client, message, destination);
            }
        });     
       
View Full Code Here

                throw xae;
        }

        // Run the prePrepareTasks
        for (Iterator iter = prePrepareTasks.iterator(); iter.hasNext();) {
            TransactionTask r = (TransactionTask) iter.next();
            r.execute();
        }
    }
View Full Code Here

    }

    protected void postCommit() throws Throwable {
        // Run the postCommitTasks
        for (Iterator iter = postCommitTasks.iterator(); iter.hasNext();) {
            TransactionTask r = (TransactionTask) iter.next();
            r.execute();
        }
    }
View Full Code Here

    }

    public void postRollback() throws Throwable {
        // Run the postRollbackTasks
        for (Iterator iter = postRollbackTasks.iterator(); iter.hasNext();) {
            TransactionTask r = (TransactionTask) iter.next();
            r.execute();
        }
    }
View Full Code Here

                throw xae;
        }

        // Run the prePrepareTasks
        for (Iterator iter = prePrepareTasks.iterator(); iter.hasNext();) {
            TransactionTask r = (TransactionTask) iter.next();
            r.execute(broker);
        }
    }
View Full Code Here

    }

    protected void postCommit() throws Throwable {
        // Run the postCommitTasks
        for (Iterator iter = postCommitTasks.iterator(); iter.hasNext();) {
            TransactionTask r = (TransactionTask) iter.next();
            r.execute(broker);
        }
    }
View Full Code Here

    }

    public void postRollback() throws Throwable {
        // Run the postRollbackTasks
        for (Iterator iter = postRollbackTasks.iterator(); iter.hasNext();) {
            TransactionTask r = (TransactionTask) iter.next();
            r.execute(broker);
        }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.service.TransactionTask

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.