[aosd-discuss] "Around" advice

Eric Bodden eric.bodden at mail.mcgill.ca
Wed May 23 09:52:02 EDT 2007


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.

Eric

-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada



More information about the discuss mailing list