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