2 * Copyright (c) 2016 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
9 package org.opendaylight.netconf.util.osgi;
11 import java.util.Hashtable;
12 import org.osgi.framework.BundleActivator;
13 import org.osgi.framework.BundleContext;
14 import org.osgi.framework.Constants;
15 import org.osgi.framework.ServiceRegistration;
16 import org.osgi.service.cm.ManagedService;
18 public class NetconfConfigurationActivator implements BundleActivator {
19 private static final String CONFIG_PID = "netconf";
20 private ServiceRegistration configService;
23 public void start(BundleContext bundleContext) {
24 configService = bundleContext.registerService(ManagedService.class,
25 NetconfConfiguration.getInstance(), getNetconfConfigProperties());
29 public void stop(BundleContext bundleContext) {
30 if (configService != null) {
31 configService.unregister();
36 private Hashtable<String, String> getNetconfConfigProperties() {
37 Hashtable<String, String> properties = new Hashtable<>();
38 properties.put(Constants.SERVICE_PID, CONFIG_PID);