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