1 22 package org.jboss.ejb3.test.interceptors2; 23 24 import javax.interceptor.InvocationContext; 25 26 31 public class XMLClassInterceptor2 extends XMLClassInterceptor3 32 { 33 public Object intercept2(InvocationContext ctx) throws Exception 34 { 35 StatusBean.addInterceptionStatic(new Interception(this, "intercept2")); 36 return ctx.proceed(); 37 } 38 39 public void postConstruct2(InvocationContext ctx) 40 { 41 StatusBean.addPostConstruct(new Interception(this, "postConstruct2", instance)); 42 try 43 { 44 ctx.proceed(); 45 } 46 catch (Exception e) 47 { 48 throw new RuntimeException (e); 49 } 50 } 51 52 public void postActivate2(InvocationContext ctx) 53 { 54 StatusBean.addPostActivate(new Interception(this, "postActivate2", instance)); 55 try 56 { 57 ctx.proceed(); 58 } 59 catch (Exception e) 60 { 61 throw new RuntimeException (e); 62 } 63 } 64 65 public void prePassivate2(InvocationContext ctx) 66 { 67 StatusBean.addPrePassivate(new Interception(this, "prePassivate2", instance)); 68 try 69 { 70 ctx.proceed(); 71 } 72 catch (Exception e) 73 { 74 throw new RuntimeException (e); 75 } 76 } 77 78 public void preDestroy2(InvocationContext ctx) 79 { 80 System.out.println("XMLClassInterceptor pd!"); 81 StatusBean.addPreDestroy(new Interception(this, "preDestroy2", instance)); 82 try 83 { 84 ctx.proceed(); 85 } 86 catch (Exception e) 87 { 88 throw new RuntimeException (e); 89 } 90 } 91 } 92 | Popular Tags |