/* * 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.advice.Interceptor; import org.jboss.aop.InterceptorDef; import org.jboss.aop.Bind; /** * * @author Bill Burke * @version $Revision: 1.1 $ */ @InterceptorDef @Bind (pointcut="execution(POJO->new())") public class SimpleInterceptor implements Interceptor { public String getName() { return "SimpleInterceptor"; } public Object invoke(Invocation invocation) throws Throwable { try { System.out.println("<<< Entering SimpleInterceptor type: " + invocation.getClass().getName()); return invocation.invokeNext(); } finally { System.out.println(">>> Leaving SimpleInterceptor"); } } }