On Mon, Oct 19, 2009 at 7:40 AM, Peter Firmstone <[email protected]> wrote: >> Thanks Nic for your comments, pls see reply below.
I think we have diverged and discussing different things. Some time ago, it was said that the classloader of a class could be retrieved by calling a static method. I have tried to point out that this is fairly "impossible" in OSGi without collaboration with the OSGi framework implementation, as multiple (even fully compatible, or even exact same versions) instance of the same classes can be present in different class spaces within the OSGi framework, and which package got resolved to which bundle (and hence the classloader) is an implementation detail in OSGi. There is no theory around that fact. I am speaking of "locating a classloader of an existing class already present", and not how to locate one externally to the JVM and OSGi framework. See the difference? So if ClassA wants to load an implementation of InterfaceB, then that implementation must be chosen from the class space that ClassA and InterfaceB belongs to, and not only that it implements InterfaceB+constraints. Cheers -- Niclas Hedhman, Software Developer http://www.qi4j.org - New Energy for Java I live here; http://tinyurl.com/2qq9er I work here; http://tinyurl.com/2ymelc I relax here; http://tinyurl.com/2cgsug
