1 package org.opendaylight.neutron.transcriber;
3 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
4 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
5 import org.osgi.framework.BundleContext;
6 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory;
9 public class NeutronTranscriberProvider implements BindingAwareProvider, AutoCloseable {
10 private static final Logger LOGGER = LoggerFactory.getLogger(NeutronTranscriberProvider.class);
12 private BundleContext bundleContext;
14 private Activator activator;
16 public NeutronTranscriberProvider(BundleContext bundleContext) {
17 LOGGER.warn("BundleContext set to: {}",bundleContext);
18 this.bundleContext = bundleContext;
22 public void onSessionInitiated(ProviderContext providerContext) {
23 this.activator = new Activator(providerContext);
25 LOGGER.warn("BundleContext found to be: {}",bundleContext);
26 this.activator.start(bundleContext);
27 } catch (Exception e) {
28 LOGGER.warn("Unable to start Neutron Transcriber because: ",e);
33 public void close() throws Exception {
34 this.activator.stop(bundleContext);