public class XaTransaction extends AbstractTransaction
XaTransaction represents an XA transaction in Mule.| Modifier and Type | Field and Description |
|---|---|
protected Transaction |
transaction
The inner JTA transaction
|
protected TransactionManager |
txManager |
id, logger, muleContext, timeoutSTATUS_ACTIVE, STATUS_COMMITTED, STATUS_COMMITTING, STATUS_MARKED_ROLLBACK, STATUS_NO_TRANSACTION, STATUS_PREPARED, STATUS_PREPARING, STATUS_ROLLEDBACK, STATUS_ROLLING_BACK, STATUS_UNKNOWN| Constructor and Description |
|---|
XaTransaction(MuleContext context) |
| Modifier and Type | Method and Description |
|---|---|
void |
bindResource(Object key,
Object resource) |
protected void |
closeResources() |
boolean |
delistResource(XAResource resource,
int tmflag) |
protected void |
delistResources() |
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
|
boolean |
enlistResource(XAResource resource) |
Object |
getResource(Object key) |
int |
getStatus() |
Transaction |
getTransaction() |
boolean |
hasResource(Object key) |
boolean |
isXA() |
void |
resume()
Resume the XA transaction
|
void |
setRollbackOnly() |
boolean |
supports(Object key,
Object resource) |
Transaction |
suspend()
Suspend the XA transaction
|
String |
toString() |
begin, commit, fireNotification, getId, getTimeout, isBegun, isCommitted, isRollbackOnly, isRolledBack, rollback, setTimeout, unbindTransactionprotected Transaction transaction
protected TransactionManager txManager
public XaTransaction(MuleContext context)
protected void doBegin()
throws org.mule.runtime.api.tx.TransactionException
AbstractTransactiondoBegin in class AbstractTransactionorg.mule.runtime.api.tx.TransactionExceptionprotected void doCommit()
throws org.mule.runtime.api.tx.TransactionException
AbstractTransactiondoCommit in class AbstractTransactionorg.mule.runtime.api.tx.TransactionExceptionprotected void doRollback()
throws TransactionRollbackException
AbstractTransactiondoRollback in class AbstractTransactionTransactionRollbackExceptionpublic int getStatus()
throws TransactionStatusException
TransactionStatusExceptionpublic void setRollbackOnly()
public boolean hasResource(Object key)
public void bindResource(Object key, Object resource) throws org.mule.runtime.api.tx.TransactionException
key - Must be the provider of the resource object. i.e. for JDBC it's the XADataSource, for JMS is the
XAConnectionFactory. It can be a wrapper in which case should be a
XaResourceFactoryHolder to be able to determine correctly if there's already a
resource for that XAResource provider.resource - the resource object. It must be an XAResource or a
MuleXaObjectorg.mule.runtime.api.tx.TransactionExceptionpublic boolean enlistResource(XAResource resource) throws org.mule.runtime.api.tx.TransactionException
org.mule.runtime.api.tx.TransactionExceptionpublic boolean delistResource(XAResource resource, int tmflag) throws org.mule.runtime.api.tx.TransactionException
org.mule.runtime.api.tx.TransactionExceptionpublic String toString()
toString in class AbstractTransactionpublic Transaction getTransaction()
public boolean isXA()
isXA in interface TransactionisXA in class AbstractTransactionpublic void resume()
throws org.mule.runtime.api.tx.TransactionException
Transactionresume in interface Transactionresume in class AbstractTransactionorg.mule.runtime.api.tx.TransactionException - if any errorpublic Transaction suspend() throws org.mule.runtime.api.tx.TransactionException
Transactionsuspend in interface Transactionsuspend in class AbstractTransactionorg.mule.runtime.api.tx.TransactionException - if any errorprotected void delistResources()
protected void closeResources()
public boolean supports(Object key, Object resource)
key - transactional resource key (i.e jdbc DataSource or jms Connection)resource - transactional resource (i.e. jdbc Connection or jms Session)Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.