1 25 26 package org.objectweb.easybeans.transaction.interceptors; 27 28 import javax.ejb.EJBException ; 29 import javax.transaction.SystemException ; 30 import javax.transaction.Transaction ; 31 32 import org.objectweb.easybeans.api.EasyBeansInvocationContext; 33 import org.objectweb.easybeans.log.JLog; 34 import org.objectweb.easybeans.log.JLogFactory; 35 36 40 public class CMTSupportsTransactionInterceptor extends AbsTransactionInterceptor { 41 42 45 private JLog logger = JLogFactory.getLog(CMTSupportsTransactionInterceptor.class); 46 47 51 public CMTSupportsTransactionInterceptor() { 52 super(); 53 } 54 55 64 @Override 65 public Object intercept(final EasyBeansInvocationContext invocationContext) throws Exception { 66 logger.debug("Calling Supports TX interceptor"); 67 68 Transaction transaction; 70 try { 71 transaction = getTransactionManager().getTransaction(); 72 } catch (SystemException se) { 73 throw new EJBException ("Cannot get the current transaction on transaction manager.", se); 74 } 75 76 logger.debug("Transaction found = {0}", transaction); 77 78 try { 79 return invocationContext.proceed(); 80 } catch (Exception e) { 81 82 handleContextClientTransaction(invocationContext, e); 85 86 return null; 88 } 89 } 90 91 } 92 | Popular Tags |