@Autowired and bean creation order

wendytango

New Member
Is it possible to avoid @Autowire some beans until other depeandant beans have been created? Let me explain it better with an example:I have a FactoryBean that creates an object of type A that has a property called a. If the property is null it assigns a default value to the bean A.In a @Configuration class I have: @Autowired private A myBean;What is happening is that the factory creates the bean (I don't fully understand how) but the field a in the factory is null and I need that it takes another bean that it's used to create A. I can't add any annotation to the Factory since it's inside of an external dependency.The thing is that I need to set the value of a before the @Autowired requests the object to the factory. Is it possible given the restrictions I have?
 
Back
Top