You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a library provides a listener for ApplicationEnvironmentPreparedEvent (for instance) in spring.factories it can modify the SpringApplication (add sources, change the application context class, etc.) but there is no way to know if the user has already done that before calling run(). It would be useful in general to be able to do that, so that the library can respect the user's wishes and still provide defaults. Specifically I am interested in the application context factory, but maybe also other things.
Various ideas popped up when we discussed informally:
public getters for everything in SpringApplication is an option, but not likely to be desirable.
a new ApplicationEvent that can be fired from the constructor.
extracting "default provider" concern to a new component (so the library can override that instead of calling setters directly).