Fix checkstyle issues to enforce it
[controller.git] / opendaylight / config / config-persister-feature-adapter / src / main / java / org / opendaylight / controller / configpusherfeature / ConfigPusherFeatureActivator.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.configpusherfeature;
9
10 import org.opendaylight.controller.config.persist.api.ConfigPusher;
11 import org.opendaylight.controller.configpusherfeature.internal.ConfigPusherCustomizer;
12 import org.osgi.framework.BundleActivator;
13 import org.osgi.framework.BundleContext;
14 import org.osgi.util.tracker.ServiceTracker;
15
16 public class ConfigPusherFeatureActivator implements BundleActivator {
17     private BundleContext bc = null;
18     private ConfigPusherCustomizer cpc = null;
19     private ServiceTracker<ConfigPusher, ConfigPusher> cpst = null;
20
21     public void start(final BundleContext context) throws Exception {
22         bc = context;
23         cpc = new ConfigPusherCustomizer();
24         cpst = new ServiceTracker<>(bc, ConfigPusher.class.getName(), cpc);
25         cpst.open();
26     }
27
28     public void stop(final BundleContext context) throws Exception {
29         if (cpst != null) {
30             cpst.close();
31             cpst = null;
32         }
33         if (cpc != null) {
34             cpc.close();
35             cpc = null;
36         }
37         bc = null;
38     }
39 }

©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.