/* * 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.ConstructorInvocation; import org.jboss.aop.advice.Interceptor; /** * * @author Bill Burke * @version $Revision: 1.2 $ */ public class ConstructorInterceptor implements Interceptor { public String getName() { return "ConstructorInterceptor"; } public Object invoke(Invocation invocation) throws Throwable { try { ConstructorInvocation mi = (ConstructorInvocation)invocation; System.out.println("<<< Entering ConstructorInterceptor for: " + mi.getConstructor().toString()); return invocation.invokeNext(); } finally { System.out.println(">>> Leaving ConstructorInterceptor"); } } }