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%2Fscheduledthreadpool%2FTestingScheduledThreadPoolModuleFactory.java;fp=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Ftestingservices%2Fscheduledthreadpool%2FTestingScheduledThreadPoolModuleFactory.java;h=0000000000000000000000000000000000000000;hb=ac6f2699cd0c1e340cc32e8f0d0ca94c8e9c0cc0;hp=1011951055e3605f36aedb16f4d542f0caae8074;hpb=f43b01b81319959b1907e3e04537f5169e7f33d8;p=controller.git 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 deleted file mode 100644 index 1011951055..0000000000 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModuleFactory.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool; - -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.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 Set> ifc = ImmutableSet.of( - (Class) TestingScheduledThreadPoolServiceInterface.class, - TestingThreadPoolServiceInterface.class); - - @Override - public boolean isModuleImplementingServiceInterface( - final Class serviceInterface) { - return ifc.contains(serviceInterface); - } - - @Override - public String getImplementationName() { - return NAME; - } - - @Override - 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(final String instanceName, final DependencyResolver dependencyResolver, - final DynamicMBeanWithInstance old, final BundleContext bundleContext) throws Exception { - TestingScheduledThreadPoolImpl oldInstance; - try { - oldInstance = (TestingScheduledThreadPoolImpl) old.getInstance(); - } catch (final ClassCastException e) { - // happens after OSGi update - oldInstance = null; - } - - TestingScheduledThreadPoolModule configBean = new TestingScheduledThreadPoolModule( - new ModuleIdentifier(NAME, instanceName), old.getInstance(), oldInstance); - // copy attributes - configBean.setRecreate((Boolean) old.getAttribute("Recreate")); - return configBean; - } - - @Override - public Set getDefaultModules(final DependencyResolverFactory dependencyResolverFactory, - final BundleContext bundleContext) { - return new HashSet<>(); - } - - @Override - public Set> getImplementedServiceIntefaces() { - return ifc; - } -}