Migrate bundles' configuration mgmt to ConfigurationService
[controller.git] / opendaylight / forwarding / staticrouting / src / main / java / org / opendaylight / controller / forwarding / staticrouting / internal / Activator.java
index a4397537486e738b482184ab6dc768270594e413..7be9c2367721717f41728356eff9fa7b815cf1a5 100644 (file)
@@ -9,11 +9,6 @@
 
 package org.opendaylight.controller.forwarding.staticrouting.internal;
 
-import java.util.Dictionary;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Set;
-
 import org.apache.felix.dm.Component;
 import org.opendaylight.controller.forwarding.staticrouting.IForwardingStaticRouting;
 import org.opendaylight.controller.forwarding.staticrouting.IStaticRoutingAware;
@@ -23,6 +18,7 @@ import org.slf4j.LoggerFactory;
 
 import org.opendaylight.controller.clustering.services.IClusterContainerServices;
 import org.opendaylight.controller.configuration.IConfigurationContainerAware;
+import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.hosttracker.IfIptoHost;
 import org.opendaylight.controller.hosttracker.IfNewHostNotify;
 
@@ -30,24 +26,6 @@ public class Activator extends ComponentActivatorAbstractBase {
     protected static final Logger logger = LoggerFactory
             .getLogger(Activator.class);
 
-    /**
-     * Function called when the activator starts just after some
-     * initializations are done by the
-     * ComponentActivatorAbstractBase.
-     *
-     */
-    public void init() {
-
-    }
-
-    /**
-     * Function called when the activator stops just before the
-     * cleanup done by ComponentActivatorAbstractBase
-     *
-     */
-    public void destroy() {
-
-    }
 
     /**
      * Function that is used to communicate to dependency manager the
@@ -58,6 +36,7 @@ public class Activator extends ComponentActivatorAbstractBase {
      * instantiated in order to get an fully working implementation
      * Object
      */
+    @Override
     public Object[] getImplementations() {
         Object[] res = { StaticRoutingImplementation.class };
         return res;
@@ -76,6 +55,7 @@ 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(StaticRoutingImplementation.class)) {
             c.setInterface(new String[] {
@@ -97,6 +77,11 @@ public class Activator extends ComponentActivatorAbstractBase {
                     IStaticRoutingAware.class).setCallbacks(
                     "setStaticRoutingAware", "unsetStaticRoutingAware")
                     .setRequired(false));
+
+            c.add(createContainerServiceDependency(containerName).setService(
+                    IConfigurationContainerService.class).setCallbacks(
+                    "setConfigurationContainerService",
+                    "unsetConfigurationContainerService").setRequired(true));
         }
     }
 }