KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > implementz > TestInterceptor


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package implementz;
8
9 import org.jboss.aop.joinpoint.Invocation;
10 import org.jboss.aop.advice.Interceptor;
11 /**
12  *
13  * @author <a HREF="mailto:kabir.khan@jboss.org">Kabir Khan</a>
14  * @version $Revision: 44138 $
15  */

16 public class TestInterceptor implements Interceptor
17 {
18    public String JavaDoc getName() { return "TestInterceptor"; }
19
20
21    public Object JavaDoc invoke(Invocation invocation) throws Throwable JavaDoc
22    {
23       try
24       {
25          System.out.println("<<< TestInterceptor intercepting");
26          invocation.resolveClassAnnotation(ImplementingInterface.class);
27          return invocation.invokeNext();
28       }
29       finally
30       {
31          System.out.println(">>> Leaving Trace");
32       }
33    }
34 }
35
Popular Tags