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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -