I was wondering if someone here would be kind enough to clear up my confusion about auto wiring.
What I'd like to do is specify the fields I want to auto wire with @Autowired, but have them wired by name, rather than type, or @Qualifier("bla").
Looking at the Spring code, it seems that something like this is possible:
but I don't understand how to invoke the processing of @Configurable annotations. It seems that I somehow need to utilize the BeanConfigurerSupport class, but it's not obvious to me how to do that. The comments say something about AspectJ integration?Code:@Configurable(autowire=Autowire.BY_TYPE) public class MyClass() { ... }
I tried setting the AUTOWIRE_BY_NAME mode on the BeanDefinition directly with a MergedBeanDefinitionPostProcessor, but this mechanism seems to not actually look at the @Autowired annotations, but rather just goes after all PropertyDescriptors on the bean.
So, is it possible to do what I'm trying to do?


Reply With Quote
