[Proxool-cvs] proxool/src/java/org/logicalcobwebs/proxool/proxy InvokerFacade.java,1.1,1.2 MethodMap
UNMAINTAINED!
Brought to you by:
billhorsman
From: <bil...@us...> - 2004-07-13 21:06:57
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12207/src/java/org/logicalcobwebs/proxool/proxy Modified Files: InvokerFacade.java MethodMapper.java Log Message: Fix problem using injectable interfaces on methods that are declared in non-public classes. Index: InvokerFacade.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/proxy/InvokerFacade.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InvokerFacade.java 2 Jun 2004 20:43:53 -0000 1.1 --- InvokerFacade.java 13 Jul 2004 21:06:16 -0000 1.2 *************** *** 41,48 **** --- 41,69 ---- } + /** + * Override the method provided by the {@link #getConcreteMethod(java.lang.Class, java.lang.reflect.Method)}. Use this + * if you decide that the concrete method provided wasn't any good. For instance, if you get an IllegalAccessException + * whilst invoking the concrete method then you should perhaps try using the proxy supplied method instead. + * @param concreteClass the class we are invoking upon + * @param injectableMethod the method supplied by the proxy + * @param overridenMethod the one we are going to use (probably the same as injectrableMethod actually) + */ + public static void overrideConcreteMethod(Class concreteClass, Method injectableMethod, Method overridenMethod) { + Object key = concreteClass.getName() + ":" + injectableMethod.getName(); + MethodMapper methodMapper = (MethodMapper) methodMappers.get(key); + if (methodMapper == null) { + methodMapper = new MethodMapper(concreteClass); + methodMappers.put(key, methodMapper); + } + methodMapper.overrideConcreteMethod(injectableMethod, overridenMethod); + } + } /* Revision history: $Log$ + Revision 1.2 2004/07/13 21:06:16 billhorsman + Fix problem using injectable interfaces on methods that are declared in non-public classes. + Revision 1.1 2004/06/02 20:43:53 billhorsman New classes to support injectable interfaces Index: MethodMapper.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/proxy/MethodMapper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MethodMapper.java 2 Jun 2004 20:43:53 -0000 1.1 --- MethodMapper.java 13 Jul 2004 21:06:18 -0000 1.2 *************** *** 87,90 **** --- 87,99 ---- } + /** + * Don't use the one we calculate using {@link #getConcreteMethod(java.lang.reflect.Method)}, use this one instead. + * @param injectableMethod the method supplied by the proxy + * @param overridenMethod the one we are going to use (probably the same as injectrableMethod actually) + */ + public void overrideConcreteMethod(Method injectableMethod, Method overridenMethod) { + cachedConcreteMethods.put(injectableMethod, overridenMethod); + } + } *************** *** 92,95 **** --- 101,107 ---- Revision history: $Log$ + Revision 1.2 2004/07/13 21:06:18 billhorsman + Fix problem using injectable interfaces on methods that are declared in non-public classes. + Revision 1.1 2004/06/02 20:43:53 billhorsman New classes to support injectable interfaces |