Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

CHAPTER 6: Introducing Spring AOP > Understanding Proxies

Understanding Proxies

So far, we have taken only a cursory look at the proxies generated by ProxyFactory. We mentioned that two types of proxy are available in Spring: JDK proxies created using the JDK Proxy class and CGLIB-based proxies created using the CGLIB Enhancer class. You may be wondering exactly what the difference between the two proxies is and why Spring needs two different types of proxy. In this section, we take a detailed look at the differences between the proxies.

The core goal of a proxy is to intercept Method Invocations and, where necessary, execute chains of advice that apply to a particular method. The management and invocation of advice is largely proxy independent and is managed by the Spring AOP framework. However, the proxy is responsible for intercepting calls to all methods and passing them as necessary to the AOP framework for the advice to be applied.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial