This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

After Advice not working

 
Sagar Shroff
Ranch Hand
Posts: 209
Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers ,
I am trying a small example of After advice. I am having following class


I have following spring configuration :


And when i invoke hello() , the after advice method i.e bye() does not get invoked. Can someone please help me where exactly have i made mistake as this is very basic and as i have just started with spring.

Regards,
Shroff.
 
Sagar Shroff
Ranch Hand
Posts: 209
Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will be really helpful to me if someone can help me understand why my advice method is not getting called.

Regards,
Shroff.
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are going to use Spring interface based proxying for your AOP then you need to code to interfaces, and invoke the aspect through the interface for the proxy to be there and your advice to be executed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic