Closed
Description
Pavel Petrov opened SPR-11235 and commented
In BeanFactory interface we have only one option to create a prototype bean which has a constructor with arguments: Object getBean(String name, Object... args), which requires a type cast (it returns Object) and requires providing explicit name for a bean (even if there's a single implementation).
Could you please consider adding getBean(Class requiredType, Object... args) as well?
Issue Links:
- @LookupMethod annotation for use with component scanning [SPR-5192] #9865
@LookupMethod
annotation for use with component scanning - Regression in 4.1: UnsatisfiedDependencyException because a prototype-scoped FactoryBean is unexpectedly instantiated by getTypeForFactoryBean() [SPR-12786] #17383 Regression in 4.1: UnsatisfiedDependencyException because a prototype-scoped FactoryBean is unexpectedly instantiated by getTypeForFactoryBean()
- Programmatic ObjectProvider retrieval through BeanFactory API [SPR-17075] #21613 Programmatic ObjectProvider retrieval through BeanFactory API
- Passing lookup-method arguments to created bean constructor [SPR-7431] #12089 Passing lookup-method arguments to created bean constructor
- ObjectFactory lacks method for getting bean with specified constructor arguments [SPR-13956] #18529 ObjectFactory lacks method for getting bean with specified constructor arguments
Referenced from: commits fd5dbdd
2 votes, 5 watchers