Merge "Migrating caches to TRANSACTIONAL Caches and enabled use1PcForAutoCommitTransa...
[controller.git] / opendaylight / switchmanager / implementation / src / main / java / org / opendaylight / controller / switchmanager / internal / Activator.java
index 2420d609b7c2363b415de4e77aeb659a8806097d..e81b4cd27e9d2713db0c787eebdb27531d04de28 100644 (file)
@@ -15,12 +15,12 @@ import java.util.Hashtable;
 import java.util.Set;
 
 import org.apache.felix.dm.Component;
-import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
 import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
 import org.opendaylight.controller.sal.inventory.IInventoryService;
 import org.opendaylight.controller.sal.inventory.IListenInventoryUpdates;
+import org.opendaylight.controller.statisticsmanager.IStatisticsManager;
 import org.opendaylight.controller.switchmanager.IInventoryListener;
 import org.opendaylight.controller.switchmanager.ISpanAware;
 import org.opendaylight.controller.switchmanager.ISwitchManager;
@@ -43,6 +43,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * ComponentActivatorAbstractBase.
      *
      */
+    @Override
     public void init() {
 
     }
@@ -52,6 +53,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * cleanup done by ComponentActivatorAbstractBase
      *
      */
+    @Override
     public void destroy() {
 
     }
@@ -65,6 +67,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * instantiated in order to get an fully working implementation
      * Object
      */
+    @Override
     public Object[] getImplementations() {
         Object[] res = { SwitchManager.class };
         return res;
@@ -83,18 +86,14 @@ public class Activator extends ComponentActivatorAbstractBase {
      * also optional per-container different behavior if needed, usually
      * should not be the case though.
      */
+    @Override
     public void configureInstance(Component c, Object imp, String containerName) {
         if (imp.equals(SwitchManager.class)) {
-            Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
-            Set<String> propSet = new HashSet<String>();
-            propSet.add("switchmanager.configSaveEvent");
-            props.put("cachenames", propSet);
             // export the service
             c.setInterface(new String[] {
                     IListenInventoryUpdates.class.getName(),
                     ISwitchManager.class.getName(),
-                    ICacheUpdateAware.class.getName(),
-                    IConfigurationContainerAware.class.getName() }, props);
+                    IConfigurationContainerAware.class.getName() }, null);
 
             // Now lets add a service dependency to make sure the
             // provider of service exists
@@ -102,6 +101,10 @@ public class Activator extends ComponentActivatorAbstractBase {
                     IInventoryService.class).setCallbacks(
                     "setInventoryService", "unsetInventoryService")
                     .setRequired(false));
+            c.add(createContainerServiceDependency(containerName).setService(
+                    IStatisticsManager.class).setCallbacks(
+                    "setStatisticsManager", "unsetStatisticsManager")
+                    .setRequired(false));
             c.add(createContainerServiceDependency(containerName).setService(
                     ISwitchManagerAware.class).setCallbacks(
                     "setSwitchManagerAware", "unsetSwitchManagerAware")
@@ -119,4 +122,10 @@ public class Activator extends ComponentActivatorAbstractBase {
                     "unsetClusterContainerService").setRequired(true));
         }
     }
+
+    @Override
+    protected Object[] getGlobalImplementations() {
+        final Object[] res = { SwitchManagerCLI.class };
+        return res;
+    }
 }