Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe that bean disposal is unsupported for the beans created by FactoryBean #24948

Closed
johnlinp opened this issue Apr 21, 2020 · 0 comments
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Milestone

Comments

@johnlinp
Copy link
Contributor

Affects: v5.2.5.RELEASE

In #14668, the comment described clearly that the Spring framework is only responsible for managing the lifecycle of the FactoryBean, not the lifecycle of the beans that created by the FactoryBean.

However, this description doesn't appear in the javadoc of FactoryBean. I think it would be great to mention the following points in the documentation:

  1. The Spring framework is only responsible for managing the lifecycle of the FactoryBean, not the lifecycle of the beans that created by the FactoryBean.
  2. Therefore, the Closeable.close() method on the created beans will not be called.
  3. FactoryBean should implement DisposableBean and delegate the Closeable.close() calls to the underlying beans.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 21, 2020
@jhoeller jhoeller self-assigned this Apr 21, 2020
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 21, 2020
@jhoeller jhoeller added this to the 5.2.6 milestone Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

3 participants