1 22 package org.jboss.test.aop.extender; 23 24 import org.jboss.aop.advice.Interceptor; 25 import org.jboss.aop.joinpoint.FieldInvocation; 26 import org.jboss.aop.joinpoint.Invocation; 27 import org.jboss.aop.joinpoint.MethodInvocation; 28 29 34 public class ExtenderInterceptor implements Interceptor 35 { 36 public static boolean method; 37 public static boolean field; 38 39 public String getName() 40 { 41 return "ExtenderInterceptor"; 42 } 43 44 public Object invoke(Invocation invocation) throws Throwable 45 { 46 System.out.println("---------------------- ExtenderInterceptor ---------------------"); 47 48 if (invocation instanceof MethodInvocation) 49 { 50 method = true; 51 } 52 else if (invocation instanceof FieldInvocation) 53 { 54 field = true; 55 } 56 57 return invocation.invokeNext(); 58 } 59 60 } 61 | Popular Tags |