KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Description of the current invocation, given to an interceptor upon method-call.
14  *
15  * <!-- $Id: Invocation.java,v 1.8 2003/06/11 15:13:32 lecando Exp $ -->
16  *
17  * @author $Author: lecando $
18  * @version $Revision: 1.8 $
19  */

20 public interface Invocation {
21     /**
22      * Invoke the next interceptor in the stack (or the target if you're last).
23      *
24      * @return the result of the call on the target (might be intercepted and changed by an interceptor).
25      * @throws Throwable if the call throws an exception.
26      */

27     Object JavaDoc invokeNext() throws Throwable JavaDoc;
28
29     /**
30      * Gets the target of the call.
31      *
32      * @return the actual target object.
33      */

34     Object JavaDoc getTarget();
35
36     void setTarget(Object JavaDoc o);
37
38     /**
39      * Gets the aspected object the call is part of. (TODO might need to change name...)
40      *
41      * @return the aspected object.
42      */

43     Object JavaDoc getProxy();
44
45     /**
46      * Gets the index of the current interceptor.
47      *
48      * @return the index of the current interceptor.
49      */

50     int getCurrentIndex();
51
52     /**
53      * Gets the total number of interceptors in the chain.
54      *
55      * @return the total number of interceptors in the chain.
56      */

57     int getNumberOfInterceptors();
58
59     /**
60      * Gets the interceptors at the specified index.
61      *
62      * @param index index to the interceptor to retrieve.
63      * @return the interceptors at the specified index.
64      */

65     Interceptor getInterceptor(int index);
66
67     /**
68      * Gets the method being called.
69      *
70      * @return the method being called.
71      */

72     Method JavaDoc getMethod();
73
74     /**
75      * Gets the arguments to the call.
76      *
77      * @return the arguments to the call.
78      */

79     Object JavaDoc[] getArgs();
80
81     Class JavaDoc getTargetInterface();
82
83     AspectInstance getAspectInstance();
84
85     Object JavaDoc getArg(int arg);
86 }
87
Popular Tags