File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Spring AOP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring AOP" Watch "Spring AOP" New topic
Author

Spring AOP

Amitt Thakkarr
Greenhorn

Joined: Apr 25, 2011
Posts: 7
Hi,

some one asked me one question "In Spring AOP we give the configuration for jointpoint (expressions for method matching): so the question was how Spring container knows that the Methods are getting called"

Thank,
Amit
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

Amitt Thakkarr wrote:Hi,

some one asked me one question "In Spring AOP we give the configuration for jointpoint (expressions for method matching): so the question was how Spring container knows that the Methods are getting called"

Thank,
Amit


It doesn't need to know that the method is called. It is in the initialization phase/BeanPostProcessors that are looking at the pointcut expression and when if finds matches, it creates a Dynamic Proxy around that object, so the client gets the proxy and calls the method on the proxy. So the proxy has the advice code with it, as well as the real object.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring AOP