db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David W. Van Couvering" <David.Vancouver...@Sun.COM>
Subject Re: context classloader versus default classloader
Date Wed, 23 Nov 2005 00:56:03 GMT
My knowledge is increasing...

A great white paper:

http://www.theserverside.com/articles/content/dm_classForname/DynLoad.pdf

It appears that the context classloader is made available to code to use 
*if they want to* but is not implicitly used when using 
'Class.forName()' or 'new XXX()'.

David

David W. Van Couvering wrote:
> A quick note: it appears I'm not the only one who struggles with this 
> problem...
> 
> http://jroller.com/page/alanli?entry=plugin_architecture_thread_context_classloader 
> 
> 
> David W. Van Couvering wrote:
> 
>> Hi.  I am a little confused between two different "current 
>> classloaders" that are available to appication code:
>>
>> this.getClass().getClassLoader() -- what I call the "default classloader"
>>
>> Thread.currentThread.getContextClassLoader() -- what I call the 
>> "context classloader"
>>
>> When I am creating my own classloader, I want to identify the parent 
>> classloader.  Which one of these should I use?  I noticed that the 
>> engine code uses the context classloader to load application classes, 
>> but sets the default classloader to be its parent when creating a 
>> classloader for loading generated bytecode.
>>
>> Any and all tips would be most appreciated.
>>
>> Thanks,
>>
>> David

Mime
View raw message