Merge "Remove He-design statistics manager"
[openflowplugin.git] / applications / inventory-manager / src / main / java / org / opendaylight / openflowplugin / applications / inventory / manager / InventoryActivator.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.openflowplugin.applications.inventory.manager;
9
10 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
11 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
12 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
15
16 public class InventoryActivator implements AutoCloseable {
17     private static final Logger LOG = LoggerFactory.getLogger(InventoryActivator.class);
18
19     private final FlowCapableInventoryProvider provider;
20
21     public InventoryActivator(DataBroker dataBroker, NotificationProviderService notificationService,
22             EntityOwnershipService eos) {
23         provider = new FlowCapableInventoryProvider(dataBroker, notificationService, eos);
24     }
25
26     public void start() {
27         provider.start();
28     }
29
30     @Override
31     public void close() {
32         try {
33             provider.close();
34         } catch (InterruptedException e) {
35             LOG.warn("Interrupted while waiting for shutdown", e);
36         }
37     }
38 }