1 22 package org.jboss.ejb3.test.interceptors2; 23 24 import javax.annotation.Resource; 25 import javax.ejb.EJBContext ; 26 import javax.interceptor.InvocationContext; 27 import org.jboss.logging.Logger; 28 29 import javax.naming.InitialContext ; 30 31 36 public class XMLOnlySLSB implements XMLOnlySLSBRemote 37 { 38 private static final Logger log = Logger.getLogger(XMLOnlySLSB.class); 39 40 @Resource 41 EJBContext ejbCtx; 42 43 public void methodWithClassLevel() 44 { 45 System.out.println("XMLOnlySLSB.methodWithClassLevel"); 46 } 47 48 public void overloadedMethod(long l) 49 { 50 System.out.println("XMLOnlySLSB.overloadedMethod WithClassLevelExcludingDefault"); 51 } 52 53 public void overloadedMethod(long l, String [][] s) 54 { 55 System.out.println("overloadedMethod (WithOwnInterceptors)"); 56 } 57 58 public void overloadedMethod(int i) 59 { 60 System.out.println("overloadedMethod (WithOwnInterceptorsExcludeClass)"); 61 } 62 63 public void overloadedMethod() 64 { 65 System.out.println("overloadedMethod (WithOwnInterceptorsExcludeClassAndDefault)"); 66 } 67 68 public Object intercept(InvocationContext ctx) throws Exception 69 { 70 System.out.println("XMLOnlySLSB intercepting!"); 71 StatusRemote status = (StatusRemote)new InitialContext ().lookup("StatusBean/remote"); 74 status.addInterception(new Interception(this, "intercept")); 75 return ctx.proceed(); 76 } 77 78 void postConstruct() 79 { 80 System.out.println("XMLOnlySLSB postConstruct"); 81 StatusBean.addPostConstruct(new Interception(this, "postConstruct")); 82 } 83 84 void preDestroy() 85 { 86 System.out.println("XMLOnlySLSB preDestroy!"); 87 StatusBean.addPreDestroy(new Interception(this, "preDestroy")); 88 } 89 } 90 | Popular Tags |