2008/7/7 Carsten Ziegeler <[EMAIL PROTECTED]>: > Stuart McCulloch wrote: > >> >> imho SCR should be using the classloader of the class that declared the >> bind/unbind method, ie: >> >> method.getDeclaringClass().getClassLoader() >> >> when loading parameter classes - always using B's classloader doesn't >> sound >> right to me >> >> Yes, I agree - now, the current implementation uses the classname of the > service (string) to load the parameter class and then this class to find the > corresponding method. > > We could change this to iterate over all available methods and pick the one > with the correct parameter (by string comparision) or - and this seems > easier to me - use directly the class of the service. The bind/unbind > methods are searched with a valid ServiceReference. This reference can be > used directly to get the service itself and the service class. > > WDYT? >
looking at the current code that trawls the super-classes, I believe the problem could be solved by changing 'DependencyManager.java:734' so a ClassNotFoundException will drop down to the exhaustive search of declared methods (this code would need to be refactored out, so it can be called from multiple catch blocks) re-writing that whole function might reveal more optimizations though :) Thanks > > Carsten > -- > Carsten Ziegeler > [EMAIL PROTECTED] > -- Cheers, Stuart
