fix FollowerInfo @ConstructorProperties for valid ShardStatsMXBean
[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
12 import org.opendaylight.controller.config.api.DependencyResolver;
13 import org.osgi.framework.BundleContext;
14
15 /**
16  * Deprecated.
17  *
18  * @deprecated Replaced by blueprint wiring
19  */
20 @Deprecated
21 public class RuntimeMappingModuleFactory extends
22         org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractRuntimeMappingModuleFactory {
23
24     public static final String SINGLETON_NAME = "runtime-mapping-singleton";
25
26     @Override
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,
32                 bundleContext);
33         // FIXME bundle context should not be passed around
34         module.setBundleContext(bundleContext);
35         return module;
36     }
37
38     @Override
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);
46         return module;
47     }
48 }