|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TransactionPolicy
TransactionPolicy represents a JEE container managed or bean manage transaction.
This class can be used to query the transaction status, set the transaction rollback only flag, associate resources with the transaction and to register a listener for transaction completion events.
Nested Class Summary | |
---|---|
static interface |
TransactionPolicy.TransactionSynchronization
TransactionSynchronization receives notifications as the Transaction completes. |
Method Summary | |
---|---|
void |
commit()
Commits or rolls back this TransactionPolicy. |
void |
enlistResource(javax.transaction.xa.XAResource xaResource)
Enlists a XAResource in the actual active transaction. |
java.lang.Object |
getResource(java.lang.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(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. |
void |
setRollbackOnly()
Sets this TransactionPolicy to rollback when completed |
Method Detail |
---|
TransactionType getTransactionType()
boolean isNewTransaction()
boolean isClientTransaction()
boolean isTransactionActive()
boolean isRollbackOnly()
void setRollbackOnly()
void commit() throws ApplicationException, SystemException
ApplicationException
- if recoverable exception is encountered
SystemException
- if an unrecoverable exception is encounteredjava.lang.Object getResource(java.lang.Object key)
key
- the resource key
void putResource(java.lang.Object key, java.lang.Object value)
key
- the resource keyvalue
- the resourcejava.lang.Object removeResource(java.lang.Object key)
key
- the resource key
void registerSynchronization(TransactionPolicy.TransactionSynchronization synchronization)
synchronization
- the transaction synchronization listenervoid enlistResource(javax.transaction.xa.XAResource xaResource) throws SystemException
xaResource
- the XAResource to enlist
SystemException
- if the xaResource could not be enlisted in the
transaction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |