Closed
Description
Stéphane Nicoll opened SPR-13943 and commented
In Spring Boot it is very common to associate a bean to something if it is found in the context. If there is more than one instance but one is flagged as primary then we're fine as well. If there are more than one instance and the user did not mark a preference for one, then we don't know which one to use.
We would need a first class support of that use case, maybe based on the ObjectFactory
. Something that would return the candidate bean or null
if none was found.
Issue Links:
- Mis-proxying of Mockito mock and poor diagnostics for type mismatch on proxy injection [SPR-14478] #19047 Mis-proxying of Mockito mock and poor diagnostics for type mismatch on proxy injection
- Support dynamic bean lookup a la CDI's Instance type [SPR-13132] #17723 Support dynamic bean lookup a la CDI's Instance type
- ObjectFactory lacks method for getting bean with specified constructor arguments [SPR-13956] #18529 ObjectFactory lacks method for getting bean with specified constructor arguments