dev@glassfish.java.net

Re: ClassLoader impl changes

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Tue, 26 Feb 2008 10:42:40 -0800

The changes are basically changing the order in which we look up
classes. Previously we were looking at the module's import first and
then delegating to the parent class loader. This allowed features like
overriding your parent import list (parent import module A version
1.3.4, child import module A version 1.3.5). So with this change I
have temporarily turned off that feature that we were not using
anyhow. To reintroduce the feature, we just need to inject a masking
class loader between the parent and the child that will hide the
parent's A to the child class loader. This masking class loader is
pretty easy to install when necessary as Hk2 has all the information
it needs to figure out there are several conflicting module's version
is a class loader hierarchy. That way we can still optimize class
loading for co-located classes yet fully support a modular
architecture. I will add that capability to Hk2 in the near future.

In most cases, such cases can also be avoided by using private imports
so that they don't end up re-exporting their imported modules.

Jerome

On Feb 25, 2008, at 11:53 PM, Bill Shannon wrote:

> Jerome Dochez wrote:
>> Hi All
>> I have changed the algorithm responsible to load classes in hk2,
>> this lead to an impressive performance boost at startup (almost
>> half time of the last few weeks number) but also general runtime
>> performance. I have tested war deployment as well as ror but if you
>> see any Class or Resources loading issues, please report it to me
>> asap.
>> Before the change, startup was 1.6sec, simple war deployment about
>> 10s.
>> after, startup is 0.7 and simple war about 5 seconds.
>
> Want to describe the change, or should we start guessing?... :-)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>