org.apache.openjpa.ee
Class RegistryManagedRuntime.TransactionManagerRegistryFacade

java.lang.Object
  extended by org.apache.openjpa.ee.RegistryManagedRuntime.TransactionManagerRegistryFacade
All Implemented Interfaces:
Transaction, TransactionManager
Enclosing class:
RegistryManagedRuntime

public static class RegistryManagedRuntime.TransactionManagerRegistryFacade
extends Object
implements TransactionManager, Transaction

A TransactionManager and Transaction facade that delegates the appropriate methods to the internally-held TransactionSynchronizationRegistry. Since the registry is not able to start or end transactions, all transaction control methods will just throw a SystemException.

Author:
Marc Prud'hommeaux

Constructor Summary
RegistryManagedRuntime.TransactionManagerRegistryFacade(TransactionSynchronizationRegistry registry)
           
 
Method Summary
 void begin()
           
 void commit()
           
 boolean delistResource(XAResource xaRes, int flag)
           
 boolean enlistResource(XAResource xaRes)
           
 int getStatus()
           
 Transaction getTransaction()
           
 Object getTransactionKey()
           
 void registerSynchronization(Synchronization sync)
           
 void resume(Transaction tobj)
           
 void rollback()
           
 void setRollbackOnly()
           
 void setTransactionTimeout(int seconds)
           
 Transaction suspend()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryManagedRuntime.TransactionManagerRegistryFacade

public RegistryManagedRuntime.TransactionManagerRegistryFacade(TransactionSynchronizationRegistry registry)
Method Detail

getTransaction

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

registerSynchronization

public void registerSynchronization(Synchronization sync)
                             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
Specified by:
setRollbackOnly in interface TransactionManager
Throws:
IllegalStateException
SystemException

getStatus

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

getTransactionKey

public Object getTransactionKey()

begin

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

commit

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

resume

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

rollback

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

setTransactionTimeout

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

suspend

public Transaction suspend()
                    throws SystemException
Specified by:
suspend in interface TransactionManager
Throws:
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


Copyright © 2006-2007 Apache Software Foundation. All Rights Reserved.