@@ -398,10 +398,10 @@ releases to support more of the AspectJ pointcut designators.
398
398
Because Spring AOP limits matching to only method execution join points, the discussion
399
399
of the pointcut designators above gives a narrower definition than you will find in the
400
400
AspectJ programming guide. In addition, AspectJ itself has type-based semantics and at
401
- an execution join point both '++ this++' and '++ target++' refer to the same object - the
401
+ an execution join point both ` this` and ` target` refer to the same object - the
402
402
object executing the method. Spring AOP is a proxy-based system and differentiates
403
- between the proxy object itself (bound to '++ this++' ) and the target object behind the
404
- proxy (bound to '++ target++' ).
403
+ between the proxy object itself (bound to ` this` ) and the target object behind the
404
+ proxy (bound to ` target` ).
405
405
406
406
[NOTE]
407
407
====
@@ -418,29 +418,29 @@ different characteristics, so be sure to make yourself familiar with weaving fir
418
418
before making a decision.
419
419
====
420
420
421
- Spring AOP also supports an additional PCD named '++ bean++' . This PCD allows you to limit
421
+ Spring AOP also supports an additional PCD named ` bean` . This PCD allows you to limit
422
422
the matching of join points to a particular named Spring bean, or to a set of named
423
- Spring beans (when using wildcards). The '++ bean++' PCD has the following form:
423
+ Spring beans (when using wildcards). The ` bean` PCD has the following form:
424
424
425
425
[source,java,indent=0]
426
426
[subs="verbatim,quotes"]
427
427
----
428
428
bean(idOrNameOfBean)
429
429
----
430
430
431
- The '++ idOrNameOfBean++' token can be the name of any Spring bean: limited wildcard
432
- support using the '++*++' character is provided, so if you establish some naming
433
- conventions for your Spring beans you can quite easily write a '++ bean++' PCD expression
434
- to pick them out. As is the case with other pointcut designators, the '++ bean++' PCD can
431
+ The ` idOrNameOfBean` token can be the name of any Spring bean: limited wildcard
432
+ support using the `*` character is provided, so if you establish some naming
433
+ conventions for your Spring beans you can quite easily write a ` bean` PCD expression
434
+ to pick them out. As is the case with other pointcut designators, the ` bean` PCD can
435
435
be &&'ed, ||'ed, and ! (negated) too.
436
436
437
437
[NOTE]
438
438
====
439
- Please note that the '++ bean++' PCD is __only__ supported in Spring AOP - and __not__ in
439
+ Please note that the ` bean` PCD is __only__ supported in Spring AOP - and __not__ in
440
440
native AspectJ weaving. It is a Spring-specific extension to the standard PCDs that
441
441
AspectJ defines and therefore not available for aspects declared in the `@Aspect` model.
442
442
443
- The '++ bean++' PCD operates at the __instance__ level (building on the Spring bean name
443
+ The ` bean` PCD operates at the __instance__ level (building on the Spring bean name
444
444
concept) rather than at the type level only (which is what weaving-based AOP is limited
445
445
to). Instance-based pointcut designators are a special capability of Spring's
446
446
proxy-based AOP framework and its close integration with the Spring bean factory, where
@@ -769,7 +769,7 @@ how to make the annotation object(s) available in the advice body.
769
769
====
770
770
771
771
* any join point (method execution only in Spring AOP) on a Spring bean named
772
- '++ tradeService++' :
772
+ ` tradeService` :
773
773
774
774
[source,java,indent=0]
775
775
[subs="verbatim,quotes"]
@@ -778,7 +778,7 @@ how to make the annotation object(s) available in the advice body.
778
778
----
779
779
780
780
* any join point (method execution only in Spring AOP) on Spring beans having names that
781
- match the wildcard expression '++ *Service++' :
781
+ match the wildcard expression ` *Service` :
782
782
783
783
[source,java,indent=0]
784
784
[subs="verbatim,quotes"]
@@ -2391,7 +2391,7 @@ In the XML style I can declare the first two pointcuts:
2391
2391
----
2392
2392
2393
2393
The downside of the XML approach is that you cannot define the
2394
- '++ accountPropertyAccess++' pointcut by combining these definitions.
2394
+ ` accountPropertyAccess` pointcut by combining these definitions.
2395
2395
2396
2396
The @AspectJ style supports additional instantiation models, and richer pointcut
2397
2397
composition. It has the advantage of keeping the aspect as a modular unit. It also has
@@ -2467,7 +2467,7 @@ at runtime, which applies the __strongest__ proxy settings that any of the
2467
2467
This also applies to the `<tx:annotation-driven/>` and `<aop:aspectj-autoproxy/>`
2468
2468
elements.
2469
2469
2470
- To be clear: using '++ proxy-target-class="true"++' on `<tx:annotation-driven/>`,
2470
+ To be clear: using ` proxy-target-class="true"` on `<tx:annotation-driven/>`,
2471
2471
`<aop:aspectj-autoproxy/>` or `<aop:config/>` elements will force the use of CGLIB
2472
2472
proxies __for all three of them__.
2473
2473
====
@@ -2720,7 +2720,7 @@ Spring will now look for a bean definition named "account" and use that as the
2720
2720
definition to configure new `Account` instances.
2721
2721
2722
2722
You can also use autowiring to avoid having to specify a dedicated bean definition at
2723
- all. To have Spring apply autowiring use the '++ autowire++' property of the
2723
+ all. To have Spring apply autowiring use the ` autowire` property of the
2724
2724
`@Configurable` annotation: specify either `@Configurable(autowire=Autowire.BY_TYPE)` or
2725
2725
`@Configurable(autowire=Autowire.BY_NAME` for autowiring by type or by name
2726
2726
respectively. As an alternative, as of Spring 2.5 it is preferable to specify explicit,
@@ -2740,7 +2740,7 @@ the annotation. In essence the aspect says "after returning from the initializat
2740
2740
new object of a type annotated with `@Configurable`, configure the newly created object
2741
2741
using Spring in accordance with the properties of the annotation". In this context,
2742
2742
__initialization__ refers to newly instantiated objects (e.g., objects instantiated with
2743
- the '++ new++' operator) as well as to `Serializable` objects that are undergoing
2743
+ the ` new` operator) as well as to `Serializable` objects that are undergoing
2744
2744
deserialization (e.g., via
2745
2745
http://docs.oracle.com/javase/6/docs/api/java/io/Serializable.html[readResolve()]).
2746
2746
@@ -2929,7 +2929,7 @@ fully-qualified class names:
2929
2929
When using AspectJ aspects with Spring applications, it is natural to both want and
2930
2930
expect to be able to configure such aspects using Spring. The AspectJ runtime itself is
2931
2931
responsible for aspect creation, and the means of configuring the AspectJ created
2932
- aspects via Spring depends on the AspectJ instantiation model (the '++ per-xxx++' clause)
2932
+ aspects via Spring depends on the AspectJ instantiation model (the ` per-xxx` clause)
2933
2933
used by the aspect.
2934
2934
2935
2935
The majority of AspectJ aspects are __singleton__ aspects. Configuration of these
@@ -3067,10 +3067,10 @@ profiler, using the @AspectJ-style of aspect declaration.
3067
3067
}
3068
3068
----
3069
3069
3070
- We will also need to create an '++ META-INF/aop.xml++' file, to inform the AspectJ weaver
3070
+ We will also need to create an ` META-INF/aop.xml` file, to inform the AspectJ weaver
3071
3071
that we want to weave our `ProfilingAspect` into our classes. This file convention,
3072
3072
namely the presence of a file (or files) on the Java classpath called
3073
- '++ META-INF/aop.xml++' is standard AspectJ.
3073
+ ` META-INF/aop.xml` is standard AspectJ.
3074
3074
3075
3075
[source,xml,indent=0]
3076
3076
[subs="verbatim,quotes"]
@@ -3094,7 +3094,7 @@ namely the presence of a file (or files) on the Java classpath called
3094
3094
Now to the Spring-specific portion of the configuration. We need to configure a
3095
3095
`LoadTimeWeaver` (all explained later, just take it on trust for now). This load-time
3096
3096
weaver is the essential component responsible for weaving the aspect configuration in
3097
- one or more '++ META-INF/aop.xml++' files into the classes in your application. The good
3097
+ one or more ` META-INF/aop.xml` files into the classes in your application. The good
3098
3098
thing is that it does not require a lot of configuration, as can be seen below (there
3099
3099
are some more options that you can specify, but these are detailed later).
3100
3100
@@ -3120,7 +3120,7 @@ are some more options that you can specify, but these are detailed later).
3120
3120
</beans>
3121
3121
----
3122
3122
3123
- Now that all the required artifacts are in place - the aspect, the '++ META-INF/aop.xml++'
3123
+ Now that all the required artifacts are in place - the aspect, the ` META-INF/aop.xml`
3124
3124
file, and the Spring configuration -, let us create a simple driver class with a
3125
3125
`main(..)` method to demonstrate the LTW in action.
3126
3126
@@ -3157,7 +3157,7 @@ to switch on the LTW. This is the command line we will use to run the above `Mai
3157
3157
java -javaagent:C:/projects/foo/lib/global/spring-instrument.jar foo.Main
3158
3158
----
3159
3159
3160
- The '++ -javaagent++' is a flag for specifying and enabling
3160
+ The ` -javaagent` is a flag for specifying and enabling
3161
3161
http://docs.oracle.com/javase/6/docs/api/java/lang/instrument/package-summary.html[agents
3162
3162
to instrument programs running on the JVM]. The Spring Framework ships with such an
3163
3163
agent, the `InstrumentationSavingAgent`, which is packaged in the
@@ -3235,13 +3235,13 @@ Furthermore, the compiled aspect classes need to be available on the classpath.
3235
3235
[[aop-aj-ltw-aop_dot_xml]]
3236
3236
==== 'META-INF/aop.xml'
3237
3237
3238
- The AspectJ LTW infrastructure is configured using one or more '++ META-INF/aop.xml++'
3238
+ The AspectJ LTW infrastructure is configured using one or more ` META-INF/aop.xml`
3239
3239
files, that are on the Java classpath (either directly, or more typically in jar files).
3240
3240
3241
3241
The structure and contents of this file is detailed in the main AspectJ reference
3242
3242
documentation, and the interested reader is
3243
3243
http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html[referred to
3244
- that resource]. (I appreciate that this section is brief, but the '++ aop.xml++' file is
3244
+ that resource]. (I appreciate that this section is brief, but the ` aop.xml` file is
3245
3245
100% AspectJ - there is no Spring-specific information or semantics that apply to it,
3246
3246
and so there is no extra value that I can contribute either as a result), so rather than
3247
3247
rehash the quite satisfactory section that the AspectJ developers wrote, I am just
@@ -3301,7 +3301,7 @@ which typically is done using the `@EnableLoadTimeWeaving` annotation.
3301
3301
3302
3302
Alternatively, if you prefer XML based configuration, use the
3303
3303
`<context:load-time-weaver/>` element. Note that the element is defined in the
3304
- '++ context++' namespace.
3304
+ ` context` namespace.
3305
3305
3306
3306
[source,xml,indent=0]
3307
3307
[subs="verbatim,quotes"]
@@ -3380,7 +3380,7 @@ To specify a specific `LoadTimeWeaver` with Java configuration implement the
3380
3380
----
3381
3381
3382
3382
If you are using XML based configuration you can specify the fully-qualified classname
3383
- as the value of the '++ weaver-class++' attribute on the `<context:load-time-weaver/>`
3383
+ as the value of the ` weaver-class` attribute on the `<context:load-time-weaver/>`
3384
3384
element:
3385
3385
3386
3386
[source,xml,indent=0]
@@ -3403,7 +3403,7 @@ element:
3403
3403
----
3404
3404
3405
3405
The `LoadTimeWeaver` that is defined and registered by the configuration can be later
3406
- retrieved from the Spring container using the well-known name '++ loadTimeWeaver++' .
3406
+ retrieved from the Spring container using the well-known name ` loadTimeWeaver` .
3407
3407
Remember that the `LoadTimeWeaver` exists just as a mechanism for Spring's LTW
3408
3408
infrastructure to add one or more `ClassFileTransformers`. The actual
3409
3409
`ClassFileTransformer` that does the LTW is the `ClassPreProcessorAgentAdapter` (from
@@ -3412,10 +3412,10 @@ the `org.aspectj.weaver.loadtime` package) class. See the class-level javadocs o
3412
3412
the weaving is actually effected is beyond the scope of this section.
3413
3413
3414
3414
There is one final attribute of the configuration left to discuss: the
3415
- '++ aspectjWeaving++' attribute (or '++ aspectj-weaving++' if you are using XML). This is a
3415
+ ` aspectjWeaving` attribute (or ` aspectj-weaving` if you are using XML). This is a
3416
3416
simple attribute that controls whether LTW is enabled or not; it is as simple as that.
3417
3417
It accepts one of three possible values, summarized below, with the default value being
3418
- '++ autodetect++' if the attribute is not present.
3418
+ ` autodetect` if the attribute is not present.
3419
3419
3420
3420
[[aop-aj-ltw-ltw-tag-attrs]]
3421
3421
.AspectJ weaving attribute values
@@ -3432,7 +3432,7 @@ It accepts one of three possible values, summarized below, with the default valu
3432
3432
3433
3433
| `AUTODETECT`
3434
3434
| `autodetect`
3435
- | If the Spring LTW infrastructure can find at least one '++ META-INF/aop.xml++' file,
3435
+ | If the Spring LTW infrastructure can find at least one ` META-INF/aop.xml` file,
3436
3436
then AspectJ weaving is on, else it is off. This is the default value.
3437
3437
|===
3438
3438
0 commit comments