[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] change pointcut expression before weaving
|
- From: "Andy Clement" <andrew.clement@xxxxxxxxx>
- Date: Mon, 21 Jul 2008 14:59:46 -0700
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=HOS/1BxKfYRD/Wzw7lQabKcCp/1nQmnD7GTfFGq5F8E=; b=Yz29IOAmY3dayultG5HI6G2S2+RZpseMHfLJSTC+l3T9gl8QOBfIEcy/P25RySmYco x/rQDmN1PH4VP9L/JRIuYI9b/7QOGPoyC6DFn29SXjYKFYR0cTJ+KnsvNmKMNiZnh3aq Fkb0TVn4zuKagIJ0o8gFEeiHhY5FOZy7d53nk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Qw95kz7o4qQgEPIMlLCnZ8vUtW703jRzkhO2+v3PhsNPMQyW9G42ctHsQ9FlGU5g0c Gvoh0mKzjfhoWudSz3Y3yCDuiZO1FSXiD2sF00vQ+UNLKd5u8yrJeh8IM9uH7rQzCLqE 6JQ7LYHB1xug7gRYNDZEh3bKImFSO6a8x2JTE=
You could define an abstract aspect with an abstract pointcut that is
attached to all your existing pointcuts:
abstract aspect Foo {
abstract pointcut fillInLater();
before(): something() && fillInLater() {
}
}
And then create the aop.xml as late as possible, just before the
weaver is invoked ( that defines the concrete sub-aspect, and the
definition of fillInLater()) - i think some people have done this in
the past. I also think there is a way to supply your own
IWeavingContext that skips the need to write out aop.xml and have the
weaver read it in again by making an implementation that returns the
elements that would have been in the xml.
Or given that if() is used to call static code, can you not build in a
call to something like if(MyClass.testMethod()) into all your existing
pointcuts and then make that testMethod() do whatever conditional test
you want to perform to influence the matching?
There is currently no general way to change the pointcuts post compile
and before weaving.
Andy.
2008/7/21 G <gsoel@xxxxxxx>:
> Hi,
>
> i am trying to modify an already compiled aspect before doing ltw.
> I want to modify all the pointcuts within the aspect and add an
> if-evaluation.
>
> Is this possible with aspectj?
>
> Kind regards,
>
> Marc
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>