| Customizable parent of classloaders [message #42139] | 
Fri, 07 May 2004 15:16   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Here is a repost from the equinox-dev mailing list, that some of you may 
find interesting. 
 
I checked in code to AbstractFrameworkAdaptor to support specifying what 
classloader you want to use as the parent classloader of all the 
BundleClassloaders in the system. 
 
The following values are supported for the Java property 
osgi.parentClassloader: 
 
"app" - the application classloader 
 
"ext" - the extension classloader 
 
"boot" - the boot classloader 
 
"fwk" - the framework's classloader 
 
The default is to use the boot classloader. I specified a "fwk" option 
because as far as I know most all other implementations of the OSGi 
framework actually default to using the classloader of the framework as the 
parent of all the bundle classloaders. I wanted to at least give us the 
option to allow for this if needed. 
 
Thomas Watson
 |  
 |  
  | 
| Re: Customizable parent of classloaders [message #42170 is a reply to message #42139] | 
Sat, 08 May 2004 08:28   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Oddly enough, I just removed this feature from my plugin engine. I have a 
hard-coded check for java. and javax. and if so, it jumps to the boot loader 
to load those classes. Anything else always goes through the plugins 
classpath first, any dependent loaders next, then the parent loader, 
whichever it may be, oh, except for the plugin engine classes which I also 
bump up to the parent loader. 
 
I had an option to specify a plugins parent loader to be the loader of the 
engine, the boot loader, the application loader or a shared loader that all 
plugins would use to share libraries. I removed it as I didn't see the point 
and performance was slightly slower, especially when getting java. and 
javax. classes. In my present engine, java. and javax go through a single 
method hop to the boot loader, as opposed to the normal delegation model of 
the engine loader to the app loader to the ext loader to the boot loader. We 
do it in 3 less method calls at the expense of a string check at the start 
of the loadClass() method. 
 
 
"Pascal Rapicault" <pascal_rapicault@ca.ibm.com> wrote in message 
news:c7gmtq$18d$1@eclipse.org... 
> Here is a repost from the equinox-dev mailing list, that some of you may 
> find interesting. 
> 
> I checked in code to AbstractFrameworkAdaptor to support specifying what 
> classloader you want to use as the parent classloader of all the 
> BundleClassloaders in the system. 
> 
> The following values are supported for the Java property 
> osgi.parentClassloader: 
> 
> "app" - the application classloader 
> 
> "ext" - the extension classloader 
> 
> "boot" - the boot classloader 
> 
> "fwk" - the framework's classloader 
> 
> The default is to use the boot classloader. I specified a "fwk" option 
> because as far as I know most all other implementations of the OSGi 
> framework actually default to using the classloader of the framework as 
the 
> parent of all the bundle classloaders. I wanted to at least give us the 
> option to allow for this if needed. 
> 
> Thomas Watson 
> 
>
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.04039 seconds