Skip to content

Commit 3125ef7

Browse files
committed
Polish documentation for inferred bean destruction mode
1 parent 6ff2abc commit 3125ef7

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/asciidoc/index.adoc

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4248,10 +4248,11 @@ but does not couple the code to Spring.
42484248

42494249
[TIP]
42504250
====
4251-
The `destroy-method` attribute of a `<bean/>` element can have a special `(inferred)`
4252-
value to automatically detect either a `close` or `shutdown` public method on the
4253-
specific bean class. This special value can also be set on the
4254-
`default-destroy-method` to apply that behavior to a set of beans (see
4251+
The `destroy-method` attribute of a `<bean>` element can be assigned a special
4252+
`(inferred)` value which instructs Spring to automatically detect a public `close` or
4253+
`shutdown` method on the specific bean class. This special `(inferred)` value can also be
4254+
set on the `default-destroy-method` attribute of a `<beans>` element to apply this
4255+
behavior to an entire set of beans (see
42554256
<<beans-factory-lifecycle-default-init-destroy-methods>>). Note that this is the
42564257
default behavior with Java config.
42574258
====
@@ -7263,11 +7264,11 @@ on the `bean` element:
72637264

72647265
[NOTE]
72657266
====
7266-
By default, beans defined using Java config having a `close` or `shutdown` public method
7267-
are automatically enlisted with a destruction callback. If you have a `close` or `public`
7268-
method and you do not wish it to be called when the container shuts down, simply add
7269-
`@Bean(destroyMethod="")` to your bean definition to disable the default `(inferred)`
7270-
mode.
7267+
By default, beans defined using Java config that have a public `close` or `shutdown`
7268+
method are automatically enlisted with a destruction callback. If you have a public
7269+
`close` or `shutdown` method and you do not wish for it to be called when the container
7270+
shuts down, simply add `@Bean(destroyMethod="")` to your bean definition to disable the
7271+
default `(inferred)` mode.
72717272
====
72727273

72737274
Of course, in the case of `Foo` above, it would be equally as valid to call the `init()`

0 commit comments

Comments
 (0)