X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Ftestingservices%2Fthreadpool%2FTestingFixedThreadPoolModuleFactory.java;h=d385a7db5a2d007bb6d4320f31d7247a4ecde1c1;hb=ebb4158697741bc88fde22ac5f75edf65869506f;hp=bec28685576aba673422c32222acafc6aca34a23;hpb=7e6e19f57c11d6a35558f230f05b5b0d13b4ebe8;p=controller.git diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModuleFactory.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModuleFactory.java index bec2868557..d385a7db5a 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModuleFactory.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModuleFactory.java @@ -7,7 +7,9 @@ */ package org.opendaylight.controller.config.manager.testingservices.threadpool; -import com.google.common.collect.Sets; +import com.google.common.collect.ImmutableSet; +import java.util.HashSet; +import java.util.Set; import org.opendaylight.controller.config.api.DependencyResolver; import org.opendaylight.controller.config.api.DependencyResolverFactory; import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; @@ -19,16 +21,12 @@ import org.opendaylight.controller.config.spi.Module; import org.opendaylight.controller.config.spi.ModuleFactory; import org.osgi.framework.BundleContext; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - public class TestingFixedThreadPoolModuleFactory extends AbstractTestingFixedThreadPoolModuleFactory implements ModuleFactory { public static final String NAME = "fixed"; - private static Set> ifc = Collections.unmodifiableSet(Sets.newHashSet( + private static final Set> ifc = ImmutableSet.of( (Class) ModifiableThreadPoolServiceInterface.class, - TestingThreadPoolServiceInterface.class)); + TestingThreadPoolServiceInterface.class); @Override public String getImplementationName() { @@ -36,15 +34,15 @@ public class TestingFixedThreadPoolModuleFactory extends AbstractTestingFixedThr } @Override - public TestingFixedThreadPoolModule createModule(String instanceName, - DependencyResolver dependencyResolver, BundleContext bundleContext) { + public TestingFixedThreadPoolModule createModule(final String instanceName, + final DependencyResolver dependencyResolver, final BundleContext bundleContext) { return new TestingFixedThreadPoolModule(new ModuleIdentifier(NAME, instanceName), null, null); } @Override - public Module createModule(String instanceName, - DependencyResolver dependencyResolver, DynamicMBeanWithInstance old, BundleContext bundleContext) + public Module createModule(final String instanceName, + final DependencyResolver dependencyResolver, final DynamicMBeanWithInstance old, final BundleContext bundleContext) throws Exception { int threadCount = (Integer) old.getAttribute("ThreadCount"); // is the instance compatible? @@ -65,12 +63,12 @@ public class TestingFixedThreadPoolModuleFactory extends AbstractTestingFixedThr @Override public boolean isModuleImplementingServiceInterface( - Class serviceInterface) { + final Class serviceInterface) { return ifc.contains(serviceInterface); } @Override - public Set getDefaultModules(DependencyResolverFactory dependencyResolverFactory, BundleContext bundleContext) { + public Set getDefaultModules(final DependencyResolverFactory dependencyResolverFactory, final BundleContext bundleContext) { return new HashSet(); }