X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Ftestingservices%2Fparallelapsp%2FTestingParallelAPSPModule.java;h=df6dce124339991a50c0016d30dd87cc76168e88;hp=81ba49e1aaad9ac6ef53d82404cfe8f9b481f027;hb=c0b10c35abcdf8038546aa89bf29264720f12a75;hpb=07d721d409cefe0ec307ec96b5e90881b1ddcbc8 diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java index 81ba49e1aa..df6dce1243 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java @@ -7,15 +7,7 @@ */ package org.opendaylight.controller.config.manager.testingservices.parallelapsp; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.base.Preconditions.checkState; - -import java.io.Closeable; - -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; -import javax.management.ObjectName; - +import com.google.common.base.Strings; import org.opendaylight.controller.config.api.DependencyResolver; import org.opendaylight.controller.config.api.JmxAttribute; import org.opendaylight.controller.config.api.ModuleIdentifier; @@ -26,7 +18,13 @@ import org.opendaylight.controller.config.spi.Module; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Strings; +import javax.annotation.Nullable; +import javax.annotation.concurrent.NotThreadSafe; +import javax.management.ObjectName; +import java.io.Closeable; + +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; /** * Represents service that has dependency to thread pool. @@ -40,26 +38,21 @@ public class TestingParallelAPSPModule implements Module, private final DependencyResolver dependencyResolver; private final AutoCloseable oldCloseable; private final TestingParallelAPSPImpl oldInstance; - private final ModuleIdentifier name; + private final ModuleIdentifier identifier; private ObjectName threadPoolON; private TestingParallelAPSPImpl instance; private String someParam; - public TestingParallelAPSPModule(ModuleIdentifier name, + public TestingParallelAPSPModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver, @Nullable AutoCloseable oldCloseable, @Nullable TestingParallelAPSPImpl oldInstance) { - this.name = name; + this.identifier = identifier; this.dependencyResolver = dependencyResolver; this.oldCloseable = oldCloseable; this.oldInstance = oldInstance; } - @Override - public ModuleIdentifier getName() { - return name; - } - @Override public ObjectName getThreadPool() { return threadPoolON; @@ -119,8 +112,7 @@ public class TestingParallelAPSPModule implements Module, if (oldInstance != null) { // changing thread pool is not supported - boolean reuse = threadPoolInstance.equals(oldInstance - .getThreadPool()); + boolean reuse = threadPoolInstance == oldInstance.getThreadPool(); if (reuse) { logger.debug("Reusing old instance"); instance = oldInstance; @@ -142,4 +134,11 @@ public class TestingParallelAPSPModule implements Module, } return instance; } + + @Override + public ModuleIdentifier getIdentifier() { + return identifier; + } + + }