public abstract class AbstractTransaction extends Object implements Transaction
| Modifier and Type | Field and Description |
|---|---|
protected String |
id |
protected org.slf4j.Logger |
logger |
protected MuleContext |
muleContext |
protected int |
timeout |
STATUS_ACTIVE, STATUS_COMMITTED, STATUS_COMMITTING, STATUS_MARKED_ROLLBACK, STATUS_NO_TRANSACTION, STATUS_PREPARED, STATUS_PREPARING, STATUS_ROLLEDBACK, STATUS_ROLLING_BACK, STATUS_UNKNOWN| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTransaction(MuleContext muleContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
begin()
Begin the transaction.
|
void |
commit()
Commit the transaction
|
protected abstract void |
doBegin()
Really begin the transaction.
|
protected abstract void |
doCommit()
Commit the transaction on the underlying resource
|
protected abstract void |
doRollback()
Rollback the transaction on the underlying resource
|
protected void |
fireNotification(TransactionNotification notification)
Fires a server notification to all registered
TransactionNotificationListeners. |
String |
getId() |
int |
getTimeout() |
boolean |
isBegun() |
boolean |
isCommitted() |
boolean |
isRollbackOnly() |
boolean |
isRolledBack() |
boolean |
isXA() |
void |
resume()
Resume the XA transaction
|
void |
rollback()
Rollback the transaction
|
void |
setTimeout(int timeout) |
Transaction |
suspend()
Suspend the XA transaction
|
String |
toString() |
protected void |
unbindTransaction()
Unbind this transaction when complete
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbindResource, getResource, getStatus, hasResource, setRollbackOnly, supportsprotected final transient org.slf4j.Logger logger
protected String id
protected int timeout
protected MuleContext muleContext
protected AbstractTransaction(MuleContext muleContext)
public boolean isRollbackOnly()
throws org.mule.runtime.api.tx.TransactionException
isRollbackOnly in interface Transactionorg.mule.runtime.api.tx.TransactionExceptionpublic boolean isBegun()
throws org.mule.runtime.api.tx.TransactionException
isBegun in interface Transactionorg.mule.runtime.api.tx.TransactionExceptionpublic boolean isRolledBack()
throws org.mule.runtime.api.tx.TransactionException
isRolledBack in interface Transactionorg.mule.runtime.api.tx.TransactionExceptionpublic boolean isCommitted()
throws org.mule.runtime.api.tx.TransactionException
isCommitted in interface Transactionorg.mule.runtime.api.tx.TransactionExceptionpublic void begin()
throws org.mule.runtime.api.tx.TransactionException
Transactionbegin in interface Transactionorg.mule.runtime.api.tx.TransactionExceptionpublic void commit()
throws org.mule.runtime.api.tx.TransactionException
Transactioncommit in interface Transactionorg.mule.runtime.api.tx.TransactionExceptionpublic void rollback()
throws org.mule.runtime.api.tx.TransactionException
Transactionrollback in interface Transactionorg.mule.runtime.api.tx.TransactionExceptionprotected void unbindTransaction()
throws org.mule.runtime.api.tx.TransactionException
org.mule.runtime.api.tx.TransactionExceptionprotected abstract void doBegin()
throws org.mule.runtime.api.tx.TransactionException
org.mule.runtime.api.tx.TransactionExceptionprotected abstract void doCommit()
throws org.mule.runtime.api.tx.TransactionException
org.mule.runtime.api.tx.TransactionExceptionprotected abstract void doRollback()
throws org.mule.runtime.api.tx.TransactionException
org.mule.runtime.api.tx.TransactionExceptionprotected void fireNotification(TransactionNotification notification)
TransactionNotificationListeners.public boolean isXA()
isXA in interface Transactionpublic void resume()
throws org.mule.runtime.api.tx.TransactionException
Transactionresume in interface Transactionorg.mule.runtime.api.tx.TransactionException - if any errorpublic Transaction suspend() throws org.mule.runtime.api.tx.TransactionException
Transactionsuspend in interface Transactionorg.mule.runtime.api.tx.TransactionException - if any errorpublic String getId()
getId in interface Transactionpublic int getTimeout()
getTimeout in interface Transactionpublic void setTimeout(int timeout)
setTimeout in interface Transactiontimeout - configures the transactions timeout in millisecondsCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.