org.apache.openejb.core.transaction
Class TransactionPolicy

java.lang.Object
  extended by org.apache.openejb.core.transaction.TransactionPolicy
Direct Known Subclasses:
MessageDrivenBeanManagedTxPolicy, SessionSynchronizationTxPolicy, StatefulBeanManagedTxPolicy, StatefulContainerManagedTxPolicy, StatelessBeanManagedTxPolicy, TxMandatory, TxNever, TxNotSupported, TxRequired, TxRequiresNew, TxSupports

public abstract class TransactionPolicy
extends Object


Nested Class Summary
static class TransactionPolicy.Type
           
 
Field Summary
protected  TransactionContainer container
           
protected static Logger logger
           
protected static Logger txLogger
           
 
Constructor Summary
TransactionPolicy(TransactionPolicy.Type policyType, TransactionContainer container)
           
 
Method Summary
abstract  void afterInvoke(Object bean, TransactionContext context)
           
abstract  void beforeInvoke(Object bean, TransactionContext context)
           
protected  void beginTransaction(TransactionContext context)
           
protected  void commitTransaction(TransactionContext context, Transaction tx)
           
protected  void discardBeanInstance(Object instance, ThreadContext callContext)
           
 TransactionContainer getContainer()
           
 TransactionPolicy.Type getPolicyType()
           
abstract  void handleApplicationException(Throwable appException, boolean rollback, TransactionContext context)
           
protected  void handleCallbackException()
           
abstract  void handleSystemException(Throwable sysException, Object instance, TransactionContext context)
           
protected  void logSystemException(Throwable sysException, TransactionContext context)
           
protected  void markTxRollbackOnly(Transaction tx)
           
 String policyToString()
           
protected  void resumeTransaction(TransactionContext context, Transaction tx)
           
protected  void rollbackTransaction(TransactionContext context, Transaction tx)
           
protected  Transaction suspendTransaction(TransactionContext context)
           
protected  void throwAppExceptionToServer(Throwable appException)
           
protected  void throwExceptionToServer(Throwable sysException)
           
protected  void throwTxExceptionToServer(Throwable sysException)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

container

protected final TransactionContainer container

logger

protected static final Logger logger

txLogger

protected static final Logger txLogger
Constructor Detail

TransactionPolicy

public TransactionPolicy(TransactionPolicy.Type policyType,
                         TransactionContainer container)
Method Detail

getPolicyType

public TransactionPolicy.Type getPolicyType()

getContainer

public TransactionContainer getContainer()

policyToString

public String policyToString()

handleApplicationException

public abstract void handleApplicationException(Throwable appException,
                                                boolean rollback,
                                                TransactionContext context)
                                         throws ApplicationException,
                                                SystemException
Throws:
ApplicationException
SystemException

handleSystemException

public abstract void handleSystemException(Throwable sysException,
                                           Object instance,
                                           TransactionContext context)
                                    throws ApplicationException,
                                           SystemException
Throws:
ApplicationException
SystemException

beforeInvoke

public abstract void beforeInvoke(Object bean,
                                  TransactionContext context)
                           throws SystemException,
                                  ApplicationException
Throws:
SystemException
ApplicationException

afterInvoke

public abstract void afterInvoke(Object bean,
                                 TransactionContext context)
                          throws ApplicationException,
                                 SystemException
Throws:
ApplicationException
SystemException

markTxRollbackOnly

protected void markTxRollbackOnly(Transaction tx)
                           throws SystemException
Throws:
SystemException

suspendTransaction

protected Transaction suspendTransaction(TransactionContext context)
                                  throws SystemException
Throws:
SystemException

resumeTransaction

protected void resumeTransaction(TransactionContext context,
                                 Transaction tx)
                          throws SystemException
Throws:
SystemException

commitTransaction

protected void commitTransaction(TransactionContext context,
                                 Transaction tx)
                          throws SystemException,
                                 ApplicationException
Throws:
SystemException
ApplicationException

rollbackTransaction

protected void rollbackTransaction(TransactionContext context,
                                   Transaction tx)
                            throws SystemException
Throws:
SystemException

throwAppExceptionToServer

protected void throwAppExceptionToServer(Throwable appException)
                                  throws ApplicationException
Throws:
ApplicationException

throwTxExceptionToServer

protected void throwTxExceptionToServer(Throwable sysException)
                                 throws ApplicationException
Throws:
ApplicationException

throwExceptionToServer

protected void throwExceptionToServer(Throwable sysException)
                               throws ApplicationException
Throws:
ApplicationException

logSystemException

protected void logSystemException(Throwable sysException,
                                  TransactionContext context)

discardBeanInstance

protected void discardBeanInstance(Object instance,
                                   ThreadContext callContext)

beginTransaction

protected void beginTransaction(TransactionContext context)
                         throws SystemException
Throws:
SystemException

handleCallbackException

protected void handleCallbackException()


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.