@@ -1403,16 +1403,16 @@ In many cases, you do this binding anyway (as in the preceding example).
1403
1403
1404
1404
What happens when multiple pieces of advice all want to run at the same join point?
1405
1405
Spring AOP follows the same precedence rules as AspectJ to determine the order of advice
1406
- execution. The highest precedence advice runs first "` on the way in` " (so, given two pieces
1407
- of before advice, the one with highest precedence runs first). "` On the way out` " from a
1406
+ execution. The highest precedence advice runs first "on the way in" (so, given two pieces
1407
+ of before advice, the one with highest precedence runs first). "On the way out" from a
1408
1408
join point, the highest precedence advice runs last (so, given two pieces of after
1409
1409
advice, the one with the highest precedence will run second).
1410
1410
1411
1411
When two pieces of advice defined in different aspects both need to run at the same
1412
1412
join point, unless you specify otherwise, the order of execution is undefined. You can
1413
1413
control the order of execution by specifying precedence. This is done in the normal
1414
1414
Spring way by either implementing the `org.springframework.core.Ordered` interface in
1415
- the aspect class or annotating it with the `Order` annotation. Given two aspects, the
1415
+ the aspect class or annotating it with the `@ Order` annotation. Given two aspects, the
1416
1416
aspect returning the lower value from `Ordered.getValue()` (or the annotation value) has
1417
1417
the higher precedence.
1418
1418
@@ -1643,9 +1643,9 @@ expression so that only `@Idempotent` operations match, as follows:
1643
1643
== Schema-based AOP Support
1644
1644
1645
1645
If you prefer an XML-based format, Spring also offers support for defining aspects
1646
- using the new `aop` namespace tags. The exact same pointcut expressions and advice kinds
1646
+ using the `aop` namespace tags. The exact same pointcut expressions and advice kinds
1647
1647
as when using the @AspectJ style are supported. Hence, in this section we focus on
1648
- the new syntax and refer the reader to the discussion in the previous section
1648
+ that syntax and refer the reader to the discussion in the previous section
1649
1649
(<<aop-ataspectj>>) for an understanding of writing pointcut expressions and the binding
1650
1650
of advice parameters.
1651
1651
@@ -1675,7 +1675,7 @@ When you use the schema support, an aspect is a regular Java object defined as a
1675
1675
your Spring application context. The state and behavior are captured in the fields and
1676
1676
methods of the object, and the pointcut and advice information are captured in the XML.
1677
1677
1678
- You can declare an aspect by using the <aop:aspect> element, and reference the backing bean
1678
+ You can declare an aspect by using the ` <aop:aspect>` element, and reference the backing bean
1679
1679
by using the `ref` attribute, as the following example shows:
1680
1680
1681
1681
====
@@ -1801,9 +1801,10 @@ parameters of the matching names, as follows:
1801
1801
----
1802
1802
====
1803
1803
1804
- When combining pointcut sub-expressions, `&&` is awkward within an XML document, so
1805
- you can use the `and`, `or`, and `not` keywords in place of `&&`, `||`, and `!`,
1806
- respectively. For example, the previous pointcut can be better written as follows:
1804
+ When combining pointcut sub-expressions, `+&&+` is awkward within an XML
1805
+ document, so you can use the `and`, `or`, and `not` keywords in place of `+&&+`,
1806
+ `||`, and `!`, respectively. For example, the previous pointcut can be better written as
1807
+ follows:
1807
1808
1808
1809
====
1809
1810
[source,xml,indent=0]
@@ -1913,8 +1914,8 @@ shows how to declare it:
1913
1914
----
1914
1915
====
1915
1916
1916
- As in the @AspectJ style, you can get the return value within the
1917
- advice body. To do so, use the returning attribute to specify the name of the parameter to which
1917
+ As in the @AspectJ style, you can get the return value within the advice body.
1918
+ To do so, use the ` returning` attribute to specify the name of the parameter to which
1918
1919
the return value should be passed, as the following example shows:
1919
1920
1920
1921
====
@@ -1951,7 +1952,7 @@ example, you can declare the method signature as follows:
1951
1952
==== After Throwing Advice
1952
1953
1953
1954
After throwing advice executes when a matched method execution exits by throwing an
1954
- exception. It is declared inside an `<aop:aspect>` by using the after-throwing element,
1955
+ exception. It is declared inside an `<aop:aspect>` by using the ` after-throwing` element,
1955
1956
as the following example shows:
1956
1957
1957
1958
====
@@ -1970,8 +1971,8 @@ as the following example shows:
1970
1971
----
1971
1972
====
1972
1973
1973
- As in the @AspectJ style, you can get the thrown exception within
1974
- the advice body. To do so, use the throwing attribute to specify the name of the parameter to
1974
+ As in the @AspectJ style, you can get the thrown exception within the advice body.
1975
+ To do so, use the ` throwing` attribute to specify the name of the parameter to
1975
1976
which the exception should be passed as the following example shows:
1976
1977
1977
1978
====
@@ -2030,7 +2031,7 @@ by using the `after` element, as the following example shows:
2030
2031
[[aop-schema-advice-around]]
2031
2032
==== Around Advice
2032
2033
2033
- The last kind of advice is around advice. Around advice runs "` around` " a matched method
2034
+ The last kind of advice is around advice. Around advice runs "around" a matched method
2034
2035
execution. It has the opportunity to do work both before and after the method executes
2035
2036
and to determine when, how, and even if the method actually gets to execute at all.
2036
2037
Around advice is often used to share state before and after a method
@@ -2233,10 +2234,11 @@ ms % Task name
2233
2234
[[aop-ordering]]
2234
2235
==== Advice Ordering
2235
2236
2236
- When multiple advice needs to execute at the same join point (executing method) the
2237
- ordering rules are as described in <<aop-ataspectj-advice-ordering>>. The precedence
2238
- between aspects is determined by either adding the `Order` annotation to the bean
2239
- that backs the aspect or by having the bean implement the `Ordered` interface.
2237
+ When multiple pieces of advice need to execute at the same join point (executing method)
2238
+ the ordering rules are as described in <<aop-ataspectj-advice-ordering>>. The precedence
2239
+ between aspects is determined via the `order` attribute in the `<aop:aspect>` element or
2240
+ by either adding the `@Order` annotation to the bean that backs the aspect or by having
2241
+ the bean implement the `Ordered` interface.
2240
2242
2241
2243
2242
2244
@@ -2781,7 +2783,7 @@ following example shows:
2781
2783
2782
2784
public static void main(String[] args) {
2783
2785
ProxyFactory factory = new ProxyFactory(new SimplePojo());
2784
- factory.adddInterface (Pojo.class);
2786
+ factory.addInterface (Pojo.class);
2785
2787
factory.addAdvice(new RetryAdvice());
2786
2788
factory.setExposeProxy(true);
2787
2789
@@ -3472,7 +3474,7 @@ for AspectJ LTW:
3472
3474
* `spring-aop.jar`
3473
3475
* `aspectjweaver.jar`
3474
3476
3475
- If you use the <<aop-aj-ltw-environment -generic, Spring-provided agent to enable
3477
+ If you use the <<aop-aj-ltw-environments -generic, Spring-provided agent to enable
3476
3478
instrumentation>>, you also need:
3477
3479
3478
3480
* `spring-instrument.jar`
0 commit comments