1 package org.opendaylight.neutron.transcriber;
5 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
6 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
7 import org.osgi.framework.BundleContext;
8 import org.osgi.framework.ServiceRegistration;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
12 public class NeutronTranscriberProvider implements BindingAwareProvider, AutoCloseable {
13 private static final Logger LOGGER = LoggerFactory.getLogger(NeutronTranscriberProvider.class);
15 private BundleContext bundleContext;
17 private List<ServiceRegistration<?>> registrations;
19 private Activator activator;
21 public NeutronTranscriberProvider(BundleContext bundleContext) {
22 LOGGER.warn("BundleContext set to: {}",bundleContext);
23 this.bundleContext = bundleContext;
27 public void onSessionInitiated(ProviderContext providerContext) {
28 this.activator = new Activator(providerContext);
30 LOGGER.warn("BundleContext found to be: {}",bundleContext);
31 this.activator.start(bundleContext);
32 } catch (Exception e) {
33 LOGGER.warn("Unable to start Neutron Transcriber because: ",e);
38 public void close() throws Exception {
39 this.activator.stop(bundleContext);