posted 10 years ago
Hello All,
I'm trying to learn Spring and its support for AOP, using Spring AOP features. I'm using Spring 3.2.3, aspectj 1.7.2 and have all the dependencies properly made available.
configuration file
ControllerLoggingAspect.java
as you see, I defined various advices for all the methods of Controller class
Controller.java
All the methods in Controller.java are public and I enabled proxy to the class using cglib.
My expectation is, the advices should be invoked (before, after, around, after returning) for each method call beginning from MethodA,MethodB,MethodC in sequence
However, when I ran the output I see is as follows
Why am I not able to see @Around or any other advice for the whole method call stack, why just MethodA. Does these advices get invoked only for the first method call, not the nested. What should I need to do to enable that.
I understand that basic support of AOP and AspectJ by Spring does not include advices around private methods to be invoked and I read that it requires aspectJ programming instead. Is that true for even the public nested method calls.
Since I used Controller.*(..), I thought all the public methods are covered. Please help me understand this.
Thanks