[MAGNOLIA-6634] Make magnolia configuration properties accessible during module-load phase Created: 14/Apr/16 Updated: 09/Feb/17 Resolved: 09/May/16 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 5.4.5 |
| Fix Version/s: | 5.4.7, 5.5 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Espen Jervidalo | Assignee: | Espen Jervidalo |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 0.25d | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Template: |
|
||||
| Acceptance criteria: |
Empty
|
||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||
| Date of First Response: | |||||
| Sprint: | Basel 43 | ||||
| Story Points: | 3 | ||||
| Description |
|
Module descriptors have the ability to define configuration-properties read by the system and exposed by info.magnolia.init.MagnoliaConfigurationProperties. By Introducing light-module-descriptors read from the resources-directory defined in magnolia.properties we introduce a circular dependency between module-descriptor loading and properties-loading. Light-modules are dependent on the magnolia configuration properties being present, to obtain the resources-path and the configuration properties are dependent on the module descriptors being present. There are several approaches to fix this:
As DefaultMagnoliaConfigurationProperties already imposes an order in which the sources are "overriden" I tend to go for the lazy-loading mechanism. It's less invasive than introducing a second, stripped down implementation, which would need to re-order the sources somehow. OTOH the circular dependency conceptually remains. This topic was discussed in Arch-meeting w/ mgeljic, apchelintcev and pmundt. Update: Decision was made to go with the second approach. Introduced an info.magnolia.init.InitPhaseMagnoliaConfigurationProperties which loads the properties from info.magnolia.init.MagnoliaInitPaths and info.magnolia.init.MagnoliaPropertiesResolver. Bound to the platform-components. During startup the default implementation will be bound to the system-components by core-module. |