Using AOP at runtime without any source code changes

Discussions

General J2EE: Using AOP at runtime without any source code changes

  1. I played around with AspectJ but what I didn't like with AspectJ is that it modifies the Java language. What I'm looking for is a runtime AOP that will not change my code at all. For example, the reason I want to use AOP is that on our project I just learned that we need to measure the time for all remote calls (SOAP and RMI). The reason is the remote calls to go components developed by other companies, and if there are performance problems in production we need to be able to activate the measurement and logging to verify if the problem is with our components or the components we call. When I learned of this requirement, my first thought was to use AOP.

    However I don't want to force my developers (mostly new college grads) to learn new java syntax and keywords.. I'd like to do it at runtime, via configuration files, and have it be totally transparent to the application. Dynaop seemed to fit the bill until I got to the proxies, which require modifying the source code.

    My question is this: Is it even possible to add AOP at runtime without modifying the code to use proxies?

    Regards,
    Michael Mattox
  2. Check out this link: http://aspectwerkz.codehaus.org/
  3. Check out this link: http://aspectwerkz.codehaus.org/
    I already downloaded it and looked at it but I haven't found good documentation for it and it's not clear if it will do what I want (no changes to source code). Do you know if it works like this??

    Michael
  4. Check out this link: http://aspectwerkz.codehaus.org/
    I already downloaded it and looked at it but I haven't found good documentation for it and it's not clear if it will do what I want (no changes to source code). Do you know if it works like this??Michael
    You should read about Aspectwerz online mode (on the fly weaving)

    http://aspectwerkz.codehaus.org/online.html
  5. In the not-so-distant future, AOP frameworks will take
    advantage of the java.lang.instrument API and Java's new metadata capabilities.

    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/instrument/package-summary.html

    http://www.theserverside.com/common/printthread.tss?thread_id=24605#114586
  6. Since the aspectj and aspectwerkz have been merged, but the aspectj only supports load time weaving. Is there any paper/ tutorial/ example talking about how to do it (run time weaving) by using aspectj?