1 22 package org.jboss.proxy; 23 24 import javax.transaction.TransactionManager ; 25 import javax.transaction.Transaction ; 26 27 import org.jboss.invocation.Invocation; 28 import org.jboss.proxy.Interceptor; 29 30 36 public class TransactionInterceptor 37 extends Interceptor 38 { 39 40 private static final long serialVersionUID = 371972342995600888L; 41 42 public static TransactionManager tm; 43 44 47 public TransactionInterceptor() 48 { 49 } 50 51 53 public Object invoke(Invocation invocation) 54 throws Throwable 55 { 56 if (tm != null) 57 { 58 Transaction tx = tm.getTransaction(); 59 if (tx != null) invocation.setTransaction(tx); 60 } 61 return getNext().invoke(invocation); 62 } 63 64 65 66 public static void setTransactionManager(TransactionManager tmx) 67 { 68 tm = tmx; 69 } 70 } 71 | Popular Tags |