Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368046 - configure a set of classloader for which weavers should not be created in an LTW scenario
Summary: configure a set of classloader for which weavers should not be created in an ...
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: LTWeaving (show other bugs)
Version: 1.7.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 critical (vote)
Target Milestone: 1.7.4   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-06 12:05 EST by Andrew Clement CLA
Modified: 2013-07-30 10:55 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2012-01-06 12:05:35 EST
Prototyped and tested for JspClassLoaders (see the thread 'aspectj and jsp load' on the mailing list).

That was done through a system property but it would be easier via aop.xml.  However, this would be the first time we have an aop.xml setting that affects global operation of loadtime weaving.  When any classloader actually got far enough to load the aop.xmls it would discover this setting and from that point on it would be set.  In our JspClassLoader case this would mean that either some non-JspClassLoader is run early enough to discover this setting and turn it off for all JspClassLoaders or the first JspClassLoader will discover the setting and turn it off for all other JspClassLoaders.  I think we can live with that mode of operation.
Comment 1 Andrew Clement CLA 2013-06-24 11:03:48 EDT
unsetting the target field which is currently set for something already released
Comment 2 Andrew Clement CLA 2013-07-30 10:55:32 EDT
Pushed this into the 1.7 branch (so will be in the 1.7.4 release).

Two config mechanics:

1) System property, comma separated list of classnames:

aj.weaving.loadersToSkip=com.foo.MyLoader,com.bar.SomeOtherLoader

2) aop.xml, in the options value:

-loadersToSkip:com.foo.MyLoader,com.bar.SomeOtherLoader


The former has had more testing than the latter. If anyone tries this out let me know if the 2nd option is behaving.  As the aop.xml files are read *after* the weaver is initialized it is possible that (currently) the first loader of the type will get through, and only subsequent ones will not get a weaver. In a situation where you want to exclude 5000 Jsp loaders, if just 1 gets through that doesn't feel like a big deal, but this loophole should be closed later.