Before I learned Spring, I hadn't heard of the container processor, but once it was written, it felt familiar.
The container configurator is typically used to process the Spring container and always reads the metadata in the configuration file before the container instantiates any other beans, and it is possible to modify the data.
Spring provides several commonly used container post processors:
- Propertyplaceholderconfigurer: Property Placeholder Configurator
- Propertyoverrideconfigurer: Overriding Placeholder Configurator
- Customautowireconfigurer: Custom Auto-Assembled Configurator
- Customscopeconfigurer: Custom Scope Configurator
1. Property Placeholder Configurator
When I see this propertyplaceholdconfigurer, I think most of them will think of this tag:
<location= "Classpath:xx.properties">
Yes, this is the simplified configuration of the propertyplaceholderconfigurer after the Scheme style, and the following is the original configuration of the processor after the Bean is written:
<Beanclass= "Org.springframework.bean.factory.config.PropertyPlaceholderConfigurer"> < Propertyname= "Locations"> <List> <!--Here is the configuration file, if there are more than one, you can configure multiple - <value>Dbconn.properties</value> </List> </ Property></Bean>
2. overriding Placeholder Configurator
Overriding the role of the placeholder configurator:
As a first step, this rewrite placeholder Configurator should also have a simplified version of Scheme form:
1
Midnight to think about the leak, Spring in the container after the processor