This content has been marked as final.
Show 2 replies
-
1. Re: How AOP can help
nthx Aug 24, 2005 4:48 PM (in response to sharman)My $0.02.
If you want to soften checked exceptions then I will not help - I doubt if that's possible.
If you want to catch all runtime exceptions at some places, then there is nothing simpler:
1) specify pointcuts - places where you suspect (know) some exceptions might occur
1a) you can do it in several ways - the most standard approach is by using 'execution' pointcuts in jboss-aop.xml
1b) you might consider to do it via @annotations if that's reasonable
2) write an aspect and advice within it that does the logic you need:public MyExceptionHandler { public void myAdvice(Invocation invocation) { try { return invocation.invokeNext(); } catch (MyException or Exception) { //do something... } return null (or something else); } }
3) that's all
Any more questions.. just ask
Best regards,
Tomasz Nazar -
2. Re: How AOP can help
bill.burke Aug 24, 2005 5:07 PM (in response to sharman)I always thought softening checked exceptions in AspectJ was a really bad idea...Just my opinion though.