From 48e7c44c35a405cead74cd2193848f6f3f4af794 Mon Sep 17 00:00:00 2001 From: Thomas Risberg Date: Tue, 9 Jun 2009 23:28:54 +0000 Subject: [PATCH] changed section ids so they don't clash with aop-spring.xml --- .../src/classic-aop-spring.xml | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/spring-framework-reference/src/classic-aop-spring.xml b/spring-framework-reference/src/classic-aop-spring.xml index e20cf2e9116..cd33f0c0ab9 100644 --- a/spring-framework-reference/src/classic-aop-spring.xml +++ b/spring-framework-reference/src/classic-aop-spring.xml @@ -3,7 +3,7 @@ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> Classic Spring AOP Usage -
+
In this chapter we discuss the lower-level Spring AOP APIs and the AOP support used in Spring 1.2 applications. For new applications, we recommend the use of the Spring 2.0 AOP support @@ -15,12 +15,12 @@
-
+
Pointcut API in Spring Let's look at how Spring handles the crucial pointcut concept. -
+
Concepts Spring's pointcut model enables pointcut reuse independent of @@ -88,7 +88,7 @@
-
+
Operations on pointcuts Spring supports operations on pointcuts: notably, @@ -115,7 +115,7 @@
-
+
AspectJ expression pointcuts Since 2.0, the most important type of pointcut used by Spring is @@ -128,14 +128,14 @@
-
+
Convenience pointcut implementations Spring provides several convenient pointcut implementations. Some can be used out of the box; others are intended to be subclassed in application-specific pointcuts. -
+
Static pointcuts Static pointcuts are based on method and target class, and @@ -148,7 +148,7 @@ Let's consider some static pointcut implementations included with Spring. -
+
Regular expression pointcuts One obvious way to specify static pointcuts is regular @@ -204,7 +204,7 @@ with any Advice type.
-
+
Attribute-driven pointcuts An important type of static pointcut is a @@ -213,7 +213,7 @@
-
+
Dynamic pointcuts Dynamic pointcuts are costlier to evaluate than static @@ -225,7 +225,7 @@ The main example is the control flow pointcut. -
+
Control flow pointcuts Spring control flow pointcuts are conceptually similar to @@ -247,7 +247,7 @@
-
+
Pointcut superclasses Spring provides useful pointcut superclasses to help you to @@ -269,7 +269,7 @@ RC2 and above.
-
+
Custom pointcuts Because pointcuts in Spring AOP are Java classes, rather than @@ -286,12 +286,12 @@
-
+
Advice API in Spring Let's now look at how Spring AOP handles advice. -
+
Advice lifecycles Each advice is a Spring bean. An advice instance can be shared across all @@ -313,14 +313,14 @@ the same AOP proxy.
-
+
Advice types in Spring Spring provides several advice types out of the box, and is extensible to support arbitrary advice types. Let us look at the basic concepts and standard advice types. -
+
Interception around advice The most fundamental advice type in Spring is @@ -373,7 +373,7 @@ pointcut interfaces.
-
+
Before advice A simpler advice type is a before @@ -424,7 +424,7 @@ Before advice can be used with any pointcut.
-
+
Throws advice Throws advice is invoked after @@ -492,7 +492,7 @@ Throws advice can be used with any pointcut.
-
+
After Returning advice An after returning advice in Spring must implement the @@ -533,7 +533,7 @@ After returning advice can be used with any pointcut.
-
+
Introduction advice Spring treats introduction advice as a special kind of interception advice. @@ -752,7 +752,7 @@ public interface IntroductionInfo {
-
+
Advisor API in Spring In Spring, an Advisor is an aspect that contains just a single advice @@ -771,7 +771,7 @@ public interface IntroductionInfo { automatically create the necessary interceptor chain.
-
+
Using the ProxyFactoryBean to create AOP proxies If you're using the Spring IoC container (an ApplicationContext or @@ -790,7 +790,7 @@ public interface IntroductionInfo { and their ordering. However, there are simpler options that are preferable if you don't need such control. -
+
Basics The ProxyFactoryBean, like other Spring @@ -813,7 +813,7 @@ public interface IntroductionInfo { pluggability provided by Dependency Injection.
-
+
JavaBean properties In common with most FactoryBean implementations @@ -931,7 +931,7 @@ public interface IntroductionInfo {
-
+
JDK- and CGLIB-based proxies This section serves as the definitive documentation on how the @@ -1005,7 +1005,7 @@ public interface IntroductionInfo {
-
+
Proxying interfaces @@ -1129,7 +1129,7 @@ public interface IntroductionInfo { example, in certain test scenarios.
-
+
Proxying classes What if you need to proxy a class, rather than one or more @@ -1176,7 +1176,7 @@ public interface IntroductionInfo { decisive consideration in this case.
-
+
Using 'global' advisors By appending an asterisk to an interceptor name, all advisors with @@ -1198,7 +1198,7 @@ public interface IntroductionInfo {
-
+
Concise proxy definitions Especially when defining transactional proxies, you may end up with @@ -1261,7 +1261,7 @@ public interface IntroductionInfo { it.
-
+
Creating AOP proxies programmatically with the ProxyFactory It's easy to create AOP proxies programmatically using Spring. This @@ -1298,7 +1298,7 @@ MyBusinessInterface tb = (MyBusinessInterface) factory.getProxy();
-
+
Manipulating advised objects However you create AOP proxies, you can manipulate them using the @@ -1392,7 +1392,7 @@ assertEquals("Added two advisors", advice modification is known not to be required.
-
+
Using the "autoproxy" facility So far we've considered explicit creation of AOP proxies using a @@ -1423,13 +1423,13 @@ assertEquals("Added two advisors", -
+
Autoproxy bean definitions The org.springframework.aop.framework.autoproxy package provides the following standard autoproxy creators. -
+
BeanNameAutoProxyCreator The BeanNameAutoProxyCreator class is a @@ -1465,7 +1465,7 @@ assertEquals("Added two advisors", differently to different beans.
-
+
DefaultAdvisorAutoProxyCreator A more general and extremely powerful auto proxy creator is @@ -1544,7 +1544,7 @@ assertEquals("Added two advisors", configurable order value; the default setting is unordered.
-
+
AbstractAdvisorAutoProxyCreator This is the superclass of DefaultAdvisorAutoProxyCreator. You @@ -1555,7 +1555,7 @@ assertEquals("Added two advisors",
-
+
Using metadata-driven auto-proxying A particularly important type of autoproxying is driven by @@ -1703,7 +1703,7 @@ assertEquals("Added two advisors",
-
+
Using TargetSources Spring offers the concept of a TargetSource, @@ -1732,7 +1732,7 @@ assertEquals("Added two advisors", Spring to create a new target instance when required. -
+
Hot swappable target sources The @@ -1773,7 +1773,7 @@ Object oldTarget = swapper.swap(newTarget); with arbitrary advice.
-
+
Pooling target sources Using a pooling target source provides a similar programming model @@ -1857,7 +1857,7 @@ System.out.println("Max pool size is " + conf.getMaxSize());]]> set the TargetSources used by any autoproxy creator.
-
+
Prototype target sources Setting up a "prototype" target source is similar to a pooling @@ -1881,7 +1881,7 @@ System.out.println("Max pool size is " + conf.getMaxSize());]]> must be a prototype bean definition.
-
+
<classname>ThreadLocal</classname> target sources ThreadLocal target sources are useful if you need an object to be @@ -1912,7 +1912,7 @@ System.out.println("Max pool size is " + conf.getMaxSize());]]>
-
+
Defining new <interfacename>Advice</interfacename> types Spring AOP is designed to be extensible. While the interception @@ -1931,7 +1931,7 @@ System.out.println("Max pool size is " + conf.getMaxSize());]]> Javadocs for further information.
-
+
Further resources Please refer to the Spring sample applications for further examples