Re: [abc-dev] Custom context exposure

From: Eric Bodden <>
Date: Wed, 16 Apr 2008 22:30:09 -0400

Dear Rodolfo,

I will attempt to answer your question, however I still have trouble
understanding what the problem is.

> This is an example of this pointcut:
> aspect XYZ{
> double around(double x) : customPointcut(x){
> ...
> }
> }

So does this pointcut use x or does it bind x? I am confused. From
this code I would assume that it binds x, just as this/target/args.

> The code above should generate something like:
> double d;
> if(someCondition){
> XYZ.aspectOf();
> d = XYZ.inline$0$around$0(customParameter);
> }
> else{
> ...
> }

Where does someCondition come from? Furthermore, what's
customParameter? Where does this value come from? And am I right that
d is actually x from above?

> Right now, I've implemented the conditional part of the pointcut. But I
> can't get the customParameter generation to work (customParameter can be a
> method invocation, so it is not already available as a local var).

I still don't understand. What's customParameter? Can you give a 100%
concrete example please?

> I have
> the following classes:
> CustomPC_c (extends Pointcut_c)
> --> CustomPCCondition (this works OK, including its residue)
> --> CustomPCArgs
> Instances of CustomPCCondition and CustomPCArgs are returned as a
> conjunction using AndPointcut.construct by CustomPC_c.makeAIPointcut.

I am not sure whether you need this. I think actually you want one
single CustomPointcut class and just generate a special residue for
it. (The residue itself can be constructed hierarchically, using
AndResidue etc.).

> At this moment, I'm having problems trying to implement the matchesAt
> method in CustomPCArgs as I don't really know how to implement the Residue
> class I have to return.

You should first make up your mind about:

1.) what to test on
2.) which advice variables should be bound to which values

The rest is then relatively easy, as one can just combine IfResidues
and Bind residues to achieve both, test and binding.

> I realize that it might be difficult to discover the problem from my
> description, but maybe I'm doing something obviously wrong. So, any help is
> really appreciated.

Please send some more concrete example then we should be able to help you out.


Eric Bodden
Sable Research Group
McGill University, Montréal, Canada
Received on Thu Apr 17 2008 - 03:30:14 BST

This archive was generated by hypermail 2.2.0 : Thu Apr 17 2008 - 04:40:14 BST