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