Deterministic startup for resourceSourceMappings 87/72587/1
authorAlexis de Talhouët <adetalhouet89@gmail.com>
Tue, 13 Nov 2018 21:49:57 +0000 (16:49 -0500)
committerAlexis de Talhouët <adetalhouet89@gmail.com>
Tue, 13 Nov 2018 21:49:57 +0000 (16:49 -0500)
also fix a typo in property name

resourceSourceMappings is required for loading the resources
(templates, DDs, blueprint), but the bean initializing its values
was getting instantiated after the resources loading process, ending
 up failing loading the resources.

Mkaing DataBaseInitService dependent on the ApplicationRegistrationService
bean will force SpringBoot to have the dependsOn bean loaded before the one
declaring the dependency.

Change-Id: Id9781057132ddab51ed5a79143d92436304e6b55
Issue-ID: CCSDK-650
Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/ApplicationRegistrationService.java

index d7f22e6..4d2d93d 100644 (file)
@@ -35,10 +35,7 @@ public class ApplicationRegistrationService {
     @Value("#{'${resourceSourceMappings}'.split(',')}")\r
     private List<String> resourceSourceMappings;\r
 \r
-    public ApplicationRegistrationService() {\r
-        registerDictionarySources();\r
-    }\r
-\r
+    @PostConstruct\r
     public void registerDictionarySources() {\r
         log.info("Registering Dictionary Sources : {}", resourceSourceMappings);\r
         if (CollectionUtils.isNotEmpty(resourceSourceMappings)) {\r