Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: SV: [aspectj-users] Load Time Weaving of dynamic proxies

Specifically, you don't want to use "execution" pointcuts for these packages, because AJ has to insert advice in them for "execution". However, if you just care about advising your code that calls these methods, then you can use "call" pointcuts.

dean

On Jan 28, 2008, at 1:02 AM, <hermod.opstvedt@xxxxxxxxx> <hermod.opstvedt@xxxxxxxxx> wrote:

Hi

This also relates to the issue that AspectJ does not weave java.* and javax.* in current release. See mail-thred titled "Weid problem with javax.naming.InitialContext" for solution.

Hermod

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Sriram Gopal
Sent: Sunday, January 27, 2008 10:53 PM
To: hermod@xxxxxxxxxxxx; aspectj-users@xxxxxxxxxxx
Subject: Re: SV: [aspectj-users] Load Time Weaving of dynamic proxies


public aspect ProxyAspect {
before: execution(* java.lang.reflect.Proxy+.*(..)){
System.out.println("Before executing method in proxy");
}
}

(Also tried different variations like specifying the name of generated  
Proxy class explicitly, specifying InvocationHandler+ etc. instead of  
java.lang.reflect.Proxy+ )

I tried a couple of approaches for doing the LTW.

Approach 1:
1. Created a jar containing the compilation of the aspect files. 2. Set that in the ASPECTPATH env. variable and executed the application

Approach 2:
1. Created the aop.xml as below:
<aspectj>
<aspects>
<aspect name="ProxyAspect"/>
</aspects>
</aspectj>
   and set its path in the classpath variable
2. Executed the compiled files using "aj" with the -javaagent option.

However, both these approaches failed to work.


On Jan 27, 2008, at 4:33 PM, Hermod Opstvedt wrote:

Hi

Your aop.xml and pointcuts please

Hermod

-----Opprinnelig melding-----
Fra: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] På vegne av Sriram Gopal
Sendt: 27. januar 2008 22:31
Til: aspectj-users@xxxxxxxxxxx
Emne: [aspectj-users] Load Time Weaving of dynamic proxies

Please let me know if someone has tried to do Load Time Weaving
(LTW) of
dynamic proxies. I tried creating a .jar containing the .aj file and  
set its
path in the ASPECTPATH variable prior to running the application  
using the
"aj" script. Using this approach, I am able to do LTW of normal  
classes but
not a dynamic proxy. Let me know if I am doing something wrong.

Thanks,
Sriram
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/aspectj-users
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email.

This email message has been virus checked by the anti virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Dean Wampler, Ph.D.
dean at objectmentor.com
See also:
http://aquarium.rubyforge.org     AOP for Ruby
http://www.contract4j.org         Design by Contract for Java5




Back to the top