BeanPostProcessor implementation for customized annotation that annotated injected-object.BeanDefinition UtilitiesBeanDefinitionRegistryPostProcessor, which will execute two main registration
methods orderly:
registerPrimaryBeanDefinitions(ExposingClassPathBeanDefinitionScanner, String[]) : Scan and register
the primary BeanDefinitions that were annotated by
the supported annotation types, and then return the Map with bean name plus
aliases if present and primary AnnotatedBeanDefinitions,
it's allowed to be override
registerSecondaryBeanDefinitions(ExposingClassPathBeanDefinitionScanner, Map, String[]) :
it's mandatory to be override by the sub-class to register secondary BeanDefinitions
if required
AbstractAnnotationBeanPostProcessor as the substitutionAnnotation UtilitiesConfigurationBeanBindingPostProcessorBeanFactory Utilities classEnvironment to Configuration bean under specified prefix.Class UtilitiesBeanPostProcessor class to bind the configuration beanImportBeanDefinitionRegistrar implementation for @EnableConfigurationBindingRegistrar class for EnableConfigurationBeanBindingsits binding.ConversionService that may be retrieved from Spring
built-in bean or create a new one.DefaultFormattingConversionService as the default,
this method is allow to be override by the sub-class.EnableConfigurationBeanBinding.ignoreInvalidFields()EnableConfigurationBeanBinding.ignoreUnknownFields()EnableConfigurationBeanBinding.multiple()ConfigurationBeanBinder implementationAbstractApplicationContext is an implementation of ApplicationEventPublisher
can't handle the early event that is published
before ApplicationEventMulticaster's initialization, in this scenario, DeferredApplicationEventPublisher
is introduced and used to resolve DeferredApplicationEventPublisher.publishEvent(ApplicationEvent) too early
to publish ApplicationEvent when Spring ApplicationContexts' ApplicationEventMulticaster is not ready.AnnotationAttributesClassproperties.EnableConfigurationBeanBindingsClassPathBeanDefinitionScanner to expose some methods:
ClassPathBeanDefinitionScanner.doScan(String...)Field UtilitiesAnnotation type maps from MethodSet of BeanDefinitionHoldersBeanPostProcessor AdapterAnnotationAttributesAnnotationAttributesAnnotationAttributesAnnotationAttributesAnnotationAttributesAnnotationAttributes, if the argument tryMergedAnnotation is true,
the AnnotationAttributes will be got from
merged annotation first,
if failed, and then to get from
normal oneAnnotationAttributes, if the argument tryMergedAnnotation is true,
the AnnotationAttributes will be got from
merged annotation first,
if failed, and then to get from
normal oneAnnotation attributesAnnotation attributesAnnotation attributesListableBeanFactory by type.ListableBeanFactory by type.ListableBeanFactory by type.ListableBeanFactory by type.BeanFactoryList of ConfigurationBeanCustomizersField ValueField ValueField ValueMap in injected field.Map in injected field.Map in injected method.Map in injected method.annotation attributes and Bean Classannotation and Bean ClassClass including ancestors(BeanFactory).Class.PropertySource instance.ListableBeanFactory in specified bean type.PropertiesPropertiesPropertiesPropertiesPropertyValues from ConfigurableEnvironmentAliasRegistryAnnotation present on Method's declaring class or parameters or itself.ApplicationContextEventApplicationListener for ApplicationEvent guarantees just one-time execution
and prevents the event propagation in the hierarchical ApplicationContextsBean with name without return value after initialization,
This method will be invoked by BeanPostProcessor#postProcessAfterInitialization(Object, String)Bean with name without return value before initialization,
This method will be invoked by BeanPostProcessor#postProcessBeforeInitialization(Object, String)PropertySources UtilitiesPropertyValues UtilitiesregistryBeanDefinitions that were annotated by
the supported annotation types, and then return the Map with bean name plus
aliases if present and primary AnnotatedBeanDefinitions.BeanDefinitions
Current method is allowed to be override by the sub-class to change the registration logicSpringFactoriesLoaderConfigurationClassPostProcessor.componentScanBeanNameGenerator,
thus it maybe a potential problem on bean name generation.ConversionService has been resolved@ComponentsMap via AnnotationAwareOrderComparator.sort(List) ruleannotationannotationthe annotation attributes after merging and resolving the placeholdersthe annotation attributes after merging and resolving the placeholdersBeanFactory to ConfigurableListableBeanFactoryEnvironment to ConfigurableEnvironmentCopyright © 2020. All rights reserved.