Skip to content

Avoid scoped destruction callbacks in case of no post-processor actually applying [SPR-13744] #18317

@spring-projects-issues

Description

@spring-projects-issues

Juergen Hoeller opened SPR-13744 and commented

As indicated by #18312 and encountered in other recent scoping scenarios, Spring creates destruction callbacks for every bean in a custom scope in many scenarios, due to DestructionAwareBeanPostProcessor implementations being registered in many common ApplicationContexts these days.

We should try to come up with a mechanism that allows us to skip such scoped a destruction callback if no post-processor actually applies to a given bean. This may require a SmartDestructionAwareBeanPostProcessor interface with a new callback which indicates whether postProcessBeforeDestruction would perform any concrete work for a given bean.


Affects: 4.2.3

Issue Links:

Referenced from: commits 2e6eb61, fca5365

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions