[jboss-user] [JBoss AOP] - Re: Using jboss AOP to handle try-catch

flavia.rainone@jboss.com do-not-reply at jboss.com
Thu May 29 15:09:17 EDT 2008


Hi!

There are plans to implement this feature in a future version of JBoss AOP. 

However, the current way of doing this today is to write an around advice and catch the exception from it:

  | public Object handlerAdvice(Invocation invocation) throws Throwable
  | {
  |    try
  |    {
  |       invocation.invokeNext();
  |    } catch(YourException e)
  |    {
  |    // handle exception
  |    }
  | }
  | 

By applying this advice to all your public methods, you will end up with a single try-catch algorithm being applied to all those methods.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154439#4154439

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4154439



More information about the jboss-user mailing list