2 * Copyright (c) 2014 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
8 package org.opendaylight.controller.md.inventory.manager;
10 import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
11 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
12 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
13 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
14 import org.osgi.framework.BundleContext;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
18 public class InventoryActivator extends AbstractBindingAwareProvider {
19 private static final Logger LOG = LoggerFactory.getLogger(InventoryActivator.class);
20 private FlowCapableInventoryProvider provider;
23 public void onSessionInitiated(final ProviderContext session) {
24 DataProviderService salDataService = session.getSALService(DataProviderService.class);
25 NotificationProviderService salNotifiService =
26 session.getSALService(NotificationProviderService.class);
28 provider = new FlowCapableInventoryProvider(salDataService, salNotifiService);
33 protected void stopImpl(final BundleContext context) {
34 if (provider != null) {
37 } catch (InterruptedException e) {
38 LOG.warn("Interrupted while waiting for shutdown", e);