1 22 package org.jboss.ejb3.test.interceptors; 23 24 import java.util.ArrayList ; 25 26 import javax.interceptor.InvocationContext; 27 import javax.sql.DataSource ; 28 29 34 public class XMLInterceptor 35 { 36 MySession2 session2; 37 DataSource ds; 38 39 MySession2Local session2Method; 40 DataSource dsMethod; 41 42 public void setSession2Method(MySession2Local session2Method) 43 { 44 this.session2Method = session2Method; 45 } 46 47 public void setDsMethod(DataSource dsMethod) 48 { 49 this.dsMethod = dsMethod; 50 } 51 52 public Object intercept(InvocationContext ctx) throws Exception 53 { 54 session2.doit(); 55 if (ds == null) throw new RuntimeException ("ds was null"); 56 session2Method.doit(); 58 if (dsMethod == null) throw new RuntimeException ("ds was null"); 59 ArrayList list = new ArrayList (); 60 list.add("MyInterceptor"); 61 return list; 62 } 63 64 } 65 | Popular Tags |