public class SimulatedTransactionManager extends Object
| Constructor and Description |
|---|
SimulatedTransactionManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
activateTransactionInterceptor() |
void |
commit(Boolean expectUserTransaction)
Make sure the current transaction is committed for all persistencefactories which take part.
|
void |
deactivateTransactionInterceptor() |
boolean |
getRollbackOnly(Boolean expectUserTransaction)
check if it is made sure the current Transaction will be rolledback as soon as the commit is tried
|
int |
getStatus()
simulate getStatus from UserTransaction
|
boolean |
hasActiveTransactionInterceptor() |
void |
init()
called by EjbExtensionExtended to clear static data.
|
void |
pop()
End of current transactioncontext for all persistencecontexts which take part.
|
void |
push()
Start next transactioncontext of this thread by pushing the
TransactionAttributeType on the stack. |
void |
push(javax.ejb.TransactionAttributeType transactionAttributeType)
Start next transactioncontext of this thread by pushing the
TransactionAttributeType on the stack. |
void |
registerSynchronisation(Synchronization synchronization) |
void |
rollback(Boolean expectUserTransaction)
Make sure the current transaction is rolled back for all persistencefactories which take part.
|
void |
setRollbackOnly(Boolean expectUserTransaction)
make sure the current Transaction will be rolledback as soon as the commit is tried
|
void |
synchAfterCompletion(int res) |
void |
synchBeforeCompletion() |
void |
takePart(PersistenceFactory persistenceFactory)
Let the PersistenceContext take part in the current transaction.
|
public void registerSynchronisation(Synchronization synchronization)
public void synchBeforeCompletion()
public void synchAfterCompletion(int res)
public void init()
public void deactivateTransactionInterceptor()
public void activateTransactionInterceptor()
public boolean hasActiveTransactionInterceptor()
public void push(javax.ejb.TransactionAttributeType transactionAttributeType)
TransactionAttributeType on the stack.transactionAttributeType - The Transactionattribute to be stacked.public void push()
TransactionAttributeType on the stack.public void takePart(PersistenceFactory persistenceFactory)
persistenceFactory - The persistenceFactory managing a specific Persistencecontext of the current thread.public void rollback(Boolean expectUserTransaction) throws IllegalStateException, SecurityException, SystemException
expectUserTransaction - if not null, rollback is initiated during UserTransaction,
this is only allowed in UserTransaction, if false, container managed transaction will
be popped later.IllegalStateException - used to simulated UserTransactionInterfaceSecurityException - used to simulated UserTransactionInterfaceSystemException - used to simulated UserTransactionInterfacepublic void commit(Boolean expectUserTransaction) throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException
expectUserTransaction - if not null, commit is initiated during UserTransaction, this is only allowed in UserTransactionRollbackException - used to simulated UserTransactionInterfaceHeuristicMixedException - used to simulated UserTransactionInterfaceHeuristicRollbackException - used to simulated UserTransactionInterfaceSecurityException - used to simulated UserTransactionInterfaceIllegalStateException - used to simulated UserTransactionInterfaceSystemException - if an exception occurs during the commit or rollback.public void setRollbackOnly(Boolean expectUserTransaction) throws IllegalStateException
expectUserTransaction - if not null, it is expected that the current Transaction is a Bean Managed TransactionIllegalStateException - in case of wrong Transactiontype (container or bean managed)public boolean getRollbackOnly(Boolean expectUserTransaction) throws IllegalStateException
expectUserTransaction - if not null, it is expected that the current Transaction is a Bean Managed TransactionIllegalStateException - in case of wrong Transactiontype (container or bean managed)public void pop()
throws Exception
Exception - if an exception occurs during the transaction handlingpublic int getStatus()
throws SystemException
SystemException - as simulatedCopyright © 2017–2018. All rights reserved.