Make strategies in EnvironmentPostProcessorApplicationListener pluggable #23230
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
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 useSpringFactoriesLoader
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 ofEnvironmentPostProcessorApplicationListener
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 inspring.factories
, and behaves similarly - backs off if another instance is provided with higher priority by some definition.EnvironmentPostProcessorApplicationListener
also contains this new abstractions ofBootstrapRegisty
andInstantiator
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 theDefaultBootstrapRegistry
, for example)?See also #15704 and #16880
The text was updated successfully, but these errors were encountered: