Hi Andrew,
If you can create your own classloader
within the server, you could enable load-time weaving for that. For example,
AspectJ load-time weaving includes org.aspectj.weaver.loadtime.WeavingURLClassLoader,
which you should be able to configure for your web app.
To integrate a custom loader like this for
a Web app you’d want to write a small piece of bootstrap logic that would
load most of your application functionality from your own loader, rather than
the normal Web application class loader. E.g., you might have your servlets forward
requests to a class using Class.forName(“helperClass”, false, weavingLoader).
However, this would only weave classes loaded through this loader (i.e., only
for your application). This wouldn’t work for JSP’s either unless
you precompiled them, since you can’t configure how they get loaded
(though again they could dispatch to classes that are woven).
If you get this working, I’d be
interested to hear about it.
Ron
From:
aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andrew Ochsner
Sent: Friday, September 15, 2006
12:33 PM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] LTW
without need for javaagent
Hi:
Here's my scenario:
I'm running in a shared JBoss environment so I can't change the JVM command
line arguments to include a javaagent.
Is there any other way I could possibly enable LTW that anyone could possibly
think of? Using Spring maybe?
I know this might be a very specific JBoss question, but any ideas would be
appreciated.
Thanks
Andy O