org.logicalcobwebs.proxool.proxy
类 MethodMapper
java.lang.Object
org.logicalcobwebs.proxool.proxy.MethodMapper
public class MethodMapper
- extends Object
Handles the mapping between methods with identical signatures but that are not related
by inheritance. This allows you to invoke a method on a class using an interface that
it doesn't actually implement. It caches the result of its reflective lookup to save time.
If the concreteClass does in fact implement the injectable interface then it quickly
returns the method without the penalty of mapping using reflection.
- 从以下版本开始:
- Proxool 0.9
- 版本:
- $Revision: 1.2 $, $Date: 2004/07/13 21:06:18 $
- 作者:
- Bill Horsman, $Author: billhorsman $ (current maintainer)
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MethodMapper
public MethodMapper(Class concreteClass)
- 参数:
concreteClass - the class that we want to invoke methods on. It should either implement all methods on
the injectable interface, or provide methods with an identical signature.
getConcreteMethod
protected Method getConcreteMethod(Method injectableMethod)
throws ProxoolException
- Returns the method in the concrete class with an indentical signature to that passed
as a parameter
- 参数:
injectableMethod - provides signature that we are trying to match
- 返回:
- the method in the concrete class that we can invoke as if it were in the interface
- 抛出:
ProxoolException - if the method is not found.
overrideConcreteMethod
public void overrideConcreteMethod(Method injectableMethod,
Method overridenMethod)
- Don't use the one we calculate using
getConcreteMethod(java.lang.reflect.Method), use this one instead.
- 参数:
injectableMethod - the method supplied by the proxyoverridenMethod - the one we are going to use (probably the same as injectrableMethod actually)
Copyright © 2014. All rights reserved.