|
From: Juergen H. <ju...@in...> - 2005-06-27 08:44:19
|
As per my latest comment on your other issue, this will work now for = beans with factory method as well, provided that they are defined as = singleton: Once a bean with a factory method has been instantiated, its type _is_ = known and correctly detected by "getType", "getBeanNamesOfType" and "getBeansOfType".=20 I've just further refined AbstractBeanFactory to actually trigger instantiation of a bean with a factory method even when just determining = the type - provided that the target bean is a singleton. The BeanFactory = already behaves similarly for beans that implement the FactoryBean interface. For prototype beans with factory method declaration, the type will still = be considered undeterminable, which I think is acceptable. Juergen =20 -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf = Of Tim Diggins Sent: Monday, June 27, 2005 10:05 AM To: spr...@li... Subject: Re: [Springframework-developer] autowire by type on a = factory-bean factory-method I understand that getType on any factory-method type bean returns Null, implying that autowire by type wouldn't work with one of these. Getting = the getType to check the type of the bean returned by factory-method is not = that difficult (just a bit of introspection), but isn't (as I understand it) underway at present. This is paraphrased & deduced from a recent comment on JIRA http://opensource.atlassian.com/projects/spring/browse/SPR-1011 Tim Keith Donald wrote: > Autowire by type on a factory-bean factory-method doesn't seem=20 > supported. I noticed this in a dependency injection-enabled spring=20 > test, where I wanted to auto-inject the result of a factory method. > Would this be difficult to do? >=20 > =20 >=20 > Keith >=20 > =20 >=20 > -- > Keith Donald > Interface21 Principal Consultant >=20 > http://www.springframework.com <http://www.springframework.com/> >=20 > =20 >=20 ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies = from IBM. Find simple to follow Roadmaps, straightforward articles, = informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&op=3Dick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |