Midnight to think about the leak, Spring in the container after the processor

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.