Package org.mule.api.transaction

Examples of org.mule.api.transaction.Transaction


     * parameter should be null
     */
    @Deprecated
    protected void rollbackTransaction()
    {
        Transaction tx = TransactionCoordination.getInstance().getTransaction();
        try
        {
            if (tx != null)
            {
                tx.setRollbackOnly();
            }
        }
        catch (TransactionException e)
        {
            logException(e);
View Full Code Here


     * @deprecated this method should not be used anymore. Transactions must be handled by provided ExceptionStrategy
     */
    @Deprecated
    protected void handleTransaction(Throwable t)
    {
        Transaction tx = TransactionCoordination.getInstance().getTransaction();

        if (tx == null)
        {
            return;
        }
View Full Code Here

    @Override
    public T execute(ExecutionCallback<T> callback) throws Exception
    {
        byte action = transactionConfig.getAction();
        Transaction transactionBeforeTemplate = TransactionCoordination.getInstance().getTransaction();
        if ((action == TransactionConfig.ACTION_NONE || action == TransactionConfig.ACTION_ALWAYS_BEGIN)
                && transactionBeforeTemplate != null)
        {
            if (logger.isDebugEnabled())
            {
View Full Code Here

    }

    @Override
    public final MuleEvent routeMessage(MuleMessage message) throws MuleException
    {
        Transaction tx = TransactionCoordination.getInstance().getTransaction();
        return routeMessage(message, tx, null);
    }
View Full Code Here

        return transactions.get();
    }

    public void unbindTransaction(final Transaction transaction) throws TransactionException
    {
        Transaction oldTx = transactions.get();

        if (oldTx instanceof TransactionCollection)
        {
            // if there are more in-flight aggregated transactions, do nothing yet
            if (!((TransactionCollection) oldTx).getTxCollection().isEmpty())
            {
                return;
            }
        }

        try
        {
            if (oldTx != null && !oldTx.equals(transaction))
            {
                throw new IllegalTransactionStateException(CoreMessages.transactionCannotUnbind());
            }
        }
        finally
View Full Code Here

        }
    }

    public void bindTransaction(final Transaction transaction) throws TransactionException
    {
        Transaction oldTx = transactions.get();
        // special handling for transaction collection
        if (oldTx != null && !(oldTx instanceof TransactionCollection) && !(oldTx instanceof DelegateTransaction))
        {
            throw new IllegalTransactionStateException(CoreMessages.transactionAlreadyBound());
        }
View Full Code Here

    public void resumeXaTransactionIfAvailable()
    {
        try
        {
            Transaction tx = suspendedTransaction.get();
            if (tx != null)
            {
                resumeSuspendedTransaction();
            }
        }
View Full Code Here

        }
    }

    public void commitCurrentTransaction()
    {
        Transaction tx = transactions.get();
        if (tx != null)
        {
            try
            {
                tx.commit();
            }
            catch (TransactionException e)
            {
                logger.error(e);
            }
View Full Code Here

        }
    }

    public void rollbackCurrentTransaction()
    {
        Transaction tx = transactions.get();
        if (tx != null)
        {
            try
            {
                tx.rollback();
            }
            catch (TransactionException e)
            {
                logger.error(e);
            }
View Full Code Here

        }
    }

    public void resolveTransaction() throws TransactionException
    {
        Transaction tx = TransactionCoordination.getInstance().getTransaction();
        if (tx.isRollbackOnly())
        {
            if (logger.isDebugEnabled())
            {
                logger.debug("Transaction has been marked rollbackOnly, rolling it back: " + tx);
            }
            tx.rollback();
        }
        else
        {
            if (logger.isDebugEnabled())
            {
                logger.debug("Committing transaction " + tx);
            }
            tx.commit();
        }
    }
View Full Code Here

TOP

Related Classes of org.mule.api.transaction.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.