Thomas Vachuska

Fixed a defect where remotely-induced feature install was trying to stomp over l…

…ocally -induced feature install.

Change-Id: I1cb2c2dd3da03a34b80b1db312056b44cc9c1f9f
...@@ -189,19 +189,22 @@ public class ApplicationManager implements ApplicationService, ApplicationAdminS ...@@ -189,19 +189,22 @@ public class ApplicationManager implements ApplicationService, ApplicationAdminS
189 } 189 }
190 } 190 }
191 191
192 - private void installAppArtifacts(Application app) throws Exception { 192 + // The following methods are fully synchronized to guard against remote vs.
193 + // locally induced feature service interactions.
194 +
195 + private synchronized void installAppArtifacts(Application app) throws Exception {
193 if (app.featuresRepo().isPresent()) { 196 if (app.featuresRepo().isPresent()) {
194 featuresService.addRepository(app.featuresRepo().get()); 197 featuresService.addRepository(app.featuresRepo().get());
195 } 198 }
196 } 199 }
197 200
198 - private void uninstallAppArtifacts(Application app) throws Exception { 201 + private synchronized void uninstallAppArtifacts(Application app) throws Exception {
199 if (app.featuresRepo().isPresent()) { 202 if (app.featuresRepo().isPresent()) {
200 featuresService.removeRepository(app.featuresRepo().get()); 203 featuresService.removeRepository(app.featuresRepo().get());
201 } 204 }
202 } 205 }
203 206
204 - private void installAppFeatures(Application app) throws Exception { 207 + private synchronized void installAppFeatures(Application app) throws Exception {
205 for (String name : app.features()) { 208 for (String name : app.features()) {
206 Feature feature = featuresService.getFeature(name); 209 Feature feature = featuresService.getFeature(name);
207 if (!featuresService.isInstalled(feature)) { 210 if (!featuresService.isInstalled(feature)) {
...@@ -210,7 +213,7 @@ public class ApplicationManager implements ApplicationService, ApplicationAdminS ...@@ -210,7 +213,7 @@ public class ApplicationManager implements ApplicationService, ApplicationAdminS
210 } 213 }
211 } 214 }
212 215
213 - private void uninstallAppFeatures(Application app) throws Exception { 216 + private synchronized void uninstallAppFeatures(Application app) throws Exception {
214 for (String name : app.features()) { 217 for (String name : app.features()) {
215 Feature feature = featuresService.getFeature(name); 218 Feature feature = featuresService.getFeature(name);
216 if (featuresService.isInstalled(feature)) { 219 if (featuresService.isInstalled(feature)) {
......