2 * Copyright IBM Corporation, 2013. 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.controller.md.statistics.manager;
11 import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
12 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
13 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
14 import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
15 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
16 import org.osgi.framework.BundleContext;
18 public class StatisticsManagerActivator extends AbstractBindingAwareProvider {
20 private static ProviderContext pSession;
22 private static StatisticsProvider statsProvider = new StatisticsProvider();
25 public void onSessionInitiated(ProviderContext session) {
28 DataProviderService dps = session.<DataProviderService>getSALService(DataProviderService.class);
29 StatisticsManagerActivator.statsProvider.setDataService(dps);
30 DataBrokerService dbs = session.<DataBrokerService>getSALService(DataBrokerService.class);
31 StatisticsManagerActivator.statsProvider.setDataBrokerService(dbs);
32 NotificationProviderService nps = session.<NotificationProviderService>getSALService(NotificationProviderService.class);
33 StatisticsManagerActivator.statsProvider.setNotificationService(nps);
34 StatisticsManagerActivator.statsProvider.start();
39 protected void stopImpl(BundleContext context) {
40 StatisticsManagerActivator.statsProvider.close();
43 public static ProviderContext getProviderContext(){