Advanced use of pointcuts: This chapter finishes discussing pointcutting by looking at both ComposablePointcut and ControlFlowPointcut. This section also summarizes the whole pointcut discussion and looks at the appropriate techniques you should employ when you are using pointcuts in your application.
Introductions: Mentioned briefly in the previous chapter, introductions allow you to add interface implementations dynamically to any object on the fly using the familiar interceptor concept.
AOP framework services: We skipped over this topic completely in the previous chapter and focused solely on assembling AOP proxies and advice chains manually. However, in true Spring fashion, the framework fully supports configuring AOP transparently and declaratively. In this section, we look at three ways (the ProxyFactoryBean class, the aop namespace, and @AspectJ-style annotations) to inject declaratively defined AOP proxies into your application objects as collaborators, thus making your application completely unaware that it is working with advised objects.
Integrating AspectJ: AspectJ is a fully featured AOP implementation. The main difference between AspectJ and Spring AOP is that AspectJ applies advice to target objects via weaving (either compile-time or load-time weaving), while as discussed in the previous chapter, Spring AOP is based on a proxy. The feature set of AspectJ is much greater than that of Spring AOP, but it is much more complicated to use than Spring. AspectJ is a good solution when you find that Spring AOP lacks a feature you need. Starting from version 2.0, you can take full advantage of Spring features when configuring your AspectJ aspects.
KeywordsPrevious Chapter Framework Service Class Package Public Class Advice Class
Unable to display preview. Download preview PDF.