Oct 24th, 2010, 04:46 AM
Trying to figure out AutowireCapableBeanFactory, but docs are a little ambiguous...
I'm working on integrating a custom persistence layer with spring, and looking at how to inject dependencies into beans created by the persistence engine. It looks to me like the way of doing this is using the AutowireCapableBeanFactory that the ApplicationContext can provide, but I'm not quite sure how it works... hopefully somebody here will be able to answer my question pretty easily.
Basically, I need to take a newly created object, autowire it, process any annotations it may have requesting specific values, and perform all other standard post processing (applying AOP proxies, etc.). I'm not quite sure which method(s) of AutowireCapableBeanFactory I should be using.
It looks from the documentation as though initializeBean() is what I'm looking for, but it isn't clear whether this will perform autowiring, or whether I should also call autowireBean() (and if so, whether I should call that before or after initializing it).
It also isn't clear from the docs whether any of these methods will work with @Value or similar annotations; I presume they will (assuming this is considered just another case of autowiring), but perhaps this should be made explicit?
Tags for this Thread