Skip to content

Clarify Bean destroyMethod documentation [SPR-16078] #20627

Closed
@spring-projects-issues

Description

@spring-projects-issues

Cameron Steffen opened SPR-16078 and commented

This paragraph seems to imply that setting destroyMethod="" will not disable destroy method inference for DisposableBean, Closeable and AutoCloseable beans.

To disable destroy method inference for a particular @Bean, specify an empty string as the value, e.g. @Bean(destroyMethod=""). Note that the DisposableBean and the Closeable/AutoCloseable interfaces will nevertheless get detected and the corresponding destroy/close method invoked.


Reference URL: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/Bean.html#destroyMethod--

Issue Links:

Referenced from: commits d1b5b5d, dff2c84

Backported to: 4.3.13

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions