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

Ales Justin do-not-reply at jboss.com
Fri May 14 10:27:13 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/543109#543109

> Whether it caches things is decided elsewhere, based on the ClassLoaderPolicy rules.
> This code is just a safety check in the event that the class changes 
> (somebody redeployed a classloader) and the global cache hasn't been flushed properly.
> As I said on the other response, it can't cache the load in that "globalClassCache", because
> the classloader used is in the parent domain. It would need some complicated
> flushing rules to cache it in the child domain as well - not my preferred solution.
"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();


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/bdfcbbaa/attachment-0001.html 

More information about the jboss-user mailing list