Closed
Description
Juergen Hoeller opened SPR-17075 and commented
After several discussions around #21511, #16046 and #13532, it turns out that programmatic retrieval of an ObjectProvider
handle - as opposed to it just being obtainable through annotation-driven injection - would significantly enrich functional bean definitions.
So as of 5.1, BeanFactory.getBeanProvider
provides a convenient and powerful enough entry point for the time being. Stream access to multiple matching beans is covered in #16046 now; just programmatic bean retrieval with qualifiers is left to #13532 still.
Issue Links:
- Support for Supplier as a deferred bean creation [SPR-16973] #21511 Support for Supplier as a deferred bean creation
- ObjectProvider iterable/stream access for "beans of type" resolution in @Bean methods [SPR-11419] #16046 ObjectProvider iterable/stream access for "beans of type" resolution in
@Bean
methods - Add generics / parameterized type support to ListableBeanFactory getBeanNamesForType/getBeansOfType methods [SPR-12147] #16761 Add generics / parameterized type support to ListableBeanFactory getBeanNamesForType/getBeansOfType methods
- Convenient programmatic bean retrieval with qualifiers [SPR-8891] #13532 Convenient programmatic bean retrieval with qualifiers
- BeanFactory lacks method for getting bean by type with specified constructor arguments [SPR-11235] #15860 BeanFactory lacks method for getting bean by type with specified constructor arguments