Closed
Description
Liu, Yinwei David opened SPR-6602 and commented
Hi,
It looks like that the javaconfig in Spring 3 does not support configure a FactoryBean in javaconfig, and then easily inject it to another Bean.
What I want in Spring 3 java config is:
class MyFactoryBean implements FactoryBean<B>{}
@Bean
public MyFactoryBean bFactoryBean() {
return new MyFactoryBean();
}
@Bean
public A a(B b) {
A a = new A();
a.setB( bFactoryBean().getObject() );
return a;
}
Can Spring 3 support FactoryBean in its javaconfig?
Affects: 3.0 GA
Attachments:
- mylyn-context.zip (26.96 kB)
- repro.zip (5.68 kB)
Issue Links:
- ConfigurationClassEnhancer.enhanceFactoryBean is not transparent for method calls other than getObject() [SPR-12915] #17514 ConfigurationClassEnhancer.enhanceFactoryBean is not transparent for method calls other than getObject()
Referenced from: commits 4c05eae
1 votes, 1 watchers