Enhancement in switch configuration
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / ComponentActivatorAbstractBase.java
index 88a829ba0464ab7c57e2c0d320666df78d2a7175..de77837c34a1472249b7fe69cd9ac64d10ba129a 100644 (file)
@@ -32,7 +32,6 @@ import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.ServiceDependency;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -45,7 +44,6 @@ abstract public class ComponentActivatorAbstractBase implements
         BundleActivator, IContainerAware {
     Logger logger = LoggerFactory
             .getLogger(ComponentActivatorAbstractBase.class);
-    private ServiceRegistration containerAwareRegistration;
     private DependencyManager dm;
     private ConcurrentMap<ImmutablePair<String, Object>, Component> dbInstances = (ConcurrentMap<ImmutablePair<String, Object>, Component>) new ConcurrentHashMap<ImmutablePair<String, Object>, Component>();
     private ConcurrentMap<Object, Component> dbGlobalInstances = (ConcurrentMap<Object, Component>) new ConcurrentHashMap<Object, Component>();
@@ -154,6 +152,11 @@ abstract public class ComponentActivatorAbstractBase implements
 
         @Override
         public void stopped(Component component) {
+            // do nothing
+        }
+
+        @Override
+        public void stopping(Component component) {
             if (component == null) {
                 return;
             }
@@ -162,11 +165,6 @@ abstract public class ComponentActivatorAbstractBase implements
                     { Component.class }, {} }, new Object[][] { { component },
                     {} });
         }
-
-        @Override
-        public void stopping(Component component) {
-            // do nothing
-        }
     }
 
     /**
@@ -358,7 +356,7 @@ abstract public class ComponentActivatorAbstractBase implements
             }
 
             // Register with OSGi the provider for the service IContainerAware
-            this.containerAwareRegistration = context.registerService(
+            context.registerService(
                     IContainerAware.class.getName(), this, null);
 
             // Now call the derived class init function