hey, thanks for the insight.
So, before I mess-code, let me double check. What you're saying is that 
I could just do:
ClassLoader orig = Thread.currentThread().getContextClassLoader();
try{
Thread.currentThread().setContextClassLoader(<Factory class to be looked 
up>.class.getClassLoader());
  ... do lookup ...
}finally{
Thread.currentThread().setContextClassLoader(orig);
}


and that would be it, it will even find META-INF/services?
I guess "<Factory class to be looked up>" might actually be any class in 
the same jar?

Cheers,
Gabriel

Jody Garnett wrote:
> We have a trick in uDig where we look up a class; find its classloader; 
> switch the thread to that classloader; make the call that uses factory 
> spi; and then restore the thead its previous classloader.
> 
> Jody
> 
>> don't have much spare time to devote to 2.5.
>> As a bonus, if you can switch to 2.6 I'll be happy to figure out a way
>> for you to impose a classloader to the spi.
> 
> 


-- 
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to