FileDocCategorySizeDatePackage
TracingInterceptor.javaAPI DocJBoss 4.2.11839Fri Jul 13 20:54:52 BST 2007org.jboss.tutorial.interceptor.bean

TracingInterceptor

public class TracingInterceptor extends Object

Fields Summary
Constructors Summary
Methods Summary
public java.lang.Objectlog(javax.interceptor.InvocationContext ctx)

      System.out.println("*** TracingInterceptor intercepting " + ctx.getMethod().getName());
      long start = System.currentTimeMillis();
      try
      {
         return ctx.proceed();
      }
      catch(Exception e)
      {
         throw e;
      }
      finally
      {
         long time = System.currentTimeMillis() - start;
         String method = ctx.getTarget().getClass().getName() + "." + ctx.getMethod().getName() + "()";
         System.out.println("*** TracingInterceptor invocation of " + method + " took " + time + "ms");
      }