-
Notifications
You must be signed in to change notification settings - Fork 38k
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
Expose registerBean(Class<T>, Supplier<T>) outside of GenericApplicationContext #22457
Comments
Other kinds of application contexts are only really the reloadable ones that create a fresh |
I considered doing that but what about |
The problem turns out to be much simpler if we reduce it to annotation-config contexts: We override the central FWIW, It'd be nice to avoid the complexity of |
registerBean(Class<T>, Supplier<T>) outside of
GenericApplicationContext`
I've added two methods to the
The qualifier approach is our existing |
For the purpose of the tester I am trying to improve, I need to be able to control the bean name so it looks like those two new methods are not providing the extension that I need. Also, I've noticed a somewhat random order in which registration occurs. If we mix imports and functional bean registration, I can see functional bean registration happens at the end regardless how the context is used. I was wondering if that's a conscious decision. |
I need to setup a new context in spring-projects/spring-boot#16021 for RSocket support. As far as I understand, this enhancement would help simplify the existing context hierarchy in Spring Boot and avoir creating even more. You'll find some of those in |
The additional methods on |
Includes bringing registerBean constructor-vararg variants up to GenericApplicationContext, making AnnotationConfigApplicationContext a straightforward subclass with a single template method to override. See gh-22457
Affects:
5.1.5.RELEASE
We're trying to use the register bean facility using a
Supplier
but the current implementation is tied toGenericApplicationContext
. Some of our contexts do not inherit from it which prevents us to reuse the feature.Is there a plan to make that available higher in the stack? See spring-projects/spring-boot#16011
The text was updated successfully, but these errors were encountered: