I am able to construct a domain object instance as follows:
This works fine, being autowired correctly and BeanPostProcessors being called on the instance. However, I'd like to have DefaultAdvisorAutoProxyCreator (DAAPC) process the instance as well, as I have a security-related Advisor defined in the context. Debug logging suggests DAAPC never gets called, although it is called for standard container-managed beans created during initialization and implements BeanPostProcessor. I did notice the package note, "autoproxying is not supported for BeanFactory implementations, as post-processing is automatic only for application contexts", which may be related.Code:Person person = (Person) acbf.autowire(Person.class, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, false); Person person2 = (Person) acbf.applyBeanPostProcessorsBeforeInitialization(person, "person"); person2.debug();
Would someone please elaborate on how to get DAAPC to process domain object instances?


Reply With Quote