Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 2.44 KB

framework-spring-auto-reconfiguration.md

File metadata and controls

31 lines (24 loc) · 2.44 KB

Spring Auto Reconfiguration Framework

The Spring Auto Reconfiguration Framework causes an application to be automatically reconfigured to work with configured cloud services.

Detection CriterionExistence of a spring-core*.jar file in the application directory
Tagsspring-auto-reconfiguration-<version>
Tags are printed to standard output by the buildpack detect script

If a /WEB-INF/web.xml file exists, the framework will modify it in addition to making the auto reconfiguration JAR available on the classpath. These modifications include:

  1. Augmenting contextConfigLocation. The function starts be enumerating the current contextConfigLocations. If none exist, a default configuration is created with /WEB-INF/application-context.xml or /WEB-INF/<servlet-name>-servlet.xml as the default. An additional location is then added to the collection of locations; classpath:META- INF/cloud/cloudfoundry-auto-reconfiguration-context.xml if the ApplicationContext is XML-based, org.cloudfoundry.reconfiguration.spring.web.CloudAppAnnotationConfigAutoReconfig if the ApplicationContext is annotation-based.
  2. Augmenting contextInitializerClasses. The function starts by enumerating the current contextInitializerClasses. If none exist, a default configuration is created with no value as the default. The org.cloudfoundry.reconfiguration.spring.CloudApplicationContextInitializer class is then added to the collection of classes.

Configuration

The container can be configured by modifying the [config/springautoreconfiguration.yml][springgautoreconfiguration_yml] file. The container uses the Repository utility support and so it supports the version syntax defined there.

Name Description
repository_root The URL of the Auto Reconfiguration repository index (details).
version The version of Auto Reconfiguration to use. Candidate versions can be found in this listing.