KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tirsen > nanning > MethodInterceptor


1 /*
2  * Nanning Aspects
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package com.tirsen.nanning;
8
9 import java.lang.reflect.Method JavaDoc;
10
11
12 /**
13  * Intercepts calls on an interface on it's way to the target, these are nested "on top" of the target.
14  *
15  * <!-- $Id: MethodInterceptor.java,v 1.5 2003/05/11 11:17:17 tirsen Exp $ -->
16  *
17  * @author $Author: tirsen $
18  * @version $Revision: 1.5 $
19  */

20 public interface MethodInterceptor extends Interceptor {
21     /**
22      * Do the stuff you want to do before and after the invocation. Polite implementations would certainly like
23      * to implement {@link Invocation#invokeNext()}.
24      * @param invocation
25      * @return the result of the call to {@link Invocation#invokeNext()}, might be intercepted by the interceptor.
26      * @throws Throwable if the interceptors or the target-object throws an exception.
27      */

28     Object JavaDoc invoke(Invocation invocation) throws Throwable JavaDoc;
29 }
30
Popular Tags