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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -