Skip to content

Make strategies in EnvironmentPostProcessorApplicationListener pluggable #23230

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

Open
dsyer opened this issue Sep 8, 2020 · 0 comments
Open
Labels
status: blocked An issue that's blocked on an external project change theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@dsyer
Copy link
Member

dsyer commented Sep 8, 2020

There is a public constructor EnvironmentPostProcessorApplicationListener(EnvironmentPostProcessorsFactory) but currently no way to use it except with byte code tricks or monkey patches - the current implementation is to use SpringFactoriesLoader to instantiate using the default constructor and take it from there.

What we might need is an abstraction that can be created via SpringFactoriesLoader but which will back off if it finds one is already present. At a granular level this could be something simple like a composite version of EnvironmentPostProcessorApplicationListener that picks the first thing that is non-null (or some other tie breaker). Or it could be a new factory abstraction that is more generic and can be applied to other things in spring.factories, and behaves similarly - backs off if another instance is provided with higher priority by some definition.

EnvironmentPostProcessorApplicationListener also contains this new abstractions of BootstrapRegisty and Instantiator with no option to override. Maybe those could be the focus of the new abstraction (being able to replace or override some or all calls to the DefaultBootstrapRegistry, for example)?

See also #15704 and #16880

@dsyer dsyer changed the title Make strategies in EnvironmentPostProcessorApplicationListener pluggable Make strategies in EnvironmentPostProcessorApplicationListener pluggable Sep 8, 2020
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 8, 2020
@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 1, 2020
@philwebb philwebb added this to the 3.x milestone Dec 1, 2020
@scottfrederick scottfrederick added the status: blocked An issue that's blocked on an external project change label Nov 1, 2021
@mbhave mbhave added theme: aot An issue related to Ahead-of-time processing and removed theme: native labels Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked An issue that's blocked on an external project change theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants