2 * Copyright (c) 2014 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.yang.md.sal.binding.impl;
10 import static com.google.common.base.Preconditions.checkArgument;
12 import org.opendaylight.controller.config.api.DependencyResolver;
13 import org.osgi.framework.BundleContext;
18 * @deprecated Replaced by blueprint wiring
21 public class RuntimeMappingModuleFactory extends
22 org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractRuntimeMappingModuleFactory {
24 public static final String SINGLETON_NAME = "runtime-mapping-singleton";
27 public RuntimeMappingModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
28 RuntimeMappingModule oldModule, AutoCloseable oldInstance, BundleContext bundleContext) {
29 checkArgument(SINGLETON_NAME.equals(instanceName),
30 "Illegal instance name '" + instanceName + "', only allowed name is " + SINGLETON_NAME);
31 RuntimeMappingModule module = super.instantiateModule(instanceName, dependencyResolver, oldModule, oldInstance,
33 // FIXME bundle context should not be passed around
34 module.setBundleContext(bundleContext);
39 public RuntimeMappingModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
40 BundleContext bundleContext) {
41 checkArgument(SINGLETON_NAME.equals(instanceName),
42 "Illegal instance name '" + instanceName + "', only allowed name is " + SINGLETON_NAME);
43 RuntimeMappingModule module = super.instantiateModule(instanceName, dependencyResolver, bundleContext);
44 // FIXME bundle context should not be passed around
45 module.setBundleContext(bundleContext);