1 22 package org.jboss.ejb3.test.initial; 23 24 import javax.interceptor.AroundInvoke; 25 import javax.interceptor.InvocationContext; 26 27 31 public class SecondInterceptor { 32 33 @AroundInvoke 34 public Object twoMethod(InvocationContext ctx) throws Exception  35 { 36 if (ctx.getMethod().getName().equals("testMethod")) 37 { 38 System.out.println("Intercepting in SecondInterceptor.twoMethod()"); 39 int val = (Integer )ctx.getContextData().get("DATA"); 40 41 ctx.getContextData().put("DATA", new Integer (val + 2000)); 42 } 43 return ctx.proceed(); 44 } 45 } 46 | Popular Tags |