org.apache.openejb.core.transaction
Interface BeanTransactionPolicy

All Superinterfaces:
TransactionPolicy
All Known Implementing Classes:
SpringBeanTransactionPolicy, TxBeanManaged

public interface BeanTransactionPolicy
extends TransactionPolicy

BeanTransactionPolicy is an extension to the TransactionPolicy which provides operations for controlling a JEE bean managed transaction.


Nested Class Summary
static interface BeanTransactionPolicy.SuspendedTransaction
          Represents a suspended transaction.
 
Nested classes/interfaces inherited from interface org.apache.openejb.core.transaction.TransactionPolicy
TransactionPolicy.TransactionSynchronization
 
Method Summary
 UserTransaction getUserTransaction()
          Gets the UserTransaction the bean uses to manage the transaction.
 void resumeUserTransaction(BeanTransactionPolicy.SuspendedTransaction suspendedTransaction)
          Resumes the transaction contained in the suspended transaction token.
 BeanTransactionPolicy.SuspendedTransaction suspendUserTransaction()
          Syspends the bean managed transaction.
 
Methods inherited from interface org.apache.openejb.core.transaction.TransactionPolicy
commit, enlistResource, getResource, getTransactionType, isClientTransaction, isNewTransaction, isRollbackOnly, isTransactionActive, putResource, registerSynchronization, removeResource, setRollbackOnly
 

Method Detail

getUserTransaction

UserTransaction getUserTransaction()
Gets the UserTransaction the bean uses to manage the transaction.

Returns:
the UserTransaction the bean uses to manage the transaction

suspendUserTransaction

BeanTransactionPolicy.SuspendedTransaction suspendUserTransaction()
                                                                  throws SystemException
Syspends the bean managed transaction. This is mainly used by stateful session beans which are required to maintain the bean managed transaction between calls. After this method completes the transaction will be suspended or if there is a problem it will be rolled back.

Returns:
the syspended transaction token or null if no transaction was active
Throws:
SystemException - if there was a problem suspending the transaction

resumeUserTransaction

void resumeUserTransaction(BeanTransactionPolicy.SuspendedTransaction suspendedTransaction)
                           throws SystemException
Resumes the transaction contained in the suspended transaction token. After this method completes the transaction will be resumes or if there is a problem it will be rolled back.

Parameters:
suspendedTransaction - the transaction to resume; not null
Throws:
SystemException - if there was a problem resuming the transaction


Copyright © 1999-2013 The Apache OpenEJB development community. All Rights Reserved.