1 22 package org.jboss.test.aop.scoped; 23 24 import javax.naming.InitialContext ; 25 import javax.naming.NamingException ; 26 import javax.transaction.SystemException ; 27 import javax.transaction.TransactionManager ; 28 29 34 public class POJO 35 { 36 public POJO() 37 { 38 System.out.println("*** POJO constructor"); 39 } 40 41 public void method() 42 { 43 System.out.println("*** POJO method"); 44 try 45 { 46 TransactionManager tm = (TransactionManager )new InitialContext ().lookup("java:/TransactionManager"); 47 if (tm.getTransaction() == null) throw new RuntimeException ("method() has no tx set"); 48 } 49 catch (Exception e) 50 { 51 throw new RuntimeException (e); 53 } 54 } 55 56 } 57 | Popular Tags |