org.jboss.tm
Class TransactionImpl

java.lang.Object
  extended by org.jboss.tm.TransactionImpl
All Implemented Interfaces:
Transaction, org.jboss.util.timeout.TimeoutTarget

public class TransactionImpl
extends Object
implements Transaction, org.jboss.util.timeout.TimeoutTarget

Our Transaction implementation.

Version:
$Revision: 1.35.2.20 $
Author:
Rickard Öberg, Marc Fleury, Ole Husgaard, Toby Allsopp, Jason Dillon, David Jencks, Bill Burke, Adrian Brock, Dimitris Andreadis
See Also:
TxManager

Method Summary
 void commit()
           
 boolean delistResource(XAResource xaRes, int flag)
           
 boolean enlistResource(XAResource xaRes)
           
 boolean equals(Object obj)
           
 int getAssociatedThreadCount()
           
 Set getAssociatedThreads()
           
 GlobalId getGlobalId()
          Returns the global id of this transaction.
 LocalId getLocalId()
          Returns the local id of this transaction.
 long getLocalIdValue()
          Returns the local id of this transaction.
 int getStatus()
           
 long getTimeLeftBeforeTimeout(boolean errorRollback)
           
 XidImpl getXid()
          Returns the xid of this transaction.
 int hashCode()
           
 void registerSynchronization(Synchronization s)
           
 void rollback()
           
 void setRollbackOnly()
           
 void timedOut(org.jboss.util.timeout.Timeout timeout)
          Called when our timeout expires.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

timedOut

public void timedOut(org.jboss.util.timeout.Timeout timeout)
Called when our timeout expires.

Specified by:
timedOut in interface org.jboss.util.timeout.TimeoutTarget

commit

public void commit()
            throws RollbackException,
                   HeuristicMixedException,
                   HeuristicRollbackException,
                   SecurityException,
                   IllegalStateException,
                   SystemException
Specified by:
commit in interface Transaction
Throws:
RollbackException
HeuristicMixedException
HeuristicRollbackException
SecurityException
IllegalStateException
SystemException

rollback

public void rollback()
              throws IllegalStateException,
                     SecurityException,
                     SystemException
Specified by:
rollback in interface Transaction
Throws:
IllegalStateException
SecurityException
SystemException

delistResource

public boolean delistResource(XAResource xaRes,
                              int flag)
                       throws IllegalStateException,
                              SystemException
Specified by:
delistResource in interface Transaction
Throws:
IllegalStateException
SystemException

enlistResource

public boolean enlistResource(XAResource xaRes)
                       throws RollbackException,
                              IllegalStateException,
                              SystemException
Specified by:
enlistResource in interface Transaction
Throws:
RollbackException
IllegalStateException
SystemException

getStatus

public int getStatus()
              throws SystemException
Specified by:
getStatus in interface Transaction
Throws:
SystemException

registerSynchronization

public void registerSynchronization(Synchronization s)
                             throws RollbackException,
                                    IllegalStateException,
                                    SystemException
Specified by:
registerSynchronization in interface Transaction
Throws:
RollbackException
IllegalStateException
SystemException

setRollbackOnly

public void setRollbackOnly()
                     throws IllegalStateException,
                            SystemException
Specified by:
setRollbackOnly in interface Transaction
Throws:
IllegalStateException
SystemException

getAssociatedThreadCount

public int getAssociatedThreadCount()

getAssociatedThreads

public Set getAssociatedThreads()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getLocalIdValue

public long getLocalIdValue()
Returns the local id of this transaction. The local id is used as a transaction propagation context within the JBoss server, and in the TxManager for mapping local transaction ids to transactions.


getLocalId

public LocalId getLocalId()
Returns the local id of this transaction. The local id is used as a transaction propagation context within the JBoss server, and in the TxManager for mapping local transaction ids to transactions.


getGlobalId

public GlobalId getGlobalId()
Returns the global id of this transaction. Ths global id is used in the TxManager, which keeps a map from global ids to transactions.


getXid

public XidImpl getXid()
Returns the xid of this transaction.


getTimeLeftBeforeTimeout

public long getTimeLeftBeforeTimeout(boolean errorRollback)
                              throws RollbackException
Throws:
RollbackException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.