-
1. Re: after advice
kabirkhan May 19, 2004 9:39 AM (in response to kado0002)Don't know if I have understod correctly, but your advice is responsible for propogating the call itself (i.e. invocation.invokeNext()). Stuff you do before the call to invocation.invokeNext() is done before the method is called, stuff after is doen after the method is called.
Apologies if I am just throwing spanners in the work! -
2. Re: after advice
bill.burke May 19, 2004 10:03 AM (in response to kado0002)Yes, Kabir is correct. JBoss AOP has no before/after/after returning/after throws, etc...
These can all be handled implicitly with an around advice.
This was done on purpose to simplify the model. There is no performance benefit of having before/after. Also, IMO, it is more intuitive to have an around advice because it makes you more aware of the flow of the application and that you are part of the flow of an application.
So the solution is to have an advice:public class MyAspect { public Object myAdvice(Invocation invocation) throws Throwable { Object rtn = invocation.invokeNext(); // DO AFTER STUFF HERE return rtn; } }
See? Feedback? Maybe I'm missing something.