@@ -83,9 +83,9 @@ Spring AOP includes the following types of advice:
83
83
an exception).
84
84
* After returning advice: Advice to be run after a join point completes
85
85
normally (for example, if a method returns without throwing an exception).
86
- * After throwing advice: Advice to be executed if a method exits by throwing an
86
+ * After throwing advice: Advice to be run if a method exits by throwing an
87
87
exception.
88
- * After (finally) advice: Advice to be executed regardless of the means by which a
88
+ * After (finally) advice: Advice to be run regardless of the means by which a
89
89
join point exits (normal or exceptional return).
90
90
* Around advice: Advice that surrounds a join point such as a method invocation.
91
91
This is the most powerful kind of advice. Around advice can perform custom behavior
@@ -219,7 +219,7 @@ To use @AspectJ aspects in a Spring configuration, you need to enable Spring sup
219
219
configuring Spring AOP based on @AspectJ aspects and auto-proxying beans based on
220
220
whether or not they are advised by those aspects. By auto-proxying, we mean that, if Spring
221
221
determines that a bean is advised by one or more aspects, it automatically generates
222
- a proxy for that bean to intercept method invocations and ensures that advice is executed
222
+ a proxy for that bean to intercept method invocations and ensures that advice is run
223
223
as needed.
224
224
225
225
The @AspectJ support can be enabled with XML- or Java-style configuration. In either
@@ -334,7 +334,7 @@ hence, excludes it from auto-proxying.
334
334
=== Declaring a Pointcut
335
335
336
336
Pointcuts determine join points of interest and thus enable us to control
337
- when advice executes . Spring AOP only supports method execution join points for Spring
337
+ when advice runs . Spring AOP only supports method execution join points for Spring
338
338
beans, so you can think of a pointcut as matching the execution of methods on Spring
339
339
beans. A pointcut declaration has two parts: a signature comprising a name and any
340
340
parameters and a pointcut expression that determines exactly which method
@@ -395,7 +395,7 @@ expressions:
395
395
annotation (the execution of methods declared in types with the given annotation when
396
396
using Spring AOP).
397
397
* `@annotation`: Limits matching to join points where the subject of the join point
398
- (the method being executed in Spring AOP) has the given annotation.
398
+ (the method being run in Spring AOP) has the given annotation.
399
399
400
400
.Other pointcut types
401
401
****
@@ -1211,8 +1211,8 @@ The following example shows how to use after finally advice:
1211
1211
==== Around Advice
1212
1212
1213
1213
The last kind of advice is around advice. Around advice runs "`around`" a matched method's
1214
- execution. It has the opportunity to do work both before and after the method executes
1215
- and to determine when, how, and even if the method actually gets to execute at all.
1214
+ execution. It has the opportunity to do work both before and after the method runs
1215
+ and to determine when, how, and even if the method actually gets to run at all.
1216
1216
Around advice is often used if you need to share state before and after a method
1217
1217
execution in a thread-safe manner (starting and stopping a timer, for example). Always
1218
1218
use the least powerful form of advice that meets your requirements (that is, do not use
@@ -1221,7 +1221,7 @@ around advice if before advice would do).
1221
1221
Around advice is declared by using the `@Around` annotation. The first parameter of the
1222
1222
advice method must be of type `ProceedingJoinPoint`. Within the body of the advice,
1223
1223
calling `proceed()` on the `ProceedingJoinPoint` causes the underlying method to
1224
- execute . The `proceed` method can also pass in an `Object[]`. The values
1224
+ run . The `proceed` method can also pass in an `Object[]`. The values
1225
1225
in the array are used as the arguments to the method execution when it proceeds.
1226
1226
1227
1227
NOTE: The behavior of `proceed` when called with an `Object[]` is a little different than the
@@ -1783,15 +1783,15 @@ annotation. Consider the following example:
1783
1783
}
1784
1784
----
1785
1785
1786
- In the preceding example, the effect of the `' perthis' ` clause is that one aspect
1787
- instance is created for each unique service object that executes a business service (each
1788
- unique object bound to ' this' at join points matched by the pointcut expression). The
1789
- aspect instance is created the first time that a method is invoked on the service object.
1790
- The aspect goes out of scope when the service object goes out of scope. Before the aspect
1791
- instance is created, none of the advice within it executes . As soon as the aspect
1792
- instance has been created, the advice declared within it executes at matched join points,
1793
- but only when the service object is the one with which this aspect is associated. See the
1794
- AspectJ Programming Guide for more information on `per` clauses.
1786
+ In the preceding example, the effect of the `perthis` clause is that one aspect instance
1787
+ is created for each unique service object that performs a business service (each unique
1788
+ object bound to ` this` at join points matched by the pointcut expression). The aspect
1789
+ instance is created the first time that a method is invoked on the service object. The
1790
+ aspect goes out of scope when the service object goes out of scope. Before the aspect
1791
+ instance is created, none of the advice within it runs . As soon as the aspect instance
1792
+ has been created, the advice declared within it runs at matched join points, but only
1793
+ when the service object is the one with which this aspect is associated. See the AspectJ
1794
+ Programming Guide for more information on `per` clauses.
1795
1795
1796
1796
The `pertarget` instantiation model works in exactly the same way as `perthis`, but it
1797
1797
creates one aspect instance for each unique target object at matched join points.
@@ -2188,7 +2188,7 @@ significantly improve the readability of your code.
2188
2188
2189
2189
The `method` attribute identifies a method (`doAccessCheck`) that provides the body of
2190
2190
the advice. This method must be defined for the bean referenced by the aspect element
2191
- that contains the advice. Before a data access operation is executed (a method execution
2191
+ that contains the advice. Before a data access operation is performed (a method execution
2192
2192
join point matched by the pointcut expression), the `doAccessCheck` method on the aspect
2193
2193
bean is invoked.
2194
2194
@@ -2250,7 +2250,7 @@ example, you can declare the method signature as follows:
2250
2250
[[aop-schema-advice-after-throwing]]
2251
2251
==== After Throwing Advice
2252
2252
2253
- After throwing advice executes when a matched method execution exits by throwing an
2253
+ After throwing advice runs when a matched method execution exits by throwing an
2254
2254
exception. It is declared inside an `<aop:aspect>` by using the `after-throwing` element,
2255
2255
as the following example shows:
2256
2256
@@ -2325,8 +2325,8 @@ by using the `after` element, as the following example shows:
2325
2325
==== Around Advice
2326
2326
2327
2327
The last kind of advice is around advice. Around advice runs "around" a matched method
2328
- execution. It has the opportunity to do work both before and after the method executes
2329
- and to determine when, how, and even if the method actually gets to execute at all.
2328
+ execution. It has the opportunity to do work both before and after the method runs
2329
+ and to determine when, how, and even if the method actually gets to run at all.
2330
2330
Around advice is often used to share state before and after a method
2331
2331
execution in a thread-safe manner (starting and stopping a timer, for example). Always
2332
2332
use the least powerful form of advice that meets your requirements. Do not use around
@@ -2335,7 +2335,7 @@ advice if before advice can do the job.
2335
2335
You can declare around advice by using the `aop:around` element. The first parameter of the
2336
2336
advice method must be of type `ProceedingJoinPoint`. Within the body of the advice,
2337
2337
calling `proceed()` on the `ProceedingJoinPoint` causes the underlying method to
2338
- execute . The `proceed` method may also be called with an `Object[]`. The values
2338
+ run . The `proceed` method may also be called with an `Object[]`. The values
2339
2339
in the array are used as the arguments to the method execution when it proceeds. See
2340
2340
<<aop-ataspectj-around-advice>> for notes on calling `proceed` with an `Object[]`.
2341
2341
The following example shows how to declare around advice in XML:
@@ -2563,7 +2563,7 @@ ms % Task name
2563
2563
[[aop-ordering]]
2564
2564
==== Advice Ordering
2565
2565
2566
- When multiple pieces of advice need to execute at the same join point (executing method)
2566
+ When multiple pieces of advice need to run at the same join point (executing method)
2567
2567
the ordering rules are as described in <<aop-ataspectj-advice-ordering>>. The precedence
2568
2568
between aspects is determined via the `order` attribute in the `<aop:aspect>` element or
2569
2569
by either adding the `@Order` annotation to the bean that backs the aspect or by having
@@ -2772,7 +2772,7 @@ call `proceed` multiple times. The following listing shows the basic aspect impl
2772
2772
class ConcurrentOperationExecutor : Ordered {
2773
2773
2774
2774
private val DEFAULT_MAX_RETRIES = 2
2775
-
2775
+
2776
2776
private var maxRetries = DEFAULT_MAX_RETRIES
2777
2777
private var order = 1
2778
2778
@@ -2787,7 +2787,7 @@ call `proceed` multiple times. The following listing shows the basic aspect impl
2787
2787
fun setOrder(order: Int) {
2788
2788
this.order = order
2789
2789
}
2790
-
2790
+
2791
2791
fun doConcurrentOperation(pjp: ProceedingJoinPoint): Any {
2792
2792
var numAttempts = 0
2793
2793
var lockFailureException: PessimisticLockingFailureException
@@ -3160,13 +3160,13 @@ The key thing to understand here is that the client code inside the `main(..)` m
3160
3160
of the `Main` class has a reference to the proxy. This means that method calls on that
3161
3161
object reference are calls on the proxy. As a result, the proxy can delegate to all of
3162
3162
the interceptors (advice) that are relevant to that particular method call. However,
3163
- once the call has finally reached the target object (the `SimplePojo`, reference in
3163
+ once the call has finally reached the target object (the `SimplePojo` reference in
3164
3164
this case), any method calls that it may make on itself, such as `this.bar()` or
3165
3165
`this.foo()`, are going to be invoked against the `this` reference, and not the proxy.
3166
3166
This has important implications. It means that self-invocation is not going to result
3167
- in the advice associated with a method invocation getting a chance to execute .
3167
+ in the advice associated with a method invocation getting a chance to run .
3168
3168
3169
- Okay, so what is to be done about this? The best approach (the term, "` best,` " is used
3169
+ Okay, so what is to be done about this? The best approach (the term " best" is used
3170
3170
loosely here) is to refactor your code such that the self-invocation does not happen.
3171
3171
This does entail some work on your part, but it is the best, least-invasive approach.
3172
3172
The next approach is absolutely horrendous, and we hesitate to point it out, precisely
@@ -3433,7 +3433,7 @@ exact semantics of "`after returning from the initialization of a new object`" a
3433
3433
fine. In this context, "`after initialization`" means that the dependencies are
3434
3434
injected after the object has been constructed. This means that the dependencies
3435
3435
are not available for use in the constructor bodies of the class. If you want the
3436
- dependencies to be injected before the constructor bodies execute and thus be
3436
+ dependencies to be injected before the constructor bodies run and thus be
3437
3437
available for use in the body of the constructors, you need to define this on the
3438
3438
`@Configurable` declaration, as follows:
3439
3439
0 commit comments