Deprecate md-sal config modules
[controller.git] / opendaylight / md-sal / sal-dom-broker-config / src / main / java / org / opendaylight / controller / config / yang / md / sal / dom / impl / SchemaServiceImplSingletonModuleFactory.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.dom.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 SchemaServiceImplSingletonModuleFactory extends
19         org.opendaylight.controller.config.yang.md.sal.dom.impl.AbstractSchemaServiceImplSingletonModuleFactory {
20
21     public static final String SINGLETON_NAME = "yang-schema-service";
22
23     @Override
24     public SchemaServiceImplSingletonModule  instantiateModule(String instanceName, DependencyResolver dependencyResolver, SchemaServiceImplSingletonModule  oldModule, AutoCloseable oldInstance, BundleContext bundleContext) {
25         checkArgument(SINGLETON_NAME.equals(instanceName),"Illegal instance name '" + instanceName + "', only allowed name is " + SINGLETON_NAME);
26         SchemaServiceImplSingletonModule 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 SchemaServiceImplSingletonModule  instantiateModule(String instanceName, DependencyResolver dependencyResolver, BundleContext bundleContext) {
34         checkArgument(SINGLETON_NAME.equals(instanceName),"Illegal instance name '" + instanceName + "', only allowed name is " + SINGLETON_NAME);
35         SchemaServiceImplSingletonModule module = super.instantiateModule(instanceName, dependencyResolver, bundleContext);
36         // FIXME bundle context should not be passed around
37         module.setBundleContext(bundleContext);
38         return module;
39     }
40 }