public interface TransactionPolicy
| Modifier and Type | Interface and Description |
|---|---|
static interface |
TransactionPolicy.TransactionSynchronization
TransactionSynchronization receives notifications as the Transaction
completes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Commits or rolls back this TransactionPolicy.
|
void |
enlistResource(XAResource xaResource)
Enlists a XAResource in the actual active transaction.
|
Object |
getResource(Object key)
Gets a resource associated with the specified key.
|
TransactionType |
getTransactionType()
Gets the TransactionType for this policy.
|
boolean |
isClientTransaction()
Is this policy running in an inhreited transaction? Some
TransactionTypes, such as Required or Supported, use the caller's
transaction instead of starting a new transaction.
|
boolean |
isNewTransaction()
Is this a new transaction and not an inhreited transaction or no transaction? Some
TransactionTypes, such as Required or Supported, use the caller's
transaction instead of starting a new transaction.
|
boolean |
isRollbackOnly()
If true, this TransactionPolicy will ultimately end with rollback.
|
boolean |
isTransactionActive()
Is there a actual transaction active?
|
void |
putResource(Object key,
Object value)
Associates the specified resource with the specified key.
|
void |
registerSynchronization(TransactionPolicy.TransactionSynchronization synchronization)
Registers a listener for transaction synchronization events.
|
Object |
removeResource(Object key)
Removes and returns the resource associated with the specified key.
|
void |
setRollbackOnly()
Sets this TransactionPolicy to rollback when completed
|
void |
setRollbackOnly(Throwable reason)
Sets this TransactionPolicy to rollback when completed
|
TransactionType getTransactionType()
boolean isNewTransaction()
boolean isClientTransaction()
boolean isTransactionActive()
boolean isRollbackOnly()
void setRollbackOnly()
void setRollbackOnly(Throwable reason)
void commit()
throws ApplicationException,
SystemException
ApplicationException - if recoverable exception is encounteredSystemException - if an unrecoverable exception is encounteredObject getResource(Object key)
key - the resource keyvoid putResource(Object key, Object value)
key - the resource keyvalue - the resourceObject removeResource(Object key)
key - the resource keyvoid registerSynchronization(TransactionPolicy.TransactionSynchronization synchronization)
synchronization - the transaction synchronization listenervoid enlistResource(XAResource xaResource) throws SystemException
xaResource - the XAResource to enlistSystemException - if the xaResource could not be enlisted in the
transactionCopyright © 1999–2014 The Apache Software Foundation. All rights reserved.