1 22 import org.jboss.aop.joinpoint.Invocation; 23 import org.jboss.aop.joinpoint.FieldReadInvocation; 24 import org.jboss.aop.advice.Interceptor; 25 26 31 public class GetInterceptor implements Interceptor 32 { 33 public String getName() { return "GetInterceptor"; } 34 35 public Object invoke(Invocation invocation) throws Throwable 36 { 37 if (!(invocation instanceof FieldReadInvocation)) return invocation.invokeNext(); 38 39 try 40 { 41 FieldReadInvocation mi = (FieldReadInvocation)invocation; 42 System.out.println("<<< Entering GetInterceptor for: " + mi.getField().getName()); 43 return invocation.invokeNext(); 44 } 45 finally 46 { 47 System.out.println(">>> Leaving GetInterceptor"); 48 } 49 } 50 } 51 | Popular Tags |