1 22 package org.jboss.test.aop.regression.jbaop137; 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 MyInterceptor implements Interceptor 35 { 36 public static boolean method; 37 public static boolean field; 38 39 public String getName() 40 { 41 return "MyInterceptor"; 42 } 43 44 public Object invoke(Invocation invocation) throws Throwable 45 { 46 47 if (invocation instanceof MethodInvocation) 48 { 49 method = true; 50 } 51 else if (invocation instanceof FieldInvocation) 52 { 53 field = true; 54 } 55 56 return invocation.invokeNext(); 57 } 58 59 } 60 | Popular Tags |