|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.slim3.transaction.controller.AbstractTransactionController
org.slim3.transaction.jta.JtaTransactionController
public class JtaTransactionController
An implementation class for TransactionController
using JTA.
Field Summary | |
---|---|
protected TransactionManager |
transactionManager
The transaction manager. |
protected UserTransaction |
userTransaction
The user transaction. |
Constructor Summary | |
---|---|
JtaTransactionController(UserTransaction userTransaction,
TransactionManager transactionManager)
Constructor. |
Method Summary | |
---|---|
protected boolean |
begin()
Begins a new transaction. |
protected void |
end()
Commits or rolls back a transaction. |
protected boolean |
hasTransaction()
Returns true if the current thread has a transaction. |
Object |
notSupported(TransactionAction action)
Executes the action within a transaction. |
Object |
required(TransactionAction action)
Executes the action within a transaction. |
Object |
requiresNew(TransactionAction action)
Executes the action within a transaction. |
protected void |
resume(Transaction transaction)
Resumes the transaction. |
void |
setRollbackOnly()
Modify the transaction such that the transaction is rolled back. |
protected Transaction |
suspend()
Suspends the current transaction. |
Methods inherited from class org.slim3.transaction.controller.AbstractTransactionController |
---|
execute, mandatory, never |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected UserTransaction userTransaction
protected TransactionManager transactionManager
Constructor Detail |
---|
public JtaTransactionController(UserTransaction userTransaction, TransactionManager transactionManager) throws NullPointerException
userTransaction
- the user transactiontransactionManager
- the transaction manager
NullPointerException
- if the userTransaction parameter is null or if the
transactionManager parameter is nullMethod Detail |
---|
public Object required(TransactionAction action) throws NotSupportedException, Exception
TransactionController
action
- the action
NotSupportedException
- if nested transaction is not supported
Exception
- if an exception is encounteredpublic Object requiresNew(TransactionAction action) throws Exception
TransactionController
action
- the action
Exception
- if an exception is encounteredpublic Object notSupported(TransactionAction action) throws Exception
TransactionController
action
- the action
Exception
- if an exception is encounteredpublic void setRollbackOnly()
TransactionController
protected boolean hasTransaction() throws Exception
AbstractTransactionController
hasTransaction
in class AbstractTransactionController
Exception
- if an exception is encounteredUserTransaction.getStatus()
protected boolean begin() throws Exception
NotSupportedException
- if nested transaction is not supported
Exception
- if an exception is encounteredUserTransaction.begin()
protected void end() throws Exception
Exception
- if an exception is encounteredUserTransaction.commit()
,
UserTransaction.rollback()
protected Transaction suspend() throws Exception
Exception
- if an exception is encounteredTransactionManager.suspend()
protected void resume(Transaction transaction) throws Exception
transaction
- the transaction
Exception
- if an exception is encounteredTransactionManager.resume(Transaction)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |