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%2Fscheduledthreadpool%2FTestingScheduledThreadPoolModuleFactory.java;h=295d348503869899cc3a844beded7633042f4f75;hp=c4426d18e3db0d6566c3f5b57f7beeaa42ad258c;hb=3314dddc5692bed5eb837b0739ac3bb5ed1962ab;hpb=2c6fd09ad16f5c2968390a674865efbbe5f1fcec diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModuleFactory.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModuleFactory.java index c4426d18e3..295d348503 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModuleFactory.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModuleFactory.java @@ -7,31 +7,30 @@ */ package org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool; -import java.util.Arrays; +import com.google.common.collect.ImmutableSet; import java.util.HashSet; -import java.util.List; 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; import org.opendaylight.controller.config.api.ModuleIdentifier; import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface; -import org.opendaylight.controller.config.manager.testingservices.seviceinterface - .TestingScheduledThreadPoolServiceInterface; +import org.opendaylight.controller.config.manager.testingservices.seviceinterface.TestingScheduledThreadPoolServiceInterface; 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; public class TestingScheduledThreadPoolModuleFactory implements ModuleFactory { public static final String NAME = "scheduled"; - private static List> ifc = Arrays - .asList(TestingScheduledThreadPoolServiceInterface.class, TestingThreadPoolServiceInterface.class); + private static Set> ifc = ImmutableSet.of( + (Class) TestingScheduledThreadPoolServiceInterface.class, + TestingThreadPoolServiceInterface.class); @Override public boolean isModuleImplementingServiceInterface( - Class serviceInterface) { + final Class serviceInterface) { return ifc.contains(serviceInterface); } @@ -41,15 +40,15 @@ public class TestingScheduledThreadPoolModuleFactory implements ModuleFactory { } @Override - public Module createModule(String instanceName, - DependencyResolver dependencyResolver) { + public Module createModule(final String instanceName, + final DependencyResolver dependencyResolver, final BundleContext bundleContext) { return new TestingScheduledThreadPoolModule(new ModuleIdentifier(NAME, instanceName), null, null); } @Override - public Module createModule(String instanceName, - DependencyResolver dependencyResolver, DynamicMBeanWithInstance old) + public Module createModule(final String instanceName, + final DependencyResolver dependencyResolver, final DynamicMBeanWithInstance old, final BundleContext bundleContext) throws Exception { TestingScheduledThreadPoolImpl oldInstance; try { @@ -67,7 +66,14 @@ public class TestingScheduledThreadPoolModuleFactory implements ModuleFactory { } @Override - public Set getDefaultModules(DependencyResolverFactory dependencyResolverFactory) { - return new HashSet(); + public Set getDefaultModules(final DependencyResolverFactory dependencyResolverFactory, final BundleContext bundleContext) { + return new HashSet<>(); + } + + @Override + public Set> getImplementedServiceIntefaces() { + return ifc; } + + }