Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Restricting LTW to a ClassLoader

The AspectJ documentation seems to indicate that you can restrict
weaving to a particular ClassLoader, instead of specifying a javaagent
at runtime. I'm using LTW to weave into Groovy scripts, which are
loaded from a GroovyClassLoader. I tried the obvious:

GroovyClassLoader loader = new GroovyClassLoader(new
WeavingURLClassLoader(this.getClass().getClassLoader()));
Class<? extends Runnable> groovy_class = loader.parseClass(new
File("bundle/GroovyPoint.groovy"));

But it didn't do anything. Is there another way to tie a weaving
classloader into an existing class loader, so that all loaded classes
are weaved at runtime? Preferably without the need to set a global
javaagent.

Thanks!

Norman


Back to the top