Skip to content

Commit dd76ed7

Browse files
committed
Merge branch '6.0.x'
# Conflicts: # spring-core/src/main/java/org/springframework/core/ReactiveAdapterRegistry.java # spring-core/src/main/java/org/springframework/util/StopWatch.java
2 parents 837e896 + d58e48d commit dd76ed7

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

framework-docs/modules/ROOT/pages/integration/jmx/exporting.adoc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,21 @@ as the following example shows:
183183

184184
If you configure a bean with an `MBeanExporter` that is also configured for lazy
185185
initialization, the `MBeanExporter` does not break this contract and avoids
186-
instantiating the bean. Instead, it registers a proxy with the `MBeanServer` and
187-
defers obtaining the bean from the container until the first invocation on the proxy
188-
occurs.
186+
instantiating the bean. Instead, it registers a proxy with the `MBeanServer` and defers
187+
obtaining the bean from the container until the first invocation on the proxy occurs.
188+
189+
This also affects `FactoryBean` resolution where `MBeanExporter` will regularly
190+
introspect the produced object, effectively triggering `FactoryBean.getObject()`.
191+
In order to avoid this, mark the corresponding bean definition as lazy-init.
189192

190193

191194
[[jmx-exporting-auto]]
192195
== Automatic Registration of MBeans
193196

194-
Any beans that are exported through the `MBeanExporter` and are already valid MBeans are
195-
registered as-is with the `MBeanServer` without further intervention from Spring. You can cause MBeans
196-
to be automatically detected by the `MBeanExporter` by setting the `autodetect`
197-
property to `true`, as the following example shows:
197+
Any beans that are exported through the `MBeanExporter` and are already valid MBeans
198+
are registered as-is with the `MBeanServer` without further intervention from Spring.
199+
You can cause MBeans to be automatically detected by the `MBeanExporter` by setting
200+
the `autodetect` property to `true`, as the following example shows:
198201

199202
[source,xml,indent=0,subs="verbatim,quotes"]
200203
----

0 commit comments

Comments
 (0)