[Javassist Development] New message: "Re: ScopedClassPoolRepositoryImpl and default ClassPool"
by Flavia Rainone
JBoss development,
A new message was posted in the thread "ScopedClassPoolRepositoryImpl and default ClassPool":
http://community.jboss.org/message/525606#525606
Author : Flavia Rainone
Profile : http://community.jboss.org/people/flavia.rainone@jboss.com
Message:
--------------------------------------------------------------
On a side note, the class pool that is used by factories to represent null class loaders is configured on org.jboss.classpool.spi.AbstractClassPoolFActory. Currently it can be set by callling AbstractClassPoolFactory.setDefaultClassPool() and it can be retrieved by callling AbstractClassPoolFactory.getDefaultClassPool().
The problem is that, IMO, this nomenclature is not appropriate. Javassist uses default ClassPool to denote the classpools that is used by default on some operations. In my case, I'm configuring the class pool that is used to represent null class loaders.
Any ideas on how to name those methods? I thought on setNullClassPool or on setBootstrapClassPool
Notice that anyway we will have a gap with the SystemClassPool nomenclature, which is being used because this class pool is associated to the SystemClassLoader.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525606#525606
14 years, 7 months
[JBoss AOP Development] New message: "Re: ClassPool Refactoring"
by Flavia Rainone
JBoss development,
A new message was posted in the thread "ClassPool Refactoring":
http://community.jboss.org/message/525602#525602
Author : Flavia Rainone
Profile : http://community.jboss.org/people/flavia.rainone@jboss.com
Message:
--------------------------------------------------------------
All tests are passing now in my system, which allowed me to validate two previous fixes Kabir and I implemented for the problem of duplicate CtClasses.
Kabir's fix consists of https://jira.jboss.org/jira/browse/JBAOP-766 :
public class DelegatingClassPool extends BaseClassPool
{
...
public CtClass getCached(String classname)
{
>>> //TODO Not 100 sure this is correct, but it seems to do the job where repeated calls to get() on a pool in a hierarchy returns a different instance of the class
>>> CtClass clazz = super.getCachedLocally(classname);
>>> if (clazz != null)
>>> return clazz;
if (isGeneratedClass(classname))
{
return null;
}
return domain.getCachedOrCreate(this, classname, false);
}
}
My fix has never been comitted and consists of adding a check on the classes cache to BaseClassPool.get:
public class BaseClassPool extends AbstractClassPool
{
...
@Override
public final CtClass get(String classname) throws NotFoundException
{
boolean trace = logger.isTraceEnabled();
if (trace) logger.trace(this + " initiating get of " + classname);
if (this.getClassLoader() == null)
{
throw new IllegalStateException("Illegal call. " + " A class cannot be retrieved from ClassPool " +
this + " because the corresponding ClassLoader is garbage collected");
}
try
{
>>> if (this.classes.containsKey(classname))
>>> {
>>> return (CtClass) classes.get(classname);
>>> }
CtClass clazz = super.get(classname);
if (trace)
logger.trace(this + " completed get of " + classname + " " + getClassPoolLogStringForClass(clazz));
return clazz;
}
catch (NotFoundException e)
{
if (trace)
logger.trace(classname + " could not be found from " + this, e);
throw e;
}
}
}
It turns out that, once all tests were fixed for issue https://jira.jboss.org/jira/browse/JBREFLECT-94, those fixes weren't needed anymore, which means that JBREFLECT-94 was the real issue.
Now I'm left with the dillema of whether should I commit those fixes. I have started running some tests to try to figure out if any of those bring some improvement, and it seems that looking up classes cache in BaseClassLoader.get does bring a few improvements to the performance of aop tests, but I need to run those tests more times in order to do a reasonable investigation.
While working with Kabir to fix the AOP tests for AS, he pointed out that there could be an issue related to my fix. It seemed obviously right to me to look in the classes cache (a cache declared in ScopedClassPool that contains all classes created by the current class pool) before doing anything else. To me, if we have a hit in the cache, it means that the current pool is the one that is supposed to load the class, and that there is no need to look further by calling super.get method. But Kabir raised the following possibility. What if the class pool scenario (a reflection of the class loader/domain scenario) changes after the current class pool loaded the class, in a way that this class pool is no longer the one responsible for loading that class? In that case, looking for the class in the classes cache would be a serious mistake. Is this scenario possible?
Regarding Kabir's fix, I'm also looking for any opnion regarding whether it should be committed. It seems, though, that adding both fixes brings some small performance penalty. I'll continue running tests to be able to assert whether this is really true, and what is the penalty we're talking about.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525602#525602
14 years, 7 months
[JBoss Microcontainer Development POJO Server] New message: "Re: Classloader VFS3 Integration"
by Ales Justin
JBoss development,
A new message was posted in the thread "Classloader VFS3 Integration":
http://community.jboss.org/message/525579#525579
Author : Ales Justin
Profile : http://community.jboss.org/people/alesj
Message:
--------------------------------------------------------------
> To follow up to my last post, I would like to attempt a somewhat controlled an order migration. Is it possible to go one at a time, or do the MC projects have to go all at once?
No, not all at once, but in dependency order.
e.g. VFS -> CL - > Deployers -> OSGi ... others probably all go after Deployers as well
We will need a proper release of them all, at least of the dependecies -- leaves don't need to be tagged/released.
(it's mostly gonna be 2.2.0.Beta1)
Let's now settle on a date, which will be the deadline after which all trunk work for all involved projects must halt for a while.
I suggest 16th Feb, as it gives us enough time to finish whatever we have, and it's not on the first day of the week.
Once we agree, I'll send an announcement on the needed mls. OK?
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525579#525579
14 years, 7 months
[Tomcat Integration Development] New message: "Re: Deployment of on-demand web applications"
by Brian Stansberry
JBoss development,
A new message was posted in the thread "Deployment of on-demand web applications":
http://community.jboss.org/message/525556#525556
Author : Brian Stansberry
Profile : http://community.jboss.org/people/bstansberry@jboss.com
Message:
--------------------------------------------------------------
Running in a debugger confirms that the HDScanner is treating each file inside the war as a new deployment. This doesn't happen with -Djboss.as.deployment.ondemand=true because there's a bug in the way profiles are configured for HD scanning. It only gets turned on via this bit in ProfileServiceBootstrap.start(...)
// Enable modification checks on all mutable profiles
for(ProfileKey key : profileService.getActiveProfileKeys())
{
try
{
Profile profile = profileService.getActiveProfile(key);
if(profile.isMutable() && profile instanceof MutableProfile)
{
((MutableProfile) profile).enableModifiedDeploymentChecks(true);
}
}
catch(NoSuchProfileException ignore) { }
With -Djboss.as.deployment.ondemand=true when that code executes, the profiles for the on-demand wars are not yet "active" so the enableModifiedDeploymentChecks(true) call is never made. With -Djboss.as.deployment.ondemand=false the profile is active and the profile is exposed to the HDScanner.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525556#525556
14 years, 7 months