01: /*
02: * Copyright 2002,2003 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: package net.sf.cglib.proxy;
17:
18: /**
19: * General-purpose {@link Enhancer} callback which provides for "around advice".
20: * @author Juozas Baliuka <a href="mailto:baliuka@mwm.lt">baliuka@mwm.lt</a>
21: * @version $Id: MethodInterceptor.java,v 1.8 2004/06/24 21:15:20 herbyderby Exp $
22: */
23: public interface MethodInterceptor extends Callback {
24: /**
25: * All generated proxied methods call this method instead of the original method.
26: * The original method may either be invoked by normal reflection using the Method object,
27: * or by using the MethodProxy (faster).
28: * @param obj "this", the enhanced object
29: * @param method intercepted Method
30: * @param args argument array; primitive types are wrapped
31: * @param proxy used to invoke super (non-intercepted method); may be called
32: * as many times as needed
33: * @throws Throwable any exception may be thrown; if so, super method will not be invoked
34: * @return any value compatible with the signature of the proxied method. Method returning void will ignore this value.
35: * @see MethodProxy
36: */
37: public Object intercept(Object obj,
38: java.lang.reflect.Method method, Object[] args,
39: MethodProxy proxy) throws Throwable;
40:
41: }
|