public static BeanDefinitionHolder registerBean ( String beanId , BeanDefinition beanDefinition , ParserContext parserContext , boolean shouldFireEvents ) { if ( parserContext . getRegistry ( ) . containsBeanDefinition ( beanId ) ) { return new BeanDefinitionHolder ( parserContext . getRegistry ( ) . getBeanDefinition ( beanId ) , beanId ) ; } BeanDefinitionHolder configurationHolder = new BeanDefinitionHolder ( beanDefinition , beanId ) ; BeanDefinitionReaderUtils . registerBeanDefinition ( configurationHolder , parserContext . getRegistry ( ) ) ; if ( shouldFireEvents ) { BeanComponentDefinition componentDefinition = new BeanComponentDefinition ( configurationHolder ) ; parserContext . registerComponent ( componentDefinition ) ; } return configurationHolder ; }
Registers bean definition in parser registry and returns bean definition holder .