Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] How to use load time weaving?


Hi everyone,

I'm developing an application which will use load time weaving feature, so that I can control whether my App classes should be weaved at runtime.
I read http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html, learned AspectJ comes with the WeavingURLClassLoader probably can help me.
but there's no concrete example I can take a look, so could someone please tell me how to use WeavingURLClassLoader? I have checked the source code,  there's 2
constructors available,

(1)public WeavingURLClassLoader (ClassLoader parent)

(2)
public WeavingURLClassLoader (URL[] classURLsURL[] aspectURLsClassLoader parent)

Which one I should use? Could you please explain the meaning for the parameters in detail?
Do I still need to use  <
iajc> to compile my aspect source code, and  buit them into  a jar file, and pass the jar file URL to the constructor as the second parameter?
or only package the source code as jar file, and WeavingURLClassLoader will do all for me?

Thanks


--
anfernee

Back to the top