public abstract class AbstractTransaction extends Object implements Transaction
Modifier and Type | Field and Description |
---|---|
protected String |
id |
protected Log |
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
TransactionNotificationListener s. |
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, wait
bindResource, getResource, getStatus, hasResource, setRollbackOnly, supports
protected final transient Log logger
protected String id
protected int timeout
protected MuleContext muleContext
protected AbstractTransaction(MuleContext muleContext)
public boolean isRollbackOnly() throws TransactionException
isRollbackOnly
in interface Transaction
TransactionException
public boolean isBegun() throws TransactionException
isBegun
in interface Transaction
TransactionException
public boolean isRolledBack() throws TransactionException
isRolledBack
in interface Transaction
TransactionException
public boolean isCommitted() throws TransactionException
isCommitted
in interface Transaction
TransactionException
public void begin() throws TransactionException
Transaction
begin
in interface Transaction
TransactionException
public void commit() throws TransactionException
Transaction
commit
in interface Transaction
TransactionException
public void rollback() throws TransactionException
Transaction
rollback
in interface Transaction
TransactionException
protected void unbindTransaction() throws TransactionException
TransactionException
protected abstract void doBegin() throws TransactionException
TransactionException
protected abstract void doCommit() throws TransactionException
TransactionException
protected abstract void doRollback() throws TransactionException
TransactionException
protected void fireNotification(TransactionNotification notification)
TransactionNotificationListener
s.public boolean isXA()
isXA
in interface Transaction
public void resume() throws TransactionException
Transaction
resume
in interface Transaction
TransactionException
- if any errorpublic Transaction suspend() throws TransactionException
Transaction
suspend
in interface Transaction
TransactionException
- if any errorpublic String getId()
getId
in interface Transaction
public int getTimeout()
getTimeout
in interface Transaction
public void setTimeout(int timeout)
setTimeout
in interface Transaction
timeout
- configures the transactions timeout in millisecondsCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.