[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[aspectj-users] Exposing context in a Pointcut
|
- From: Matt Morten <djcredo@xxxxxxxxx>
- Date: Sun, 2 Oct 2005 13:43:11 +0100
- Delivered-to: aspectj-users@eclipse.org
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=W0ZDWEaJeYMxu0Vmy7gX7LJNOqNfmEZGCQXTCmuCwRQuqH0GyDm6gJHeikPS16BoWTvcFvhiGmY3oaR5Kfs6G6AJQHdwX+i8vRj79aKqiN6e4Y06aj4m00uvEiBqk38JNKpZ/aqeeV4K8J1Q/jPxlQxkCgzfqpFW2RKy4mLitnc=
Hello there,
I have several questions. Firstly, I would like a pointcut to expose a
reference to the currently-executing object, so that I can call
"wait()" on that object in my advice (think along the lines of
Breakpoints). However, suppose I don't necessarily wish to use this
variable in the pointcut definition (in this(), target(), or args()),
but only in the advice itself. Is there any way of doing this, without
getting a "[error] formal unbound in pointcut
pointcut" error?
Secondly, I would like to have my aspect do something straight away
(unconditionaly) when it runs, so I chose to do this:
static {
... blah
}
However, by doing it this way, I don't have access to any context.
Thus, I am forced to create a pointcut that references the joinpoint
where my "public static void main()" runs, in order to get that class.
Am i stuck to doing it this way?
My third question is this: are there / will there ever be Joinpoints
for getting / setting local variables? At the moment, I am limited to
only class fields, which is a bit of a limiting factor when I want to
"Watch" all variables in my program.
Thanks in advance,
Matt Morten