2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.config.manager.testingservices.parallelapsp;
10 import javax.annotation.concurrent.ThreadSafe;
11 import javax.management.ObjectName;
13 import org.opendaylight.controller.config.api.DependencyResolver;
14 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
15 import org.opendaylight.controller.config.api.ModuleIdentifier;
16 import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface;
17 import org.opendaylight.controller.config.spi.ModuleFactory;
20 public class TestingParallelAPSPModuleFactory implements ModuleFactory {
22 public static final String NAME = "parallel";
25 public String getImplementationName() {
30 public TestingParallelAPSPModule createModule(String instanceName,
31 DependencyResolver dependencyResolver) {
32 return new TestingParallelAPSPModule(new ModuleIdentifier(NAME,
33 instanceName), dependencyResolver, null, null);
37 public TestingParallelAPSPModule createModule(String instanceName,
38 DependencyResolver dependencyResolver, DynamicMBeanWithInstance old)
40 TestingParallelAPSPImpl oldInstance;
42 oldInstance = (TestingParallelAPSPImpl) old.getInstance();
43 } catch (ClassCastException e) {
46 TestingParallelAPSPModule result = new TestingParallelAPSPModule(
47 new ModuleIdentifier(NAME, instanceName), dependencyResolver,
48 old.getInstance(), oldInstance);
50 String someParam = (String) old.getAttribute("SomeParam");
51 result.setSomeParam(someParam);
52 ObjectName threadPool = (ObjectName) old.getAttribute("ThreadPool");
53 result.setThreadPool(threadPool);
58 public boolean isModuleImplementingServiceInterface(
59 Class<? extends AbstractServiceInterface> serviceInterface) {