[jboss-user] [JBoss Microcontainer Development] - Classloading and caching changes

Ales Justin do-not-reply at jboss.com
Fri May 14 10:29:22 EDT 2010

Ales Justin [http://community.jboss.org/people/alesj] replied to the discussion

"Classloading and caching changes"

To view the discussion, visit: http://community.jboss.org/message/543110#543110

> "the classloader used is in the parent domain"
> But this isn't always the case?
> Only for this piece:
>       // Try the before attempt (e.g. from the parent)
>       Loader loader = *null*;
>       *if* (findInParent)
>          loader = findBeforeLoader(name);
>       *if* (loader != *null*)
>          *return* loader;
> But this could be cached -- if the policy permits it?
>       // Next use any requesting classloader, this will look at everything not just what it exports
>       *if* (classLoader != *null*)
>       {
>          *if* (trace)
>             log.trace(*this* + " trying to load " + name + " from requesting " + classLoader);
>          *if* (classLoader.getResourceLocally(name) != *null*)
>             *return* classLoader.getLoader();
>       }
That's why it can't update the Cache in the place you suggested.
For a classloader inside the domain it can globally cache, otherwise it can't.

It should cache in the domain where the classloader lives.
What needs changing is to check that cache according to the parent delegation
rules outside the synchronization block.

if (matchesParentBefore)

The difficulty comes in that we would like to add
if (matchesParentAfter)

But we can't because the next logical step is to see if we can load from our domain.
This however would work:

if (isBlackListedInOurDomain && matchesParentAfter)

because we know we won't load it from our domain.


Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer Development at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100514/e54718ad/attachment-0001.html 

More information about the jboss-user mailing list