spring - ImportBeanDefinitionRegistrar vs BeanDefinitionRegistryPostPro -
my use case deals creating beans dynamically. find 2 options register bean definitions: importbeandefinitionregistrar , beandefinitionregistrypostprocessor
i wanted understand difference between two.
thanks, prateek
the beandefinitionregistrat must used @import annotation
@configuration @import(myimportbeandefinitionregistrar.class) public class mainconfiguration { }
while beandefinitionregistrypostprocessor should used that
@bean public static mybeandefinitionregistrypostprocessor mybeandefinitionregistrypostprocessor() { return new mybeandefinitionregistrypostprocessor(); }
however on spring 3.2.16 both fails modify own bean definitions created @bean, seemed called early.
Comments
Post a Comment