One additional caveat. If you are running
an app server rather than a simple Java application, you will probably need to
have VM or app-server agent support for weaving. You can follow the directions
from Alex Vasseur’s blog entry (http://blogs.codehaus.org/people/avasseur/archives/001140_aspectj_5_load_time_weaving_with_java_13_using_aspectwerkz.html)
to create support for load-time weaving on an older VM (or try using JRockIt,
which has supported it since 1.3). If you are running on WebSphere I wrote a
ClassLoader plugin to do load-time weaving for it, and it’s possible to
do the same for Weblogic and oc4j (though I don’t think there are any plugins
for either available for AspectJ 1.5)
From:
aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ron Bodkin
Sent: Friday, April 07, 2006 2:41
PM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] Load
Time Weaving info?
Hi Wim,
Adrian wrote a nice blog entry that includes a description of how to set
up IntelliJ for LTW: http://www.aspectprogrammer.org/blogs/adrian/2006/02/a_practical_gui_2.html.
I also discussed the topic it in a recent article “Next steps with
aspects” http://www-128.ibm.com/developerworks/java/library/j-aopwork16/#N10183
If you are new to AspectJ load-time
weaving, you should take a look at the developer environment guide for the
basics of configuration: http://www.eclipse.org/aspectj/doc/released/devguide/ltw.html
What version of Java are you using? If you
are using 1.5 it’s quite easy, just use the –javaagent flag to your
VM. If you are using Java 1.4, you might want to use a system ClassLoader I
created to make it easy to launch IntelliJ projects with load-time weaving. See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=121700
to download a jar file that contains it. Typically what we’ve been doing
is to use ant to build the aspects and then include them in the classpath of
the project. This system ClassLoader then finds any META-INF/aop.xml file in
resources on the classpath (jars, exploded directories, etc.) and weaves the
defined aspects into them.
If your aspects are unpluggable (i.e., you
can remove them without affecting anything else in the system), you can include
or exclude them by editing the aop.xml file or by having another one (e.g., in
a classes folder) that includes/excludes aspects.
From:
aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Wim Deblauwe
Sent: Friday, April 07, 2006 3:18
AM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] Load Time
Weaving info?
Hi,
I just started on AspectJ and I'm looking for info on LTW. More specific, on
info for doing this scenario:
At my company, we use IntelliJ (which has no aspectJ support currently) and we want
to keep it that way. So, I would like to write some aspects in Eclipse (I am
now starting out with a logging aspect, what else? ;)) and then do LTW to
enable the aspects in our code.
I already managed to write a simple logging aspect and got it working in
Eclipse, but how do I go from there? I probably need to create a jar from the
aspect somehow? Then how do I enable the LTW? Is it easy to enable/disable
individual aspects? What needs to be on my classpath in IntelliJ then?
any help is highly appreciated!
regards,
Wim