[aosd-discuss] exceptions thrown from advice

Florin-Alexandru Bratu fl.bratu at gmail.com
Mon Apr 7 05:20:04 EDT 2008


Hello everyone!

This is more of a general question regarding AOP. If I have defined an 
advice that throws an exception, where is that exception handled?

For instance: say that I have a method:

class S{
public void something() {
   // something
}
}

and that I have an advice that triggers whenever the method starts 
executing. The advice is

class Advice {
public void  doOnSomething() throws  SomeException  {
       throw new SomeException();
}
}

(suppose the advice is properly configured)

Now; if I do something like this:

class Main {
   public void other()
         // is this necessary?
        // throws SomeException
   {
          new S().something();
   }
}


My question is: The call new S().something(); triggers an exception in 
the method other() ?

Thank you,
Florin



More information about the discuss mailing list