tags:

views:

46

answers:

1

Hey,

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() .

A: 

It turned out that the most preferable way of doing that was GenericBeanDefinition and GenericBeanDefinition.setPropertyValues(MutablePropertyValues propertyValues) and it's registering into an application context...

lisak