-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Allow SpringApplication to create its application context without requiring reflection #22322
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
Comments
@dsyer I've got a prototype for this. Could you please take a look and let us know if it meets your needs? |
The API works. It would be nice to have access to the setter in |
Thanks. I've force-pushed an update to the builder. I'm also wondering if we should deprecate the class-based methods. The new approach provides a superset of the capabilities of the class-based approach so it's not clear to me that we need both. |
Kind of would be nice. The only problem with deprecating the old method is that you need it to support configuration via |
We're going to deprecate the class-based configuration in favour of the factory.
That's not an officially supported property (hence there being no metadata for it) so anyone using it (and ignoring their IDE's warning) will have to find an alternative once the deprecated setter's been removed (Boot 2.6 at the earliest). |
Uh oh!
There was an error while loading. Please reload this page.
I found I needed to access the
applicationContextClass
reflectively in order to reason about whether I needed to change the default. This was specifically when trying to avoid annotation-based@Configuration
processing, but I guess there might be other reasons to want to do it. So adding a public accessor forSpringApplication.applicationContextClass
would get me where I need to go.Example code in Spring Init:
Alternatively we could encapsulate the concern of mapping a
WebApplicationType
to a defaultApplicationContext
. Even better would be to optionally avoid reflective instantiation of theApplicationContext
altogether.The text was updated successfully, but these errors were encountered: