2 * Copyright (c) 2015 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.neutron.transcriber;
11 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
12 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
13 import org.osgi.framework.BundleContext;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
17 public class NeutronTranscriberProvider implements BindingAwareProvider, AutoCloseable {
18 private static final Logger LOGGER = LoggerFactory.getLogger(NeutronTranscriberProvider.class);
20 private BundleContext bundleContext;
22 private Activator activator;
24 public NeutronTranscriberProvider(BundleContext bundleContext) {
25 LOGGER.warn("BundleContext set to: {}",bundleContext);
26 this.bundleContext = bundleContext;
30 public void onSessionInitiated(ProviderContext providerContext) {
31 this.activator = new Activator(providerContext);
33 LOGGER.warn("BundleContext found to be: {}",bundleContext);
34 this.activator.start(bundleContext);
35 } catch (Exception e) {
36 LOGGER.warn("Unable to start Neutron Transcriber because: ",e);
41 public void close() throws Exception {
42 this.activator.stop(bundleContext);