public interface BroadleafSharedOverrideProfileAwarePropertySource
Holder for a folder of properties resources comprised of something like the following on the classpath:
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:
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
DefaultRuntimeEnvironmentProfileAwarePropertySource}
,
BroadleafEnvironmentConfiguringApplicationListener}
,
FrameworkCommonClasspathPropertySource}
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ORDER |
Modifier and Type | Method and Description |
---|---|
String |
getClasspathFolder()
The folder on the classpath that contains a
common.properties file. |
static final int DEFAULT_ORDER
String getClasspathFolder()
common.properties
file. Note that this cannot be prefixed with "classpath:"
or any of those
varieties since this drives the creation of an ClassPathResource
already based on this location.Copyright © 2022. All rights reserved.