/* * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.joinpoint.FieldReadInvocation; import org.jboss.aop.advice.Interceptor; /** * * @author Bill Burke * @version $Revision: 1.3 $ */ public class GetInterceptor implements Interceptor { public String getName() { return "GetInterceptor"; } public Object invoke(Invocation invocation) throws Throwable { if (!(invocation instanceof FieldReadInvocation)) return invocation.invokeNext(); try { FieldReadInvocation mi = (FieldReadInvocation)invocation; System.out.println("<<< Entering GetInterceptor for: " + mi.getField().getName()); return invocation.invokeNext(); } finally { System.out.println(">>> Leaving GetInterceptor"); } } }