-
Notifications
You must be signed in to change notification settings - Fork 41.2k
AbstractRefreshableApplicationContext should not appear in the type hierarchy of our application context implementations #16096
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
AbstractRefreshableApplicationContext
hierarchy
Our move to Framework 5.2 is related to this. In 5.2, @snicoll Did you have anything in mind here? Will it help with implementing the new methods on |
This is related indirectly. We have contexts in the hierarchy that ultimately do not depend on It looks like this will be interesting for |
|
@philwebb it's mainly used in tests you are right. As for the regular I've introduced a |
@snicoll I've added a couple of extra commits on a local branch. The changes you've made look good to me. My only hesitation is with Since that context is just for reactive code, and since we've probably not got many users working with it directly, I think we should just risk changing the base class. I do think we should perhaps re-introduce deprecated versions of methods from the old class (I've done that on my branch). We can't make them work, but at least we can give people hints that they're deprecated. We should also add additional constructors I think. Overall, I'm +1 for the changes. |
Thanks for the review @philwebb - FYI, I've dropped philwebb@2ce95ef from your polish. I didn't migrate those on purpose as this module can't have a compile dependency on |
This commit migrates `AnnotationConfigReactiveWebApplicationContext` parent to the `GenericApplicationContext` abstraction. Any use of `AnnotationConfigWebApplicationContext` is also removed as it also inherits from the `AbstractRefreshableApplicationContext` outdated hierarchy. A new `AnnotationConfigServletWebApplicationContext` context is introduced instead, extending from `GenericApplicationContext` and providing the counter part of the reactive context for the Servlet-based web app tests. See gh-16096
Uh oh!
There was an error while loading. Please reload this page.
Several
ApplicationContext
implementations we use inherits fromAbstractRefreshableApplicationContext
which is a hierarchy we shouldn't be using in modern-day arrangements:AnnotationConfigWebApplicationContext
AnnotationConfigReactiveWebApplicationContext
While the latter is in our code base, the former is in the framework code base with no clear sign we shouldn't be using it anymore. Those contexts don't hold a
BeanFactory
instance before they refresh and therefore prevent any use of functional bean registration.A potential replacement would be a
GenericWebApplicationContext
sub-class with aAnnotationConfigUtils.registerAnnotationConfigProcessors(ctx)
invocation.The text was updated successfully, but these errors were encountered: