org.apache.openejb.core.transaction
Class TxBeanManaged
java.lang.Object
org.apache.openejb.core.transaction.JtaTransactionPolicy
org.apache.openejb.core.transaction.TxBeanManaged
- All Implemented Interfaces:
- BeanTransactionPolicy, TransactionPolicy
public class TxBeanManaged
- extends JtaTransactionPolicy
- implements BeanTransactionPolicy
Methods inherited from class org.apache.openejb.core.transaction.JtaTransactionPolicy |
beginTransaction, completeTransaction, enlistResource, fireNonTransactionalCompletion, getResource, getTransaction, getTransactionType, isRollbackOnly, isTransactionActive, putResource, registerSynchronization, removeResource, resumeTransaction, rollbackTransaction, setRollbackOnly, setRollbackOnly, suspendTransaction, toString |
TxBeanManaged
public TxBeanManaged(TransactionManager transactionManager)
throws SystemException
- Throws:
SystemException
isNewTransaction
public boolean isNewTransaction()
- Description copied from interface:
TransactionPolicy
- 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. If there is no active
transaction (e.g., TransactionType is NotSupported), this method will
- Specified by:
isNewTransaction
in interface TransactionPolicy
- Returns:
- true if this not an inherited transaction
isClientTransaction
public boolean isClientTransaction()
- Description copied from interface:
TransactionPolicy
- 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. If there is no active
transaction (e.g., TransactionType is NotSupported), this method will
return false.
- Specified by:
isClientTransaction
in interface TransactionPolicy
- Returns:
- true if this is an inherited transaction
getCurrentTransaction
public Transaction getCurrentTransaction()
- Specified by:
getCurrentTransaction
in class JtaTransactionPolicy
getUserTransaction
public UserTransaction getUserTransaction()
- Description copied from interface:
BeanTransactionPolicy
- Gets the UserTransaction the bean uses to manage the transaction.
- Specified by:
getUserTransaction
in interface BeanTransactionPolicy
- Returns:
- the UserTransaction the bean uses to manage the transaction
suspendUserTransaction
public BeanTransactionPolicy.SuspendedTransaction suspendUserTransaction()
throws SystemException
- Description copied from interface:
BeanTransactionPolicy
- 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.
- Specified by:
suspendUserTransaction
in interface BeanTransactionPolicy
- Returns:
- the syspended transaction token or null if no transaction was
active
- Throws:
SystemException
- if there was a problem suspending the
transaction
resumeUserTransaction
public void resumeUserTransaction(BeanTransactionPolicy.SuspendedTransaction suspendedTransaction)
throws SystemException
- Description copied from interface:
BeanTransactionPolicy
- 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.
- Specified by:
resumeUserTransaction
in interface BeanTransactionPolicy
- Parameters:
suspendedTransaction
- the transaction to resume; not null
- Throws:
SystemException
- if there was a problem resuming the transaction
commit
public void commit()
throws ApplicationException,
SystemException
- Description copied from interface:
TransactionPolicy
- Commits or rolls back this TransactionPolicy. If there the actual
transaction is completed or there is no actual transaction, the
registered TransactionSynchronization are called. Otherwise, the
registered TransactionSynchronization are called when the actual
transaction is completed.
- Specified by:
commit
in interface TransactionPolicy
- Throws:
ApplicationException
- if recoverable exception is encountered
SystemException
- if an unrecoverable exception is encountered
Copyright © 1999-2013 The Apache OpenEJB development community. All Rights Reserved.