commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsi...@us.ibm.com
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.

<ras>

*******************************************
Richard A. Sitze            rsitze@us.ibm.com
CORBA Interoperability & WebServices
IBM WebSphere Development



                      costinm@covalent

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

                      06/26/2002 11:43         cc:

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

                      to "Jakarta

                      Commons

                      Developers List"






On Wed, 26 Jun 2002 rsitze@us.ibm.com 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.
This
> is NOT equivalent to Class.getName(), which would pick up the
ClassFinder's
> 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).

Costin

*******************************************
Richard A. Sitze            rsitze@us.ibm.com
CORBA Interoperability & WebServices
IBM WebSphere Development
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message