KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > aop > ProxyMethodInvocation


1 /*
2  * Copyright 2002-2007 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.springframework.aop;
18
19 import org.aopalliance.intercept.MethodInvocation;
20
21 /**
22  * Extension of the AOP Alliance {@link org.aopalliance.intercept.MethodInvocation}
23  * interface, allowing access to the proxy that the method invocation was made through.
24  *
25  * <p>Useful to be able to substitute return values with the proxy,
26  * if necessary, for example if the invocation target returned itself.
27  *
28  * @author Juergen Hoeller
29  * @since 1.1.3
30  * @see org.springframework.aop.framework.ReflectiveMethodInvocation
31  * @see org.springframework.aop.support.DelegatingIntroductionInterceptor
32  */

33 public interface ProxyMethodInvocation extends MethodInvocation {
34
35     /**
36      * Return the proxy that this method invocation was made through.
37      * @return the original proxy object
38      */

39     Object JavaDoc getProxy();
40
41     /**
42      * Create a clone of this object. If cloning is done before <code>proceed()</code>
43      * is invoked on this object, <code>proceed()</code> can be invoked once per clone
44      * to invoke the joinpoint (and the rest of the advice chain) more than once.
45      * @return an invocable clone of this invocation.
46      * <code>proceed()</code> can be called once per clone.
47      */

48     MethodInvocation invocableClone();
49
50     /**
51      * Create a clone of this object. If cloning is done before <code>proceed()</code>
52      * is invoked on this object, <code>proceed()</code> can be invoked once per clone
53      * to invoke the joinpoint (and the rest of the advice chain) more than once.
54      * @param arguments the arguments that the cloned invocation is supposed to use,
55      * overriding the original arguments
56      * @return an invocable clone of this invocation.
57      * <code>proceed()</code> can be called once per clone.
58      */

59     MethodInvocation invocableClone(Object JavaDoc[] arguments);
60
61     /**
62      * Add the specified user attribute with the given value to this invocation.
63      * <p>Such attributes are not used within the AOP framework itself. They are
64      * just kept as part of the invocation object, for use in special interceptors.
65      * @param key the name of the attribute
66      * @param value the value of the attribute, or <code>null</code> to reset it
67      */

68     void setUserAttribute(String JavaDoc key, Object JavaDoc value);
69
70     /**
71      * Return the value of the specified user attribute.
72      * @param key the name of the attribute
73      * @return the value of the attribute, or <code>null</code> if not set
74      * @see #setUserAttribute
75      */

76     Object JavaDoc getUserAttribute(String JavaDoc key);
77
78 }
79
Popular Tags