X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcore%2FComponentActivatorAbstractBase.java;h=de77837c34a1472249b7fe69cd9ac64d10ba129a;hb=0007635e8377230bf3befc836f1e05b6e075251b;hp=d04e67b304666c88c840e7733aeeb53d5e29a1d2;hpb=42210c03b0a4c54706320ba9f55794c0abd4d201;p=controller.git diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/ComponentActivatorAbstractBase.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/ComponentActivatorAbstractBase.java index d04e67b304..de77837c34 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/ComponentActivatorAbstractBase.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/ComponentActivatorAbstractBase.java @@ -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, Component> dbInstances = (ConcurrentMap, Component>) new ConcurrentHashMap, Component>(); private ConcurrentMap dbGlobalInstances = (ConcurrentMap) new ConcurrentHashMap(); @@ -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 - } } /** @@ -178,7 +176,7 @@ abstract public class ComponentActivatorAbstractBase implements public void containerCreate(String containerName) { try { Object[] imps = getImplementations(); - logger.trace("Creating instance " + containerName); + logger.trace("Creating instance {}", containerName); if (imps != null) { for (int i = 0; i < imps.length; i++) { ImmutablePair key = new ImmutablePair( @@ -193,9 +191,8 @@ abstract public class ComponentActivatorAbstractBase implements // Set the implementation so the component can manage // its lifecycle if (c.getService() == null) { - logger - .trace("Setting implementation to:" - + imps[i]); + logger.trace("Setting implementation to: {}", + imps[i]); c.setImplementation(imps[i]); } @@ -246,7 +243,7 @@ abstract public class ComponentActivatorAbstractBase implements public void containerDestroy(String containerName) { try { Object[] imps = getImplementations(); - logger.trace("Destroying instance " + containerName); + logger.trace("Destroying instance {}", containerName); if (imps != null) { for (int i = 0; i < imps.length; i++) { ImmutablePair key = new ImmutablePair( @@ -330,8 +327,8 @@ abstract public class ComponentActivatorAbstractBase implements // Set the implementation so the component // can manage its lifesycle if (c.getService() == null) { - logger.trace("Setting implementation to:" - + imps[i]); + logger.trace("Setting implementation to: {}", + imps[i]); c.setImplementation(imps[i]); } @@ -359,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 @@ -397,8 +394,8 @@ abstract public class ComponentActivatorAbstractBase implements try { Component c = this.dbInstances.get(key); if (c != null) { - logger.trace("Remove component on container:" - + key.getLeft() + " Object:" + key.getRight()); + logger.trace("Remove component on container: {} Object: {}", + key.getLeft(), key.getRight()); this.dm.remove(c); } } catch (Exception nex) { @@ -415,7 +412,7 @@ abstract public class ComponentActivatorAbstractBase implements try { Component c = this.dbGlobalInstances.get(key); if (c != null) { - logger.trace("Remove component for Object:" + key); + logger.trace("Remove component for Object: {}" , key); this.dm.remove(c); } } catch (Exception nex) {