org.logicalcobwebs.proxool.proxy
Class MethodMapper

java.lang.Object
  extended by 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
MethodMapper(java.lang.Class concreteClass)
           
 
Method Summary
 void overrideConcreteMethod(java.lang.reflect.Method injectableMethod, java.lang.reflect.Method overridenMethod)
          Don't use the one we calculate using getConcreteMethod(java.lang.reflect.Method), use this one instead.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodMapper

public MethodMapper(java.lang.Class concreteClass)
Parameters:
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.
Method Detail

overrideConcreteMethod

public void overrideConcreteMethod(java.lang.reflect.Method injectableMethod,
                                   java.lang.reflect.Method overridenMethod)
Don't use the one we calculate using getConcreteMethod(java.lang.reflect.Method), use this one instead.

Parameters:
injectableMethod - the method supplied by the proxy
overridenMethod - the one we are going to use (probably the same as injectrableMethod actually)