$ cut -d: -f4-5 < t.txt | cut -d] -f2 > startup-classes.txt
* EnvironmentPostProcessor
which allows customization of the Environment object before
the application context is refreshed. There are several
things you can do using the interface. For example, it can
be used to set profiles, set property sources based on the
values from environment variables, as well as validating
environment properties. In this tutorial, I'm going to show
you how to use the interface.
* ApplicationContextInitializer
What is an ApplicationContextInitializer. It is essentially code that gets
executed before the Spring application context gets completely created.
A good use case for using an ApplicationContextInitializer would be
to set a Spring environment profile programmatically
* ImportSelector
can be used for dynamic configuration selection rather than
static @Profile based selection. Spring framework itself uses
ImportSelector at many places to ease the configuration burden
on the client side, for example @EnableAsync, @EnableScheduling
etc @Import annotation can also be configured with an ImportSelector
implementation to select @Configuration classes programmatically,
based on some selection criteria
* DeferredImportSelector
It extends ImportSelector.
The configuration class directly registered with the application
context given preference over imported one. That means a bean of
type T, configured in the main configuration will be used instead
of a bean of the same type T from imported configuration.
That applies to ImportSelector as well. On the other hand,
DeferredImportSelector applies after all other configuration
beans have been processed.
DeferredImportSelector applies configuration after
all @Configuration beans have been processed.
* ImportBeanDefinitionRegistrar
This Interface is to be implemented by types that register add
dditional bean definitions when processing @Configuration classes.
An implementation can be specified with @Import so that add
dditional objects can be registered as Spring beans ddd
uring configuration time.
我们要自己写一个组件,我们要自己管理我们的组件,使用自己的注解管
自己的Bean。 这时候ImportBeanDefinitionRegistrar就登场了!
我们要求把某个包下的类都加到容器、另外呢,我还要加一个自定义注解,
只有在这个包下加了自定义注解的才能被加到容器!
* BeanDefinitionRegistryPostProcessor
Implementation of BeanDefinitionRegistryPostProcessor can be
used to register objects as Spring beans programmatically.
This is a sub-interface of BeanFactoryPostProcessor (last example).
It allows for the registration of bean definitions. It's
method postProcessBeanDefinitionRegistry is called before
BeanFactoryPostProcessor#postProcessBeanFactory. This interface
is more focused on the BeanDefinition registration rather
than general purpose BeanFactoryPostProcessor.
* BeanFactoryPostProcessor
BeanFactoryPostProcessor is an extension point to customize
configuration metadata. This example registers a new
BeanDefinition with beanFactory.
allows client code to customize bean definitions. The method
BeanFactoryPostProcessor.postProcessBeanFactory is called by
Spring startup process just after all bean definitions have
been loaded, but no beans have been instantiated yet.
A BeanFactoryPostProcessor lets you modify the actual bean
definition instead of the instance as it’s created. The
PropertyResourceConfigurer and PropertyPlaceholderConfigurer
are two very useful BeanFactoryPostProcessors. Creatinng
out custom Factory post processor:
* BeanPostProcessor
gives you a chance to process an instance of a bean created
by the IoC container after it’s instantiation and then again
after the initialization lifecycle event has occurred on
the instance. BeanPostProcessor and any beans they depend on
are instantiated before any other beans in the container. After
they are instantiated and ordered, they are used to process
all the other beans as they are instantiated by the IoC container.
Spring’s different AOP proxies for caching, transactions, etc.
are all applied by BeanPostProcessors.
This converter should be registered as a Spring Bean and
should also be annotated with @ConfigurationPropertiesBinding
which is a Qualifier annotation. The
ConfigurationPropertiesBindingPostProcessor is responsible to
bind all external properties to the beans annotated with
@ConfigurationProperties. This BeanPostProcessor also detects
custom converters (besides the default ones) annotated
with @ConfigurationPropertiesBinding for type conversion.
-
Further read
- https://xinchen.blog.csdn.net/article/details/105061662?spm=1001.2014.3001.5502
- https://segmentfault.com/u/lenve/articles?sort=newest
- https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzI1NDY0MTkzNQ==&action=getalbum&album_id=2369296394722934787&scene=173&from_msgid=2247505235&from_itemidx=1&count=3&nolastread=1#wechat_redirect
- https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzI1NDY0MTkzNQ==&action=getalbum&album_id=2107713769630941184&scene=173&from_msgid=2247505235&from_itemidx=1&count=3&nolastread=1#wechat_redirect
- https://www.cnblogs.com/dongguangming/category/1688134.html
-
Auto-configuration in Spring Boot
-
ImportBeanDefinitionPostRegistrar
-
Bean Definition
-
Ways to register bean - good article
-
Spring中@Import的三种情况
-
Spring IOC 容器源码分析
-
Spring AOP 源码解析
-
Spring MVC
-
https://blog.csdn.net/qq1049545450/article/details/112957659?spm=1001.2014.3001.5502
-
https://blog.csdn.net/qq1049545450/article/details/112977838 (contains a nice start up diagram)
-
https://blog.csdn.net/qq1049545450/article/details/113104783
-
https://blog.csdn.net/yiding124/article/details/121475769?spm=1001.2014.3001.5502
-
how spring work: https://blog.csdn.net/dong19891210/article/details/106324879?spm=1001.2014.3001.5502
-
how import works: https://blog.csdn.net/dong19891210/article/details/106346447 (good)
-
enable: https://blog.csdn.net/dong19891210/article/details/105931356
-
create bean: https://blog.csdn.net/dong19891210/article/details/105798650
-
how enableautoconfiguration works: https://www.javadevjournal.com/spring-boot/how-spring-boot-auto-configuration-works/
-
how spring boot auto configuration works: https://dzone.com/articles/how-springboot-autoconfiguration-magic-works
-
Very good - Spring Boot - How auto configuration works? https://www.logicbig.com/tutorials/spring-framework/spring-boot/auto-config-mechanism.html
-
how spring boot works: https://www.marcobehler.com/guides/spring-boot-autoconfiguration
-
how spring security: https://www.marcobehler.com/guides/spring-security
-
how oauth: https://www.marcobehler.com/guides/spring-security-oauth2
-
How spring boot auto configuration works: https://thepracticaldeveloper.com/spring-boot-autoconfiguration/ (good)
-
- SpringBoot扩展点之EnvironmentPostProcessor: https://blog.csdn.net/dong19891210/article/details/106436364?spm=1001.2101.3001.6650.5&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-5-106436364-blog-121534204.235%5Ev38%5Epc_relevant_sort_base3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-5-106436364-blog-121534204.235%5Ev38%5Epc_relevant_sort_base3&utm_relevant_index=10
- Spring boot如何工作 https://blog.csdn.net/dong19891210/article/details/106324879?spm=1001.2014.3001.5502
- https://www.logicbig.com/how-to/spring-framework.html
- https://www.logicbig.com/how-to/spring-boot.html
- https://www.logicbig.com/tutorials/spring-framework/spring-boot.html
- https://www.logicbig.com/tutorials/spring-framework.html
- https://www.logicbig.com/tutorials/spring-framework/spring-core.html
- https://www.logicbig.com/tutorials/spring-framework/spring-core/alias-for-annotation.html
- https://www.logicbig.com/tutorials/spring-framework/spring-core/import-bean-registrar.html
- https://www.logicbig.com/tutorials/spring-framework/spring-core/deferred-import-selector.html
- https://www.logicbig.com/tutorials/spring-framework/spring-core/import-selector.html
- https://www.logicbig.com/tutorials/spring-framework/spring-core/bean-definition.html
- https://www.logicbig.com/tutorials/spring-framework/spring-core.html
- how auto configuration works: https://www.logicbig.com/tutorials/spring-framework/spring-boot/auto-config-mechanism.html
- why all methods will return the same instance at multiple calls : https://www.logicbig.com/tutorials/spring-framework/spring-core/java-config.html
- https://www.logicbig.com/how-to/code-snippets/jcode-spring-framework-importbeandefinitionregistrar.html
- https://github.com/mbhave/non-magic-demo.git
Springboot2.0.3 release.jar
spring.factories
////////////////////////////////////////////////////////////////////////////////////////////
# PropertySource Loaders
org.springframework.boot.env.PropertySourceLoader=\
org.springframework.boot.env.PropertiesPropertySourceLoader,\
org.springframework.boot.env.YamlPropertySourceLoader
# Run Listeners----->第一个启动的Listener
org.springframework.boot.SpringApplicationRunListener=\
org.springframework.boot.context.event.EventPublishingRunListener
# Error Reporters
org.springframework.boot.SpringBootExceptionReporter=\
org.springframework.boot.diagnostics.FailureAnalyzers
# Application Context Initializers
org.springframework.context.ApplicationContextInitializer=\
org.springframework.boot.context.ConfigurationWarningsApplicationContextInitializer,\
org.springframework.boot.context.ContextIdApplicationContextInitializer,\
org.springframework.boot.context.config.DelegatingApplicationContextInitializer,\
org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer
# Application Listeners
org.springframework.context.ApplicationListener=\
org.springframework.boot.ClearCachesApplicationListener,\
org.springframework.boot.builder.ParentContextCloserApplicationListener,\
org.springframework.boot.context.FileEncodingApplicationListener,\
org.springframework.boot.context.config.AnsiOutputApplicationListener,\
org.springframework.boot.context.config.ConfigFileApplicationListener,\
org.springframework.boot.context.config.DelegatingApplicationListener,\
org.springframework.boot.context.logging.ClasspathLoggingApplicationListener,\
org.springframework.boot.context.logging.LoggingApplicationListener,\
org.springframework.boot.liquibase.LiquibaseServiceLocatorApplicationListener
# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor,\
org.springframework.boot.env.SpringApplicationJsonEnvironmentPostProcessor,\
org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor
# Failure Analyzers
org.springframework.boot.diagnostics.FailureAnalyzer=\
org.springframework.boot.diagnostics.analyzer.BeanCurrentlyInCreationFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.BeanNotOfRequiredTypeFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.BindFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.BindValidationFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.UnboundConfigurationPropertyFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.ConnectorStartFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.NoUniqueBeanDefinitionFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.PortInUseFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.ValidationExceptionFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.InvalidConfigurationPropertyNameFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.InvalidConfigurationPropertyValueFailureAnalyzer
# FailureAnalysisReporters
org.springframework.boot.diagnostics.FailureAnalysisReporter=\
org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter