Bug 8662 RefreshingSCPModuleInfoRegistry synchronized
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / osgi / mapping / RefreshingSCPModuleInfoRegistry.java
index 6217476fa9f0b3da97c1c39c829c24016233317e..fcde347881b41df99f32e5e94e23b5a548cc8fe0 100644 (file)
@@ -51,8 +51,8 @@ public class RefreshingSCPModuleInfoRegistry implements ModuleInfoRegistry, Auto
             .registerService(SchemaContextProvider.class, schemaContextProvider, new Hashtable<String, String>());
     }
 
-    public void updateService() {
-        if(this.osgiReg != null) {
+    public synchronized void updateService() {
+        if (this.osgiReg != null) {
             try {
                 this.bindingContextProvider.update(this.classLoadingStrat, this.schemaContextProvider);
 
@@ -75,8 +75,8 @@ public class RefreshingSCPModuleInfoRegistry implements ModuleInfoRegistry, Auto
     }
 
     @Override
-    public void close() throws Exception {
-        if(this.osgiReg != null) {
+    public synchronized void close() throws Exception {
+        if (this.osgiReg != null) {
             this.osgiReg.unregister();
         }