1 45 package org.openejb.core.transaction; 46 47 import javax.ejb.EnterpriseBean ; 48 49 import org.openejb.ApplicationException; 50 51 68 public class TxNever extends TransactionPolicy { 69 70 public TxNever(TransactionContainer container){ 71 this(); 72 this.container = container; 73 } 74 75 public TxNever(){ 76 policyType = Never; 77 } 78 79 public String policyToString() { 80 return "TX_Never: "; 81 } 82 83 public void beforeInvoke(EnterpriseBean instance, TransactionContext context) throws org.openejb.SystemException, org.openejb.ApplicationException{ 84 85 try { 86 87 if ( getTxMngr().getTransaction() != null ){ 88 throw new ApplicationException(new java.rmi.RemoteException ("Transactions not supported")); 90 } 91 92 } catch ( javax.transaction.SystemException se ) { 93 logger.error("Exception during getTransaction()", se); 94 throw new org.openejb.SystemException(se); 95 } 96 } 97 98 public void afterInvoke(EnterpriseBean instance, TransactionContext context) throws org.openejb.ApplicationException, org.openejb.SystemException{ 99 } 101 102 103 119 public void handleApplicationException( Throwable appException, TransactionContext context) throws ApplicationException{ 120 throw new ApplicationException( appException ); 122 } 123 124 156 public void handleSystemException( Throwable sysException, EnterpriseBean instance, TransactionContext context) throws org.openejb.ApplicationException, org.openejb.SystemException{ 157 158 logSystemException( sysException ); 159 160 161 discardBeanInstance( instance, context.callContext); 162 163 164 throwExceptionToServer( sysException ); 165 } 166 167 } 168 169 | Popular Tags |