@Override
  public void stop(final BundleContext context) throws Exception {
    jndiManager.unExport(KILLBILL_OSGI_JDBC_JNDI_NAME);

    this.context = null;
    context.removeServiceListener(this);
    observable.unregister();
    registrar.unregisterAll();
  }
  @Override
  public void start(final BundleContext context) throws Exception {

    this.context = context;
    final Dictionary props = new Hashtable();
    props.put(OSGIPluginProperties.PLUGIN_NAME_PROP, "killbill");

    observable.register();

    registrar.registerService(context, OSGIKillbill.class, osgiKillbill, props);
    registrar.registerService(context, HttpService.class, defaultHttpService, props);
    registrar.registerService(context, Observable.class, observable, props);
    registrar.registerService(context, DataSource.class, dataSource, props);
    registrar.registerService(context, OSGIConfigProperties.class, configProperties, props);

    context.addServiceListener(this);

    jndiManager.export(KILLBILL_OSGI_JDBC_JNDI_NAME, dataSource);
  }