1 22 package org.jboss.ejb3.test.dd.override; 23 24 import javax.annotation.security.PermitAll; 25 import javax.ejb.Remote ; 26 import javax.ejb.Stateful ; 27 import javax.ejb.TransactionAttribute ; 28 import javax.ejb.TransactionAttributeType ; 29 import javax.transaction.TransactionManager ; 30 import org.jboss.annotation.JndiInject; 31 import org.jboss.logging.Logger; 32 33 37 @Stateful (name="Foo1") 38 @Remote (Foo.class) 39 public class FooBean1 implements Foo, java.io.Serializable 40 { 41 private static final Logger log = Logger.getLogger(FooBean1.class); 42 43 private boolean transactionExisted = false; 44 45 private TransactionManager tm; 46 47 @JndiInject(jndiName = "java:/TransactionManager") 48 public void setTransactionManager(TransactionManager tm) 49 { 50 this.tm = tm; 51 } 52 53 @PermitAll 54 @TransactionAttribute (TransactionAttributeType.REQUIRED) 55 public void bar() throws Exception 56 { 57 transactionExisted = (tm.getTransaction() != null); 58 } 59 60 @PermitAll 61 public boolean transactionExisted() 62 { 63 return transactionExisted; 64 } 65 } | Popular Tags |