c9195c7073a3df8fa2f67c4641da9e44117e6a3c
[controller.git] / opendaylight / md-sal / sal-binding-config / src / main / java / org / opendaylight / controller / config / yang / md / sal / binding / impl / RuntimeMappingModuleFactory.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
9
10 import static com.google.common.base.Preconditions.checkArgument;
11 import org.opendaylight.controller.config.api.DependencyResolver;
12 import org.osgi.framework.BundleContext;
13
14 /**
15  * @deprecated Replaced by blueprint wiring
16  */
17 @Deprecated
18 public class RuntimeMappingModuleFactory extends
19         org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractRuntimeMappingModuleFactory {
20
21     public static final String SINGLETON_NAME = "runtime-mapping-singleton";
22
23     @Override
24     public RuntimeMappingModule instantiateModule(String instanceName, DependencyResolver dependencyResolver, RuntimeMappingModule  oldModule, AutoCloseable oldInstance, BundleContext bundleContext) {
25         checkArgument(SINGLETON_NAME.equals(instanceName),"Illegal instance name '" + instanceName + "', only allowed name is " + SINGLETON_NAME);
26         RuntimeMappingModule module = super.instantiateModule(instanceName, dependencyResolver, oldModule, oldInstance, bundleContext);
27         // FIXME bundle context should not be passed around
28         module.setBundleContext(bundleContext);
29         return module;
30     }
31
32     @Override
33     public RuntimeMappingModule  instantiateModule(String instanceName, DependencyResolver dependencyResolver, BundleContext bundleContext) {
34         checkArgument(SINGLETON_NAME.equals(instanceName),"Illegal instance name '" + instanceName + "', only allowed name is " + SINGLETON_NAME);
35         RuntimeMappingModule module = super.instantiateModule(instanceName, dependencyResolver, bundleContext);
36         // FIXME bundle context should not be passed around
37         module.setBundleContext(bundleContext);
38         return module;
39     }
40 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.