@@ -28,6 +28,10 @@ you can do so. However, you should consider the following issues:
28
28
deploying on the module path. Such cases require a JVM bootstrap flag
29
29
`--add-opens=java.base/java.lang=ALL-UNNAMED` which is not available for modules.
30
30
31
+
32
+ [[aop-forcing-proxy-types]]
33
+ == Forcing Specific AOP Proxy Types
34
+
31
35
To force the use of CGLIB proxies, set the value of the `proxy-target-class` attribute
32
36
of the `<aop:config>` element to true, as follows:
33
37
@@ -60,6 +64,24 @@ To be clear, using `proxy-target-class="true"` on `<tx:annotation-driven/>`,
60
64
proxies _for all three of them_.
61
65
====
62
66
67
+ `@EnableAspectJAutoProxy`, `@EnableTransactionManagement` and related configuration
68
+ annotations offer a corresponding `proxyTargetClass` attribute. These are collapsed
69
+ into a single unified auto-proxy creator too, effectively applying the _strongest_
70
+ proxy settings at runtime. As of 7.0, this applies to individual proxy processors
71
+ as well, for example `@EnableAsync`, consistently participating in unified global
72
+ default settings for all auto-proxying attempts in a given application.
73
+
74
+ The global default proxy type may differ between setups. While the core framework
75
+ suggests interface-based proxies by default, Spring Boot may - depending on
76
+ configuration properties - enable class-based proxies by default.
77
+
78
+ As of 7.0, forcing a specific proxy type for individual beans is possible through
79
+ the `@Proxyable` annotation on a given `@Bean` method or `@Component` class, with
80
+ `@Proxyable(INTERFACES)` or `@Proxyable(TARGET_CLASS)` overriding any globally
81
+ configured default. For very specific purposes, you may even specify the proxy
82
+ interface(s) to use through `@Proxyable(interfaces=...)`, limiting the exposure
83
+ to selected interfaces rather than all interfaces that the target bean implements.
84
+
63
85
64
86
[[aop-understanding-aop-proxies]]
65
87
== Understanding AOP Proxies
0 commit comments