org.mule.processor
Class DelegateTransaction

java.lang.Object
  extended by org.mule.transaction.AbstractTransaction
      extended by org.mule.processor.DelegateTransaction
All Implemented Interfaces:
Transaction

public class DelegateTransaction
extends AbstractTransaction

Transaction placeholder to replace with proper transaction once transactional resource is discovered by mule


Field Summary
 
Fields inherited from class org.mule.transaction.AbstractTransaction
id, logger, muleContext
 
Fields inherited from interface org.mule.api.transaction.Transaction
STATUS_ACTIVE, STATUS_COMMITTED, STATUS_COMMITTING, STATUS_MARKED_ROLLBACK, STATUS_NO_TRANSACTION, STATUS_PREPARED, STATUS_PREPARING, STATUS_ROLLEDBACK, STATUS_ROLLING_BACK, STATUS_UNKNOWN
 
Constructor Summary
DelegateTransaction(MuleContext muleContext)
           
 
Method Summary
 void bindResource(Object key, Object resource)
           
protected  void doBegin()
          Really begin the transaction.
protected  void doCommit()
          Commit the transaction on the underlying resource
protected  void doRollback()
          Rollback the transaction on the underlying resource
 String getId()
           
 Object getResource(Object key)
           
 int getStatus()
           
 boolean hasResource(Object key)
           
 boolean isBegun()
           
 boolean isCommitted()
           
 boolean isRollbackOnly()
           
 boolean isRolledBack()
           
 boolean isXA()
           
 void resume()
          Resume the XA transaction
 void setRollbackOnly()
           
 boolean supports(Object key, Object resource)
           
 boolean supportsInnerTransaction(Transaction transaction)
           
 Transaction suspend()
          Suspend the XA transaction
 
Methods inherited from class org.mule.transaction.AbstractTransaction
begin, commit, fireNotification, rollback, toString, unbindTransaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DelegateTransaction

public DelegateTransaction(MuleContext muleContext)
Method Detail

doBegin

protected void doBegin()
                throws TransactionException
Description copied from class: AbstractTransaction
Really begin the transaction. Note that resources are enlisted yet.

Specified by:
doBegin in class AbstractTransaction
Throws:
TransactionException

doCommit

protected void doCommit()
                 throws TransactionException
Description copied from class: AbstractTransaction
Commit the transaction on the underlying resource

Specified by:
doCommit in class AbstractTransaction
Throws:
TransactionException

doRollback

protected void doRollback()
                   throws TransactionException
Description copied from class: AbstractTransaction
Rollback the transaction on the underlying resource

Specified by:
doRollback in class AbstractTransaction
Throws:
TransactionException

getStatus

public int getStatus()
              throws TransactionException
Throws:
TransactionException

isBegun

public boolean isBegun()
                throws TransactionException
Specified by:
isBegun in interface Transaction
Overrides:
isBegun in class AbstractTransaction
Throws:
TransactionException

isRolledBack

public boolean isRolledBack()
                     throws TransactionException
Specified by:
isRolledBack in interface Transaction
Overrides:
isRolledBack in class AbstractTransaction
Throws:
TransactionException

isCommitted

public boolean isCommitted()
                    throws TransactionException
Specified by:
isCommitted in interface Transaction
Overrides:
isCommitted in class AbstractTransaction
Throws:
TransactionException

getResource

public Object getResource(Object key)

hasResource

public boolean hasResource(Object key)

supports

public boolean supports(Object key,
                        Object resource)
Parameters:
key - transactional resource key (i.e jdbc DataSource or jms Connection)
resource - transactional resource (i.e. jdbc Connection or jms Session)
Returns:
true if the current transaction supports to bind transactional resources key and resource

bindResource

public void bindResource(Object key,
                         Object resource)
                  throws TransactionException
Throws:
TransactionException

setRollbackOnly

public void setRollbackOnly()
                     throws TransactionException
Throws:
TransactionException

isRollbackOnly

public boolean isRollbackOnly()
                       throws TransactionException
Specified by:
isRollbackOnly in interface Transaction
Overrides:
isRollbackOnly in class AbstractTransaction
Throws:
TransactionException

isXA

public boolean isXA()
Specified by:
isXA in interface Transaction
Overrides:
isXA in class AbstractTransaction

resume

public void resume()
            throws TransactionException
Description copied from interface: Transaction
Resume the XA transaction

Specified by:
resume in interface Transaction
Overrides:
resume in class AbstractTransaction
Throws:
TransactionException - if any error

suspend

public Transaction suspend()
                    throws TransactionException
Description copied from interface: Transaction
Suspend the XA transaction

Specified by:
suspend in interface Transaction
Overrides:
suspend in class AbstractTransaction
Throws:
TransactionException - if any error

getId

public String getId()
Specified by:
getId in interface Transaction
Overrides:
getId in class AbstractTransaction
Returns:
TX identification.

supportsInnerTransaction

public boolean supportsInnerTransaction(Transaction transaction)


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.