|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jotm.TransactionImpl
TransactionImpl is the implementation of the Transaction interface, defined in JTA specifications. This object is intended to be used by the EJBServer for transaction management. It is used indirectly by the UserTransaction implementation too, i.e. the Current object. The goal is to use the JTA interface to hide the JTM interface to the caller (EJBServer, Bean or Client).
Constructor Summary | |
TransactionImpl(TransactionContext pctx)
New Transaction for this thread (setPropagationContext) |
|
TransactionImpl(Xid xid,
int timeout)
New transaction (begin). |
Method Summary | |
void |
commit()
Complete the transaction represented by this Transaction object The calling thread is not required to have the same transaction associated with the thread. |
boolean |
delistResource(XAResource xares,
int flag)
Delist the resource specified from the current transaction associated with the calling thread. |
void |
doAttach(int flag)
|
void |
doDetach(int flag)
|
boolean |
enlistResource(XAResource xares)
Enlist the resource specified with the current transaction context of the calling thread |
boolean |
equals(Object obj2)
return true if objects are identical |
List |
getEnlistedXAResource()
|
TransactionContext |
getPropagationContext(boolean hold)
Return associated PropagationContext Used for implicit Context propagation. |
int |
getStatus()
Obtain the status of the transaction associated with the current thread. |
Xid |
getXid()
Get the Xid of the transaction |
int |
hashCode()
return a hashcode value for this object |
boolean |
isRemovable()
return true if object is no more used (= removable) |
void |
registerSynchronization(Synchronization sync)
Register a synchronization object for the transaction currently associated with the calling thread. |
void |
rollback()
Rollback the transaction represented by this Transaction object. |
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 |
setTimer(org.objectweb.jonas_timer.TimerEvent timer)
set a timer for the transaction |
void |
timeoutExpired(Object arg)
timeout for that transaction has expired |
String |
toString()
string form |
void |
unsetTimer()
unset the timer |
void |
updatePropagationContext(TransactionContext pctx)
update the propagation context We should be inside the reply of a request involved in a tx here! |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TransactionImpl(Xid xid, int timeout) throws SystemException
timeout
- The value of the timeout in seconds.public TransactionImpl(TransactionContext pctx)
pctx
- propagation contextMethod Detail |
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException
commit
in interface Transaction
RollbackException
- Thrown to indicate that
the transaction has been rolled back rather than committed.
HeuristicMixedException
- Thrown to indicate that a heuristic
decision was made and that some relevant updates have been committed
while others have been rolled back.
HeuristicRollbackException
- Thrown to indicate that a
heuristic decision was made and that some relevant updates have been
rolled back.
SecurityException
- Thrown to indicate that the thread is
not allowed to commit the transaction.
IllegalStateException
- Thrown if the current thread is
not associated with a transaction.
SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic boolean delistResource(XAResource xares, int flag) throws IllegalStateException, SystemException
delistResource
in interface Transaction
flag
- One of the values of TMSUCCESS, TMSUSPEND, or TMFAIL.
IllegalStateException
- Thrown if the transaction in the
target object is inactive.
SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic boolean enlistResource(XAResource xares) throws RollbackException, IllegalStateException, SystemException
enlistResource
in interface Transaction
RollbackException
- Thrown to indicate that
the transaction has been marked for rollback only.
IllegalStateException
- Thrown if the transaction in the
target object is in prepared state or the transaction is inactive.
SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic void doDetach(int flag) throws SystemException
SystemException
public void doAttach(int flag) throws SystemException, RollbackException
SystemException
RollbackException
public List getEnlistedXAResource()
public int getStatus() throws SystemException
getStatus
in interface Transaction
SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic void registerSynchronization(Synchronization sync) throws RollbackException, IllegalStateException, SystemException
registerSynchronization
in interface Transaction
sync
- The javax.transaction.Synchronization object for the
transaction associated with the target object
RollbackException
- Thrown to indicate that
the transaction has been marked for rollback only.
IllegalStateException
- Thrown if the transaction in the
target object is in prepared state or the transaction is inactive.
SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic void rollback() throws IllegalStateException, SystemException
rollback
in interface Transaction
IllegalStateException
- Thrown if the transaction in the
target object is in prepared state or the transaction is inactive.
SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic void setRollbackOnly() throws IllegalStateException, SystemException
setRollbackOnly
in interface Transaction
IllegalStateException
- Thrown if the current thread is
not associated with any transaction.
SystemException
- Thrown if the transaction manager
encounters an unexpected error conditionpublic void timeoutExpired(Object arg)
timeoutExpired
in interface org.objectweb.jonas_timer.TimerEventListener
public boolean equals(Object obj2)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public TransactionContext getPropagationContext(boolean hold)
public void setTimer(org.objectweb.jonas_timer.TimerEvent timer)
public void unsetTimer()
public void updatePropagationContext(TransactionContext pctx)
public Xid getXid()
public boolean isRemovable()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |