org.openejb.alt.containers.castor_cmp11
Class CastorCmpEntityTxPolicy

java.lang.Object
  extended by org.openejb.core.transaction.TransactionPolicy
      extended by org.openejb.alt.containers.castor_cmp11.CastorCmpEntityTxPolicy

public class CastorCmpEntityTxPolicy
extends TransactionPolicy

Wraps the TxPolicies for EntityBeans beans with container-managed persistence using Castor for persistence. When the wrapped TransactionPolicy doesn't start a transaction for the invocation of called method, a Castor local transaciton is required. The castor local transaction executes on a Database object aquired from a JDO object that was not initated with a transaction manager name. The local transaction will be committed by the afterInoke() method of this class or rolled back by the handleSystemException() or handleApplicationException() methods.

Version:
$Revision: 2112 $ $Date: 2005-08-26 14:28:34 -0700 (Fri, 26 Aug 2005) $
Author:
Richard Monson-Haefel, David Blevins

Field Summary
protected  CastorCMP11_EntityContainer cmpContainer
           
protected  org.exolab.castor.jdo.JDO jdo_ForLocalTransaction
           
protected  TransactionPolicy policy
           
 
Fields inherited from class org.openejb.core.transaction.TransactionPolicy
BeanManaged, container, logger, Mandatory, Never, NotSupported, policyType, Required, RequiresNew, Supports, txLogger
 
Constructor Summary
CastorCmpEntityTxPolicy(TransactionPolicy policy)
           
 
Method Summary
 void afterInvoke(javax.ejb.EnterpriseBean instance, TransactionContext context)
           
 void beforeInvoke(javax.ejb.EnterpriseBean instance, TransactionContext context)
           
 void handleApplicationException(java.lang.Throwable appException, TransactionContext context)
           
 void handleSystemException(java.lang.Throwable sysException, javax.ejb.EnterpriseBean instance, TransactionContext context)
           
 
Methods inherited from class org.openejb.core.transaction.TransactionPolicy
beginTransaction, commitTransaction, discardBeanInstance, getContainer, getTxMngr, handleCallbackException, logSystemException, markTxRollbackOnly, policyToString, resumeTransaction, rollbackTransaction, suspendTransaction, throwAppExceptionToServer, throwExceptionToServer, throwTxExceptionToServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

policy

protected TransactionPolicy policy

cmpContainer

protected CastorCMP11_EntityContainer cmpContainer

jdo_ForLocalTransaction

protected org.exolab.castor.jdo.JDO jdo_ForLocalTransaction
Constructor Detail

CastorCmpEntityTxPolicy

public CastorCmpEntityTxPolicy(TransactionPolicy policy)
Method Detail

beforeInvoke

public void beforeInvoke(javax.ejb.EnterpriseBean instance,
                         TransactionContext context)
                  throws SystemException,
                         ApplicationException
Specified by:
beforeInvoke in class TransactionPolicy
Throws:
SystemException
ApplicationException

afterInvoke

public void afterInvoke(javax.ejb.EnterpriseBean instance,
                        TransactionContext context)
                 throws ApplicationException,
                        SystemException
Specified by:
afterInvoke in class TransactionPolicy
Throws:
ApplicationException
SystemException

handleApplicationException

public void handleApplicationException(java.lang.Throwable appException,
                                       TransactionContext context)
                                throws ApplicationException
Specified by:
handleApplicationException in class TransactionPolicy
Throws:
ApplicationException

handleSystemException

public void handleSystemException(java.lang.Throwable sysException,
                                  javax.ejb.EnterpriseBean instance,
                                  TransactionContext context)
                           throws ApplicationException,
                                  SystemException
Specified by:
handleSystemException in class TransactionPolicy
Throws:
ApplicationException
SystemException


Copyright © 1999-2011 OpenEJB. All Rights Reserved.