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=bec28685576aba673422c32222acafc6aca34a23;hb=c4940d6fa1f6928b7189afb2dc6964fb2f2cbae2;hp=ba60b39ca16ba686f1c02f0efb8e7626f5279794;hpb=9fb64948564e252018f9b1e13e7cea2c92f991aa;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 ba60b39ca1..bec2868557 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,10 +7,9 @@ */ package org.opendaylight.controller.config.manager.testingservices.threadpool; -import java.util.Arrays; -import java.util.List; - +import com.google.common.collect.Sets; import org.opendaylight.controller.config.api.DependencyResolver; +import org.opendaylight.controller.config.api.DependencyResolverFactory; import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; import org.opendaylight.controller.config.api.ModuleIdentifier; import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface; @@ -18,11 +17,18 @@ import org.opendaylight.controller.config.manager.testingservices.seviceinterfac import org.opendaylight.controller.config.manager.testingservices.seviceinterface.TestingThreadPoolServiceInterface; 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 implements ModuleFactory { +public class TestingFixedThreadPoolModuleFactory extends AbstractTestingFixedThreadPoolModuleFactory implements ModuleFactory { public static final String NAME = "fixed"; - private static List> ifc = Arrays - .asList(ModifiableThreadPoolServiceInterface.class, TestingThreadPoolServiceInterface.class); + + private static Set> ifc = Collections.unmodifiableSet(Sets.newHashSet( + (Class) ModifiableThreadPoolServiceInterface.class, + TestingThreadPoolServiceInterface.class)); @Override public String getImplementationName() { @@ -31,14 +37,14 @@ public class TestingFixedThreadPoolModuleFactory implements ModuleFactory { @Override public TestingFixedThreadPoolModule createModule(String instanceName, - DependencyResolver dependencyResolver) { + DependencyResolver dependencyResolver, BundleContext bundleContext) { return new TestingFixedThreadPoolModule(new ModuleIdentifier(NAME, instanceName), null, null); } @Override public Module createModule(String instanceName, - DependencyResolver dependencyResolver, DynamicMBeanWithInstance old) + DependencyResolver dependencyResolver, DynamicMBeanWithInstance old, BundleContext bundleContext) throws Exception { int threadCount = (Integer) old.getAttribute("ThreadCount"); // is the instance compatible? @@ -62,4 +68,14 @@ public class TestingFixedThreadPoolModuleFactory implements ModuleFactory { Class serviceInterface) { return ifc.contains(serviceInterface); } + + @Override + public Set getDefaultModules(DependencyResolverFactory dependencyResolverFactory, BundleContext bundleContext) { + return new HashSet(); + } + + @Override + public Set> getImplementedServiceIntefaces() { + return ifc; + } }