Interface BroadleafSharedOverrideProfileAwarePropertySource
- All Known Implementing Classes:
DefaultRuntimeEnvironmentProfileAwarePropertySource
Holder for a folder of properties resources comprised of something like the following on the classpath:
- classpath:/runtime-properties/
- common.properties
- common-shared.properties
- [profile].properties
- [profile]-shared.properties
Where the [profile] is a key that is resolved from the current Spring profile. Given that set of properties, they get ordered in the following way, where later files are applied after earlier ones and thus take precedence:
- classpath:/runtime-properties/
- common-shared.properties
- common.properties
- [profile]-shared.properties
- [profile].properties
Note that this is largely created to support existing Broadleaf implementations for versions older than 5.2. Assuming that you are on Spring Boot, you should look to
use application.properties
variants from
the Spring Boot documentation
There is generally only a single one of these sources registered in the application, the DefaultRuntimeEnvironmentProfileAwarePropertySource
. If multiple of them
are registered, they are ordered based on #getOrder()
and all properties are added to the Environment
prior to moving to the next
BroadleafSharedOverrideProfileAwarePropertySource
. To register your own version (again, not necessarily recommended) add this as an entry in a META-INF/spring.factories
file:
org.broadleafcommerce.common.config.BroadleafSharedOverrideProfileAwarePropertySource=org.broadleafcommerce.common.config.SomeCustomizedProfileAwarePropertySource
Properties registered via this BroadleafSharedOverrideProfileAwarePropertySource
is functionally equivalent to registering them via PropertySource
and have the same ordering
semantics as
"@PropertySource annotations on your @Configuration classes.
An important distinction is that these sources have a higher priority than any PropertySource
annotations on @Configuration classes.
These are guaranteed to take a higher precedence (and thus override) properties registered via FrameworkCommonClasspathPropertySource
- Since:
- 5.2
- Author:
- Phillip Verheyden (phillipuniverse)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionThe folder on the classpath that contains acommon.properties
file.
-
Field Details
-
DEFAULT_ORDER
static final int DEFAULT_ORDER- See Also:
-
-
Method Details
-
getClasspathFolder
String getClasspathFolder()The folder on the classpath that contains acommon.properties
file. Note that this cannot be prefixed with"classpath:"
or any of those varieties since this drives the creation of anClassPathResource
already based on this location.
-