View Full Version : Autowiring support
ta
Aug 23rd, 2005, 05:31 AM
Hello,
Any plans to support autowiring in Spring IDE? For the moment, the plugin complains about the absence of constructor with no arguments when I use autowire="constructor" and define a single constructor with arguments.
Torsten Juergeleit
Aug 23rd, 2005, 09:11 AM
Any plans to support autowiring in Spring IDE?
No. I have no clue how to implement autowiring without instantiating the beans. And instantiating a bean factory's whole object graph is not feasable from within a simple validator running in Eclipse. Normally you need a runtime environment or mocks to do so, e.g. a respository for JNDI lookups or a JDBC connection pool for a DataSource.
For the moment, the plugin complains about the absence of constructor with no arguments when I use autowire="constructor" and define a single constructor with arguments.
In this case the validator should skip the no-arguments-constructor check. Please open a ticket for this issue via http://springide.org/project/newticket
Cheers,
Torsten
ta
Aug 23rd, 2005, 09:28 AM
Than you. done.
http://springide.org/project/ticket/143
cepage
Aug 23rd, 2005, 10:00 AM
No. I have no clue how to implement autowiring without instantiating the beans.
Is supprting autowire-by-name possible? Naively, it seems that it would be a matter of using reflection to identify setters on a bean, and comparing those against the previously parsed bean ids.
Torsten Juergeleit
Aug 29th, 2005, 08:21 AM
Is supprting autowire-by-name possible? Naively, it seems that it would be a matter of using reflection to identify setters on a bean, and comparing those against the previously parsed bean ids.
Using reflection from within Eclipse is not an option. We can't do any classloading-stuff like Class.forname() because we're living in a limited classloader provided by Eclipse without any "real" runtime environment.
IMHO our only option is to use JDT's AST instead of reflection (this is already done by the BeansConfigValidator). But this means re-implementing the Spring's auto-wiring stuff. Here I don't know how complex this would be.
I have to investigate. But currently I have no spare time left.
Any volunteers?
Cheers,
Torsten
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.