Marten Deinum opened SPR-12116 and commented
Recently we need to add support to load properties from a database and make those available to the Environment. Although not that hard (we used an ApplicationContextInitializer and added some PropertySources) it still requires some knowledge of the Spring Framework infrastructure.
Would it be possible to introdudce a loader attribute on the @PropertySource annotation in which you could specify a PropertySourcesLoader which in turn contains the strategy for loading that particuliar property source. The code from ConfigurationClassParser could load/instantiate this loader and delegate loading to it. A default implementation containing the current loading strategy could be added.
This would also allow for easier loading of for instance yaml, xml or json files.
Issue Links:
2 votes, 5 watchers
Marten Deinum opened SPR-12116 and commented
Recently we need to add support to load properties from a database and make those available to the
Environment. Although not that hard (we used anApplicationContextInitializerand added somePropertySources) it still requires some knowledge of the Spring Framework infrastructure.Would it be possible to introdudce a
loaderattribute on the@PropertySourceannotation in which you could specify aPropertySourcesLoaderwhich in turn contains the strategy for loading that particuliar property source. The code fromConfigurationClassParsercould load/instantiate this loader and delegate loading to it. A default implementation containing the current loading strategy could be added.This would also allow for easier loading of for instance yaml, xml or json files.
Issue Links:
@Configurationclasses ("duplicates")2 votes, 5 watchers