org.hibernate.test.tm
Class SimpleJtaTransactionManagerImpl

java.lang.Object
  extended by org.hibernate.test.tm.SimpleJtaTransactionManagerImpl
All Implemented Interfaces:
TransactionManager

public class SimpleJtaTransactionManagerImpl
extends Object
implements TransactionManager

TransactionManager implementation specifically designed for use in test suite and simple usage scenarios. For example, it assumes that there is only ever a single transaction active at a given time.

Author:
Gavin King, Steve Ebersole

Constructor Summary
SimpleJtaTransactionManagerImpl()
           
 
Method Summary
 void begin()
           
 void commit()
           
 SimpleJtaTransactionImpl getCurrentTransaction()
           
static SimpleJtaTransactionManagerImpl getInstance()
           
 int getStatus()
           
 Transaction getTransaction()
           
 void resume(Transaction transaction)
           
 void rollback()
           
 void setRollbackOnly()
           
 void setTransactionTimeout(int i)
           
 Transaction suspend()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleJtaTransactionManagerImpl

public SimpleJtaTransactionManagerImpl()
Method Detail

getInstance

public static SimpleJtaTransactionManagerImpl getInstance()

getStatus

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

getTransaction

public Transaction getTransaction()
                           throws SystemException
Specified by:
getTransaction in interface TransactionManager
Throws:
SystemException

getCurrentTransaction

public SimpleJtaTransactionImpl getCurrentTransaction()

begin

public void begin()
           throws NotSupportedException,
                  SystemException
Specified by:
begin in interface TransactionManager
Throws:
NotSupportedException
SystemException

suspend

public Transaction suspend()
                    throws SystemException
Specified by:
suspend in interface TransactionManager
Throws:
SystemException

resume

public void resume(Transaction transaction)
            throws InvalidTransactionException,
                   IllegalStateException,
                   SystemException
Specified by:
resume in interface TransactionManager
Throws:
InvalidTransactionException
IllegalStateException
SystemException

commit

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

rollback

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

setRollbackOnly

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

setTransactionTimeout

public void setTransactionTimeout(int i)
                           throws SystemException
Specified by:
setTransactionTimeout in interface TransactionManager
Throws:
SystemException


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.