[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] Why no if-poincut for non-static expressions.

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

About the if-pointcut the AJ manual says:

"if(BooleanExpression)- Picks out each join point where the boolean
expression evaluates to true. The boolean expression used can only
access static members, variables exposed by teh enclosing pointcut or
advice, and thisJoinPoint forms. In particular, it cannot call
non-static methods on the aspect."

My question is: Why do we have this limitation to static members? Why
should it not be possible to e.g. check some field value of the
current aspect instance? In particular I would like the following to
work:

aspect PushUntilPop pertarget(pushPop()){
...
	int state = 0;
	pointcut match(): set(* PushUntilPop.state) && if(state==2);
...
}

The purpose is some kind of finite state machine: If the state of the
aspect is set to 2, I want to "accept" and thus want a pointcut that
captures that. Since the machine observes a specific target, I need
to associate one aspect instance with each such target (pertarget)
and cannot use static members.

Probably somebody could clarify this to me...

Cheers,
Eric

- --
Eric Bodden
RWTH Aachen University
ICQ UIN: 12656220, Skype: ericbodden, PGP: BB465582
Website: http://www.bodden.de

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3

iQA/AwUBQRjzTswiFCm7RlWCEQLQ8gCgrPfhw7IKcB9cc8eLvWc93qVBtzgAni1/
6/of30vJXivLUuto5NNZpOVm
=zrne
-----END PGP SIGNATURE-----