Mechanical code cleanup (config)
[controller.git] / opendaylight / config / config-manager / src / test / java / org / opendaylight / controller / config / manager / testingservices / scheduledthreadpool / TestingScheduledThreadPoolModuleFactory.java
index 8244bc153d26b2d571a2576c933988589a16c332..295d348503869899cc3a844beded7633042f4f75 100644 (file)
@@ -7,28 +7,30 @@
  */
 package org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool;
 
-import java.util.Arrays;
-import java.util.List;
-
+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;
 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<Class<? extends TestingThreadPoolServiceInterface>> ifc = Arrays
-            .asList(TestingScheduledThreadPoolServiceInterface.class, TestingThreadPoolServiceInterface.class);
+    private static Set<Class<? extends AbstractServiceInterface>> ifc = ImmutableSet.of(
+            (Class<? extends AbstractServiceInterface>) TestingScheduledThreadPoolServiceInterface.class,
+                    TestingThreadPoolServiceInterface.class);
 
     @Override
     public boolean isModuleImplementingServiceInterface(
-            Class<? extends AbstractServiceInterface> serviceInterface) {
+            final Class<? extends AbstractServiceInterface> serviceInterface) {
         return ifc.contains(serviceInterface);
     }
 
@@ -38,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 {
@@ -63,4 +65,15 @@ public class TestingScheduledThreadPoolModuleFactory implements ModuleFactory {
         return configBean;
     }
 
+    @Override
+    public Set<Module> getDefaultModules(final DependencyResolverFactory dependencyResolverFactory, final BundleContext bundleContext) {
+        return new HashSet<>();
+    }
+
+    @Override
+    public Set<Class<? extends AbstractServiceInterface>> getImplementedServiceIntefaces() {
+        return ifc;
+    }
+
+
 }