[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Generated Classes not found if they do not match any of
kabir.khan@jboss.com
do-not-reply at jboss.com
Wed Feb 4 15:24:16 EST 2009
"adrian at jboss.org" wrote :
| We also haven't discussed your other point about needing to flush the blacklist.
|
False alarm :-)
The domain's blacklist is being cleared by BaseClassLoader via the policy
| public void clearBlackList(String name)
| {
| if (blackList != null)
| {
| boolean trace = log.isTraceEnabled();
| if (trace)
| log.trace(this + " removing from blacklist " + name);
| blackList.remove(name);
| policy.clearBlackList(name);
| }
| }
|
It works fine, as long as the class created is in one of the existing packages.
I did notice however that if I do
| //Blacklist classe
| //Loader A belongs to default domain and exports packageA
| loaderA.load("packageA.NewClassA");
| //Loader B belongs to defaultDomain and exports packageB
| loaderB.load("packageA.NewClassA");
|
| //Create packageA.NewClassA in loaderA
| loaderA.load("packageA.NewClassA"); //Works fine
| loaderB.load("packageA.NewClassA");
|
loaderB has packageA.NewClassA in its blackList, but this is never checked when loading classes. But it does seem to be used in the following method, so ClassLoaderDomain.clearBlackList() should probably be clear all the domain's classloaders?
| public class BaseClassLoader extends SecureClassLoader implements BaseClassLoaderMBean, RealClassLoader
| {
| URL getResourceLocally(final String name, final boolean trace)
| {
| ...
| // Is this resource blacklisted?
| if (blackList != null && blackList.containsKey(name))
| {
| if (trace)
| log.trace(this + " resource is blacklisted " + name);
| return null;
| }
| ...
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4207117#4207117
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4207117
More information about the jboss-dev-forums
mailing list