org.mule.tck.testmodels.mule
Class TestTransaction

java.lang.Object
  extended by org.mule.transaction.AbstractTransaction
      extended by org.mule.transaction.AbstractSingleResourceTransaction
          extended by org.mule.tck.testmodels.mule.TestTransaction
All Implemented Interfaces:
Transaction

public class TestTransaction
extends AbstractSingleResourceTransaction

A test transaction that does nothing on commit or rollback. The transaction does retain a status so that developers can determine if the the transaction was rolled back or committed.


Field Summary
 
Fields inherited from class org.mule.transaction.AbstractSingleResourceTransaction
key, resource, rollbackOnly, started, txStatusMappings
 
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
TestTransaction(MuleContext muleContext)
           
TestTransaction(MuleContext mockMuleContext, boolean isXa)
           
 
Method Summary
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
protected  Class getKeyType()
           
protected  Class getResourceType()
           
 String getTestProperty()
           
 boolean isXA()
           
 void resume()
           
 void setTestProperty(String testProperty)
           
 void setXA(boolean xa)
           
 Transaction suspend()
           
 
Methods inherited from class org.mule.transaction.AbstractSingleResourceTransaction
begin, bindResource, commit, getResource, getStatus, hasResource, rollback, setRollbackOnly, supports, toString
 
Methods inherited from class org.mule.transaction.AbstractTransaction
fireNotification, getId, isBegun, isCommitted, isRollbackOnly, isRolledBack, unbindTransaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestTransaction

public TestTransaction(MuleContext muleContext)

TestTransaction

public TestTransaction(MuleContext mockMuleContext,
                       boolean isXa)
Method Detail

getResourceType

protected Class getResourceType()
Overrides:
getResourceType in class AbstractSingleResourceTransaction

getKeyType

protected Class getKeyType()
Overrides:
getKeyType in class AbstractSingleResourceTransaction

doBegin

protected void doBegin()
                throws TransactionException
Really begin the transaction. Note that resources are enlisted yet.

Specified by:
doBegin in class AbstractTransaction
Throws:
TransactionException

doCommit

protected void doCommit()
                 throws TransactionException
Commit the transaction on the underlying resource

Specified by:
doCommit in class AbstractTransaction
Throws:
TransactionException

doRollback

protected void doRollback()
                   throws TransactionException
Rollback the transaction on the underlying resource

Specified by:
doRollback in class AbstractTransaction
Throws:
TransactionException

getTestProperty

public String getTestProperty()

setTestProperty

public void setTestProperty(String testProperty)

isXA

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

setXA

public void setXA(boolean xa)

suspend

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

resume

public void resume()
            throws TransactionException
Specified by:
resume in interface Transaction
Overrides:
resume in class AbstractTransaction
Throws:
TransactionException


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