[aosd-discuss] "Around" advice

Pascal Costanza pc at p-cos.net
Wed May 23 15:34:30 EDT 2007


On 23 May 2007, at 20:59, Eric Bodden wrote:

> The point it that unlike in a real continuation no state is being
> stored. As you can see, proceed() here has no arguments, so all that
> proceed does is call basically call the original code *location*. Even
> if proceed(..) had arguments, those would be *explicit* in the code.

Ah - especially, it doesn't store the execution context: After a  
return from proceed(), nothing special happens anymore. That's the  
part I missed...


Pascal

>
> Eric
>
> On 23/05/07, Pascal Costanza <pc at p-cos.net> wrote:
>>
>> On 23 May 2007, at 15:52, Eric Bodden wrote:
>>
>> > On 23/05/07, vamsidhar sharma <bvamsidhar at yahoo.com> wrote:
>> >> I found examples where the return value is being modified before
>> >> sending it or pointcut excution is made conditional. Didn't find
>> >> anything more real than these.
>> >
>> > Another way to us around-advice is to generate a closure that  
>> kind of
>> > holds the continuation of the execution and can then be invoked  
>> later
>> > on (see Laddad's book "AOP in action"):
>> >
>> > Object around(): pc()  {
>> >   runnables.add(new Runnable() {
>> >     public void run() {
>> >       return proceed();
>> >     }
>> >   });
>> >   return null;
>> > }
>> >
>> > I have used this technique in a similar way to implement a fault
>> > tolerance layer.
>>
>> This indeed smells like a full continuation, but I can't imagine how
>> this would work in a JVM. What am I missing?
>>
>>
>> Pascal
>>
>> --
>> Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
>> Vrije Universiteit Brussel, Programming Technology Lab
>> Pleinlaan 2, B-1050 Brussel, Belgium
>>
>>
>>
>>
>>
>
>
> -- 
> Eric Bodden
> Sable Research Group
> McGill University, Montréal, Canada

-- 
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium







More information about the discuss mailing list