Merge "Enhanced run.sh"
authorAlessandro Boch <aboch@cisco.com>
Tue, 6 Aug 2013 22:27:17 +0000 (22:27 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 6 Aug 2013 22:27:17 +0000 (22:27 +0000)
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/InventoryService.java
opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/Activator.java
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java

index 9fded15f42383a1edceb436f5c8b010909a6e03b..a5a071122f62d6b0d0df9b45fb1f8b2775aa347e 100644 (file)
@@ -45,7 +45,8 @@ public class InventoryService implements IInventoryShimInternalListener,
         IPluginInInventoryService, IInventoryProvider {
     protected static final Logger logger = LoggerFactory
             .getLogger(InventoryService.class);
-    private Set<IPluginOutInventoryService> pluginOutInventoryServices;
+    private Set<IPluginOutInventoryService> pluginOutInventoryServices =
+            new CopyOnWriteArraySet<IPluginOutInventoryService>();
     private IController controller = null;
     private ConcurrentMap<Node, Map<String, Property>> nodeProps; // properties are maintained in global container only
     private ConcurrentMap<NodeConnector, Map<String, Property>> nodeConnectorProps; // properties are maintained in global container only
@@ -82,7 +83,6 @@ public class InventoryService implements IInventoryShimInternalListener,
 
         nodeProps = new ConcurrentHashMap<Node, Map<String, Property>>();
         nodeConnectorProps = new ConcurrentHashMap<NodeConnector, Map<String, Property>>();
-        pluginOutInventoryServices = new CopyOnWriteArraySet<IPluginOutInventoryService>();
     }
 
     /**
@@ -112,6 +112,7 @@ public class InventoryService implements IInventoryShimInternalListener,
      */
     void stop() {
         logger.trace("STOP called!");
+        pluginOutInventoryServices.clear();
     }
 
     public void setPluginOutInventoryServices(IPluginOutInventoryService service) {
@@ -228,8 +229,9 @@ public class InventoryService implements IInventoryShimInternalListener,
 
     private void removeNode(Node node) {
         logger.trace("{} removed", node);
-        if (nodeProps == null)
+        if (nodeProps == null) {
             return;
+        }
 
         // update local cache
         nodeProps.remove(node);
@@ -252,8 +254,8 @@ public class InventoryService implements IInventoryShimInternalListener,
 
     private void updateNode(Node node, Set<Property> properties) {
         logger.trace("{} updated, props: {}", node, properties);
-        if (nodeProps == null || !nodeProps.containsKey(node) ||
-                properties == null || properties.isEmpty()) {
+        if ((nodeProps == null) || !nodeProps.containsKey(node) ||
+                (properties == null) || properties.isEmpty()) {
             return;
         }
 
index fc9b9e2df48dae7e1dda300c113c5c1470a23ebf..c3afae90f8ae32785ab927c13282a05cd53b2437 100644 (file)
@@ -102,7 +102,7 @@ public class Activator extends ComponentActivatorAbstractBase {
             c.add(createServiceDependency()
                     .setService(IPluginInInventoryService.class, "(scope=Global)")
                     .setCallbacks("setPluginService", "unsetPluginService")
-                    .setRequired(true));
+                    .setRequired(false));
         }
     }
 
index 0705984bfe334b0eaff2ef2a0c3675c615ec3821..f50f303a3f6b07dd325bc4d488d86092499b61a8 100644 (file)
@@ -636,7 +636,7 @@ CommandProvider {
         }
 
         for (SwitchConfig conf : confList.values()) {
-            updateSwitchConfig(conf);
+            updateNodeConfig(conf);
         }
     }