Description
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)?