public abstract class JtaTransactionPolicy extends java.lang.Object implements TransactionPolicy
TransactionPolicy.TransactionSynchronization| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
logger |
protected TransactionManager |
transactionManager |
protected TransactionType |
transactionType |
protected static Logger |
txLogger |
| Constructor and Description |
|---|
JtaTransactionPolicy(TransactionType transactionType,
TransactionManager transactionManager) |
| Modifier and Type | Method and Description |
|---|---|
protected Transaction |
beginTransaction() |
protected void |
completeTransaction(Transaction tx) |
void |
enlistResource(javax.transaction.xa.XAResource xaResource)
Enlists a XAResource in the actual active transaction.
|
protected void |
fireNonTransactionalCompletion() |
abstract Transaction |
getCurrentTransaction() |
java.lang.Object |
getResource(java.lang.Object key)
Gets a resource associated with the specified key.
|
protected Transaction |
getTransaction() |
TransactionType |
getTransactionType()
Gets the TransactionType for this policy.
|
boolean |
isRollbackOnly()
If true, this TransactionPolicy will ultimately end with rollback.
|
boolean |
isTransactionActive()
Is there a actual transaction active?
|
void |
putResource(java.lang.Object key,
java.lang.Object value)
Associates the specified resource with the specified key.
|
void |
registerSynchronization(TransactionPolicy.TransactionSynchronization synchronization)
Registers a listener for transaction synchronization events.
|
java.lang.Object |
removeResource(java.lang.Object key)
Removes and returns the resource associated with the specified key.
|
protected void |
resumeTransaction(Transaction tx) |
protected void |
rollbackTransaction(Transaction tx) |
void |
setRollbackOnly()
Sets this TransactionPolicy to rollback when completed
|
void |
setRollbackOnly(java.lang.Throwable reason)
Sets this TransactionPolicy to rollback when completed
|
protected void |
setRollbackOnly(Transaction tx,
java.lang.Throwable reason) |
protected Transaction |
suspendTransaction() |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcommit, isClientTransaction, isNewTransactionprotected static final Logger logger
protected static final Logger txLogger
protected final TransactionType transactionType
protected final TransactionManager transactionManager
public JtaTransactionPolicy(TransactionType transactionType, TransactionManager transactionManager)
public TransactionType getTransactionType()
TransactionPolicygetTransactionType in interface TransactionPolicypublic abstract Transaction getCurrentTransaction()
public boolean isTransactionActive()
TransactionPolicyisTransactionActive in interface TransactionPolicypublic boolean isRollbackOnly()
TransactionPolicyisRollbackOnly in interface TransactionPolicypublic void setRollbackOnly()
TransactionPolicysetRollbackOnly in interface TransactionPolicypublic void setRollbackOnly(java.lang.Throwable reason)
TransactionPolicysetRollbackOnly in interface TransactionPolicypublic java.lang.Object getResource(java.lang.Object key)
TransactionPolicygetResource in interface TransactionPolicykey - the resource keypublic void putResource(java.lang.Object key,
java.lang.Object value)
TransactionPolicyputResource in interface TransactionPolicykey - the resource keyvalue - the resourcepublic java.lang.Object removeResource(java.lang.Object key)
TransactionPolicyremoveResource in interface TransactionPolicykey - the resource keypublic void registerSynchronization(TransactionPolicy.TransactionSynchronization synchronization)
TransactionPolicyregisterSynchronization in interface TransactionPolicysynchronization - the transaction synchronization listenerprotected void fireNonTransactionalCompletion()
public void enlistResource(javax.transaction.xa.XAResource xaResource)
throws SystemException
TransactionPolicyenlistResource in interface TransactionPolicyxaResource - the XAResource to enlistSystemException - if the xaResource could not be enlisted in the
transactionpublic java.lang.String toString()
toString in class java.lang.Objectprotected Transaction getTransaction()
throws SystemException
SystemExceptionprotected void setRollbackOnly(Transaction tx,
java.lang.Throwable reason)
protected Transaction beginTransaction()
throws SystemException
SystemExceptionprotected Transaction suspendTransaction()
throws SystemException
SystemExceptionprotected void resumeTransaction(Transaction tx)
throws SystemException
SystemExceptionprotected void completeTransaction(Transaction tx)
throws SystemException,
ApplicationException
SystemExceptionApplicationExceptionprotected void rollbackTransaction(Transaction tx)
throws SystemException
SystemException