Community

Classloading and caching changes

reply from Ales Justin in JBoss Microcontainer Development - View the full discussion
i) it doesn't differentiate what is loaded before or after the load from

the target domain
ii) it complicates the flushing in the event that the parent domain gets
flushed, e.g. a classloader is removed from the parent domain

Hmmm ... this code needs fixing then. ;-)

 

     // Should we directly load from the parent?
     if (findInParent == false)
     {
        Class<?> clazz = loadClassBefore(name);
        if (clazz != null)
        {
           globalClassCache.put(path, new ClassCacheItem(clazz)); // REMOVE
           return clazz;
        }
     }

 

We as a child don't know when a parent domain has a classloader removed
and therefore the cached result is invalid.

It could do if the parent domain flushed all the caches in its child domains, but it doesn't do that currently.
But even then the globalClassCache wouldn't differentiate the before/after rules.

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer Development at Community