1 22 import org.jboss.aop.joinpoint.Invocation; 23 import org.jboss.aop.advice.Interceptor; 24 import org.jboss.aop.InterceptorDef; 25 import org.jboss.aop.Bind; 26 27 32 @InterceptorDef 33 @Bind (pointcut = "all($typedef{SimpleInterceptor.myTypedef})") 34 public class SimpleInterceptor2 implements Interceptor 35 { 36 public String getName() { return "SimpleInterceptor2"; } 37 38 public Object invoke(Invocation invocation) throws Throwable 39 { 40 try 41 { 42 System.out.println("<<< Entering SimpleInterceptor2"); 43 return invocation.invokeNext(); 44 } 45 finally 46 { 47 System.out.println(">>> Leaving SimpleInterceptor2"); 48 } 49 } 50 } 51 | Popular Tags |