You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Davanum Srinivas <di...@yahoo.com> on 2001/05/11 20:32:57 UTC

[C2][Avalon] Avoid Class.forName and getClassLoader()

Berin,

I noticed the use of getClassLoader().loadClass() in Avalon's DefaultComponentManager and
DefaultComponentSelector.java. We should be using Thread's getContextClassLoader first *BEFORE*
using either Class.forName() or getClassLoader.loadClass(). This will reduce problems later....

See http://www.javageeks.com/Papers/ClassForName/DynLoad.pdf for more information. You can also
look into javax.xml.parsers.SAXParserFactory's code.

Thanks,
dims


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2][Avalon] Avoid Class.forName and getClassLoader()

Posted by Berin Loritsch <bl...@apache.org>.
Davanum Srinivas wrote:
> 
> Berin,
> 
> I noticed the use of getClassLoader().loadClass() in Avalon's DefaultComponentManager and
> DefaultComponentSelector.java. We should be using Thread's getContextClassLoader first *BEFORE*
> using either Class.forName() or getClassLoader.loadClass(). This will reduce problems later....

Beta 2 will have a better approach.  You will have the opportunity to create the
DefaultComponentManager with the ClassLoader of your choice--but if none is given,
it defaults to the getContextClassLoader method.

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2][Avalon] Avoid Class.forName and getClassLoader()

Posted by Berin Loritsch <bl...@apache.org>.
Davanum Srinivas wrote:
> 
> Berin,
> 
> I noticed the use of getClassLoader().loadClass() in Avalon's DefaultComponentManager and
> DefaultComponentSelector.java. We should be using Thread's getContextClassLoader first *BEFORE*
> using either Class.forName() or getClassLoader.loadClass(). This will reduce problems later....
> 
> See http://www.javageeks.com/Papers/ClassForName/DynLoad.pdf for more information. You can also
> look into javax.xml.parsers.SAXParserFactory's code.

Let me read the paper before I commit anything.  This is a bugfix that will likely go into
Beta 2, as I am minutes from releasing Avalon 4.0b1 now.  Plus I want to fully understand
the problem so that I don't do a half-*ss job patching it.

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org