Package org.logicalcobwebs.proxool.proxy
Class MethodMapper
- java.lang.Object
-
- org.logicalcobwebs.proxool.proxy.MethodMapper
-
public class MethodMapper extends java.lang.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.- Since:
- Proxool 0.9
- Version:
- $Revision: 1.2 $, $Date: 2004/07/13 21:06:18 $
- Author:
- Bill Horsman, $Author: billhorsman $ (current maintainer)
-
-
Constructor Summary
Constructors Constructor Description MethodMapper(java.lang.Class concreteClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.reflect.Method
getConcreteMethod(java.lang.reflect.Method injectableMethod)
Returns the method in the concrete class with an indentical signature to that passed as a parametervoid
overrideConcreteMethod(java.lang.reflect.Method injectableMethod, java.lang.reflect.Method overridenMethod)
Don't use the one we calculate usinggetConcreteMethod(java.lang.reflect.Method)
, use this one instead.
-
-
-
Method Detail
-
getConcreteMethod
protected java.lang.reflect.Method getConcreteMethod(java.lang.reflect.Method injectableMethod) throws ProxoolException
Returns the method in the concrete class with an indentical signature to that passed as a parameter- Parameters:
injectableMethod
- provides signature that we are trying to match- Returns:
- the method in the concrete class that we can invoke as if it were in the interface
- Throws:
ProxoolException
- if the method is not found.
-
overrideConcreteMethod
public void overrideConcreteMethod(java.lang.reflect.Method injectableMethod, java.lang.reflect.Method overridenMethod)
Don't use the one we calculate usinggetConcreteMethod(java.lang.reflect.Method)
, use this one instead.- Parameters:
injectableMethod
- the method supplied by the proxyoverridenMethod
- the one we are going to use (probably the same as injectrableMethod actually)
-
-