Skip to content

Add support for registering multiple init & destroy method names #28013

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

Closed
snicoll opened this issue Feb 7, 2022 · 1 comment
Closed

Add support for registering multiple init & destroy method names #28013

snicoll opened this issue Feb 7, 2022 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Feb 7, 2022

A BeanDefinition can have an init and destroy method name. While uncommon, it is possible for a bean to have more than one of those, see InitDestroyAnnotationBeanPostProcessor.

To replace the runtime behavior of searching for those annotations, we need a way to specify multiple init and destroy method names. There might be an impact on isExternallyManagedConfigMember in RootBeanDefinition as well.

@snicoll snicoll added type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Feb 7, 2022
@snicoll snicoll added this to the 6.0.0-M3 milestone Feb 7, 2022
@snicoll
Copy link
Member Author

snicoll commented Feb 7, 2022

Reviewing what we did in Spring Native to support this feature, it looks like that adding multiple init/destroy method names could be enough to support this use case, if we'd honor MergedBeanDefinitionPostProcessor.

The current code registers detected method as externally managed. We could rather "just" register it and let the new code invokes the method.

@jhoeller jhoeller self-assigned this Feb 7, 2022
@jhoeller jhoeller added the in: core Issues in core modules (aop, beans, core, context, expression) label Feb 8, 2022
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) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants