commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [discovery] Use of ClassLoader in ClassFinder
Date Wed, 26 Jun 2002 19:14:10 GMT
Sorry... SPI == Service Provider Interface OR Service Programming
Interface.  It's not stricly a Java Interface; it can be an interface,
abstract class, or class.

Example:   org.apache.commons.logging.LogFactory could be a service
provider interface.

Call ServiceFinder.find(org.apache.commons.logging.LogFactory, ....)  to
locate an implementation of that interface.

So, as-per my earlier note, the ClassFinder uses the context class loader
and the class loader used to load LogFactory.


Richard A. Sitze  
CORBA Interoperability & WebServices
IBM WebSphere Development


                      .net                     To:      Jakarta Commons
Developers List <commons-dev@jakarta.

                      06/26/2002 11:43         cc:

                      AM                       Subject: Re: [discovery] Use
of ClassLoader in ClassFinder
                      Please respond

                      to "Jakarta


                      Developers List"

On Wed, 26 Jun 2002 wrote:

> One heads up...  The loader attempts to find a service using the context
> class loader, and failing that it tries the SPI Class's class loader.
> is NOT equivalent to Class.getName(), which would pick up the
> class loader.
> I believe this may be more appropriate.. but then again the SPI's Class
> Loader is more likely to be equivalent to the context class loader...
> thoughts?

What is SPI ? Sorry, too many acronyms.

It is likely that commons-discovery will be in the parent class loader,
while the discovered packages in child loaders.

Probably the 'right' thing to do is also try the class loader of the
caller ( it is possible to get access to the call stack - with some
hacks - like we do in c-logging).


Richard A. Sitze  
CORBA Interoperability & WebServices
IBM WebSphere Development
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message