Search in sources :

Example 11 with ResourceManagerException

use of org.mule.runtime.core.api.transaction.xa.ResourceManagerException in project mule by mulesoft.

the class TransientQueueTransactionContext method doCommit.

@Override
public void doCommit() throws ResourceManagerException {
    try {
        if (added != null) {
            for (Map.Entry<QueueStore, List<Serializable>> entry : added.entrySet()) {
                QueueStore queue = entry.getKey();
                List<Serializable> queueAdded = entry.getValue();
                if (queueAdded != null && queueAdded.size() > 0) {
                    for (Serializable object : queueAdded) {
                        queue.putNow(object);
                    }
                }
            }
        }
    } catch (Exception e) {
        throw new ResourceManagerException(e);
    } finally {
        added = null;
        removed = null;
    }
}
Also used : Serializable(java.io.Serializable) List(java.util.List) ArrayList(java.util.ArrayList) ResourceManagerException(org.mule.runtime.core.api.transaction.xa.ResourceManagerException) Map(java.util.Map) HashMap(java.util.HashMap) ResourceManagerException(org.mule.runtime.core.api.transaction.xa.ResourceManagerException) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException)

Aggregations

ResourceManagerException (org.mule.runtime.core.api.transaction.xa.ResourceManagerException)11 XAException (javax.transaction.xa.XAException)5 Serializable (java.io.Serializable)2 LocalQueueTxJournalEntry (org.mule.runtime.core.internal.util.journal.queue.LocalQueueTxJournalEntry)2 XaQueueTxJournalEntry (org.mule.runtime.core.internal.util.journal.queue.XaQueueTxJournalEntry)2 PersistentXaTransactionContext (org.mule.runtime.core.internal.util.queue.PersistentXaTransactionContext)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Test (org.junit.Test)1 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)1 DefaultQueueConfiguration (org.mule.runtime.core.api.util.queue.DefaultQueueConfiguration)1 LocalTxQueueTransactionRecoverer (org.mule.runtime.core.internal.util.journal.queue.LocalTxQueueTransactionRecoverer)1