|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jonas_tm.Current
Current is the common Implementation for UserTransaction and TransactionManager. UserTransaction is used by clients that want manage transactions themselves. It is referenceable via JNDI TransactionManager is used by a JOnAS Server. This object is unique in a VM, i.e. each JOnAS Server has ONE Current object and each client program should normally issue only ONE lookup on JNDI. Current also implements Referenceable, because of JNDI.
Constructor Summary | |
Current()
Default constructor. |
|
Current(TransactionFactory tmfact,
boolean iscorba)
Constructor for JOnAS Server. |
Method Summary | |
void |
begin()
Create a new transaction and associate it with the current thread. |
void |
commit()
Complete the transaction associated with the current thread. |
void |
connectionClosed(org.objectweb.transaction.api.ResourceManagerEvent event)
|
void |
connectionErrorOccured(org.objectweb.transaction.api.ResourceManagerEvent event)
|
void |
connectionOpened(org.objectweb.transaction.api.ResourceManagerEvent event)
|
void |
forgetTx(javax.transaction.xa.Xid xid)
Forget all about this transaction. |
static Current |
getCurrent()
Returns the unique instance of the class or null if not initialized in case of plain client. |
int |
getCurrentNumberOfTx()
MBean method: |
int |
getDefaultTimeout()
Gets the default timeout value |
static TransactionFactory |
getJTM()
Returns the TMFactory (in JTM) |
TransactionContext |
getPropagationContext(boolean hold)
Get the propagation context associated with the current thread or null if the thread is not involved in a transaction. |
javax.naming.Reference |
getReference()
Retrieves the Reference of this object. |
int |
getStatus()
Obtain the status of the transaction associated with the current thread. |
int |
getTotalNumberOfBeginTx()
MBean method: |
int |
getTotalNumberOfCommitTx()
MBean method: |
int |
getTotalNumberOfRollbackTx()
MBean method: |
int |
getTotalNumberOfTimeOutExpired()
management method: |
javax.transaction.Transaction |
getTransaction()
Get the transaction object that represents the transaction context of the calling thread. |
static javax.transaction.TransactionManager |
getTransactionManager()
|
java.lang.Integer[] |
getTxCounters()
management method: |
void |
incrementBeginCounter()
management method: increment the number of beginned tx |
void |
incrementCommitCounter()
management method: increment the number of beginned tx |
void |
incrementRollbackCounter()
management method: increment the number of rollbacked tx |
void |
incrementTimeOutExpCounter()
management method: increment the number of rollbacked by time out |
void |
resetAllTxTotalCounters()
MBean method: reset total number of tx |
void |
resume(javax.transaction.Transaction tobj)
Resume the transaction context association of the calling thread with the transaction represented by the supplied Transaction object. |
void |
rollback()
Roll back the transaction associated with the current thread. |
void |
setCorba(boolean iscorba)
Sets the corba value |
void |
setDefaultTimeout(int timeout)
Sets the default timeout value |
void |
setPropagationContext(TransactionContext pctx,
boolean isReply)
Associate to the current thread a transaction represented by its propagation context. |
void |
setRollbackOnly()
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction. |
void |
setTransactionTimeout(int seconds)
Modify the value of the timeout value that is associated with the transactions started by the current thread with the begin method. |
javax.transaction.Transaction |
suspend()
Suspend the transaction currently associated with the calling thread and return a Transaction object that represents the transaction context being suspended. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Current()
public Current(TransactionFactory tmfact, boolean iscorba)
Method Detail |
public static javax.transaction.TransactionManager getTransactionManager()
public void begin() throws javax.transaction.NotSupportedException, javax.transaction.SystemException
begin
in interface javax.transaction.UserTransaction
javax.transaction.NotSupportedException
- Thrown if the thread is already
associated with a transaction. (nested transaction are not
supported)javax.transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic 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.UserTransaction
javax.transaction.RollbackException
- Thrown to indicate that
the transaction has been rolled back rather than committed.javax.transaction.HeuristicMixedException
- Thrown to indicate that a heuristic
decision was made and that some relevant updates have been committed
while others have been rolled back.javax.transaction.HeuristicRollbackException
- Thrown to indicate that a
heuristic decision was made and that some relevant updates have been
rolled back.java.lang.SecurityException
- Thrown to indicate that the thread is
not allowed to commit the transaction.java.lang.IllegalStateException
- Thrown if the current thread is
not associated with a transaction.javax.transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic void rollback() throws java.lang.IllegalStateException, java.lang.SecurityException, javax.transaction.SystemException
rollback
in interface javax.transaction.UserTransaction
java.lang.SecurityException
- Thrown to indicate that the thread is
not allowed to roll back the transaction.java.lang.IllegalStateException
- Thrown if the current thread is
not associated with a transaction.javax.transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic void setRollbackOnly() throws java.lang.IllegalStateException, javax.transaction.SystemException
setRollbackOnly
in interface javax.transaction.UserTransaction
java.lang.IllegalStateException
- Thrown if the current thread is
not associated with a transaction.javax.transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic int getStatus() throws javax.transaction.SystemException
getStatus
in interface javax.transaction.UserTransaction
javax.transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic void setTransactionTimeout(int seconds) throws javax.transaction.SystemException
If an application has not called this method, the transaction service uses some default value for the transaction timeout.
setTransactionTimeout
in interface javax.transaction.UserTransaction
seconds
- The value of the timeout in seconds. If the value
is zero, the transaction service restores the default value.javax.transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic javax.transaction.Transaction getTransaction() throws javax.transaction.SystemException
getTransaction
in interface javax.transaction.TransactionManager
javax.transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic void resume(javax.transaction.Transaction tobj) throws javax.transaction.InvalidTransactionException, java.lang.IllegalStateException, javax.transaction.SystemException
resume
in interface javax.transaction.TransactionManager
tobj
- The Transaction
object that represents the
transaction to be resumed.javax.transaction.InvalidTransactionException
- Thrown if the parameter
transaction object contains an invalid transactionjava.lang.IllegalStateException
- Thrown if the thread is already
associated with another transaction.javax.transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic javax.transaction.Transaction suspend() throws javax.transaction.SystemException
suspend
in interface javax.transaction.TransactionManager
javax.transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionjavax.transaction.SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic void connectionOpened(org.objectweb.transaction.api.ResourceManagerEvent event)
connectionOpened
in interface org.objectweb.transaction.api.ResourceManagerEventListener
public void connectionClosed(org.objectweb.transaction.api.ResourceManagerEvent event)
connectionClosed
in interface org.objectweb.transaction.api.ResourceManagerEventListener
public void connectionErrorOccured(org.objectweb.transaction.api.ResourceManagerEvent event)
connectionErrorOccured
in interface org.objectweb.transaction.api.ResourceManagerEventListener
public javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
- If a naming exception was encountered while retrieving the reference.public static Current getCurrent()
public static TransactionFactory getJTM()
public void setDefaultTimeout(int timeout)
public int getDefaultTimeout()
public void setCorba(boolean iscorba)
public void setPropagationContext(TransactionContext pctx, boolean isReply)
public TransactionContext getPropagationContext(boolean hold)
public void forgetTx(javax.transaction.xa.Xid xid)
public int getCurrentNumberOfTx()
public void incrementBeginCounter()
public int getTotalNumberOfBeginTx()
public void incrementRollbackCounter()
public int getTotalNumberOfRollbackTx()
public void incrementCommitCounter()
public int getTotalNumberOfCommitTx()
public void resetAllTxTotalCounters()
public void incrementTimeOutExpCounter()
public int getTotalNumberOfTimeOutExpired()
public java.lang.Integer[] getTxCounters()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |