I'm wondering how one can do that. Afaik there is BeanFactoryPostProcessor interface that let us use BeanDefinitionRegistry.registerBeanDefinition() method before beans within context are initialized. That method accepts only a class / definition. But usually one needs to register a bean that is already set with properties. Otherwise the bean definition registration itself is kinda useless. I don't want to set it up additionally after I get it from context then.
When using singleton it's ok, but for prototypes I'd have to set the bean up for each getBean() .
© Stack Overflow or respective owner