|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbitronix.tm.BitronixTransactionManager
public class BitronixTransactionManager
Implementation of TransactionManager and UserTransaction.
| Constructor Summary | |
|---|---|
BitronixTransactionManager()
Create the BitronixTransactionManager. |
|
| Method Summary | |
|---|---|
void |
begin()
Start a new transaction and bind the context to the calling thread. |
void |
commit()
|
void |
dumpTransactionContexts()
Dump an overview of all running transactions as debug logs. |
BitronixTransaction |
getCurrentTransaction()
Get the transaction currently registered on the current thread context. |
java.util.Map |
getInFlightTransactions()
Return all in-flight transactions. |
long |
getOldestInFlightTransactionTimestamp()
Return the timestamp of the oldest in-flight transaction. |
javax.naming.Reference |
getReference()
BitronixTransactionManager can only have a single instance per JVM so this method always returns a reference with no special information to find back the sole instance. |
int |
getStatus()
|
javax.transaction.Transaction |
getTransaction()
|
void |
resume(javax.transaction.Transaction transaction)
|
void |
rollback()
|
void |
setRollbackOnly()
|
void |
setTransactionTimeout(int seconds)
|
void |
shutdown()
Shut down the transaction manager and release all resources held by it. |
javax.transaction.Transaction |
suspend()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BitronixTransactionManager()
BitronixTransactionManager. Open the journal, load resources and perform recovery
synchronously. The recovery service then gets scheduled for background recovery.
| Method Detail |
|---|
public void begin()
throws javax.transaction.NotSupportedException,
javax.transaction.SystemException
begin in interface javax.transaction.TransactionManagerbegin in interface javax.transaction.UserTransactionjavax.transaction.NotSupportedException - if a transaction is already bound to the calling thread.
javax.transaction.SystemException - if the transaction manager is shutting down.
public void commit()
throws javax.transaction.RollbackException,
javax.transaction.HeuristicMixedException,
javax.transaction.HeuristicRollbackException,
java.lang.SecurityException,
java.lang.IllegalStateException,
javax.transaction.SystemException
commit in interface javax.transaction.TransactionManagercommit in interface javax.transaction.UserTransactionjavax.transaction.RollbackException
javax.transaction.HeuristicMixedException
javax.transaction.HeuristicRollbackException
java.lang.SecurityException
java.lang.IllegalStateException
javax.transaction.SystemException
public void rollback()
throws java.lang.IllegalStateException,
java.lang.SecurityException,
javax.transaction.SystemException
rollback in interface javax.transaction.TransactionManagerrollback in interface javax.transaction.UserTransactionjava.lang.IllegalStateException
java.lang.SecurityException
javax.transaction.SystemException
public int getStatus()
throws javax.transaction.SystemException
getStatus in interface javax.transaction.TransactionManagergetStatus in interface javax.transaction.UserTransactionjavax.transaction.SystemException
public javax.transaction.Transaction getTransaction()
throws javax.transaction.SystemException
getTransaction in interface javax.transaction.TransactionManagerjavax.transaction.SystemException
public void setRollbackOnly()
throws java.lang.IllegalStateException,
javax.transaction.SystemException
setRollbackOnly in interface javax.transaction.TransactionManagersetRollbackOnly in interface javax.transaction.UserTransactionjava.lang.IllegalStateException
javax.transaction.SystemException
public void setTransactionTimeout(int seconds)
throws javax.transaction.SystemException
setTransactionTimeout in interface javax.transaction.TransactionManagersetTransactionTimeout in interface javax.transaction.UserTransactionjavax.transaction.SystemException
public javax.transaction.Transaction suspend()
throws javax.transaction.SystemException
suspend in interface javax.transaction.TransactionManagerjavax.transaction.SystemException
public void resume(javax.transaction.Transaction transaction)
throws javax.transaction.InvalidTransactionException,
java.lang.IllegalStateException,
javax.transaction.SystemException
resume in interface javax.transaction.TransactionManagerjavax.transaction.InvalidTransactionException
java.lang.IllegalStateException
javax.transaction.SystemException
public javax.naming.Reference getReference()
throws javax.naming.NamingException
getReference in interface javax.naming.Referenceablejavax.naming.NamingExceptionpublic java.util.Map getInFlightTransactions()
BitronixTransaction objects using Uid as key and BitronixTransaction as value.public long getOldestInFlightTransactionTimestamp()
public BitronixTransaction getCurrentTransaction()
public void dumpTransactionContexts()
public void shutdown()
This call will also close the resources pools registered by the ResourceLoader
like JMS and JDBC pools. The manually created ones are left untouched.
The Transaction Manager will wait during a configurable graceful period before forcibly killing active transactions.
After this method is called, attempts to create new transactions (via calls toTransactionManager.begin()) will be rejected with a SystemException.
shutdown in interface ServiceConfiguration.getGracefulShutdownInterval()public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||