title: Working with configs using pure OSGi interfaces with ManagedService
body: <p>i am working on OSGI bundle. I have implemented a BundleActivator and here is my code.</p>
  
  <pre><code>public class Activator implements BundleActivator {
  private static final String CONFIG_PID = "ConfigApp";
  private ServiceRegistration serviceReg;
  public VfsDAO app;
  
  @Override
  public void start(BundleContext context) throws Exception {
  
      System.out.println("Hello................ bundle started");
      Hashtable&lt;String, Object&gt; properties = new Hashtable&lt;String, Object&gt;();
      properties.put(Constants.SERVICE_PID, CONFIG_PID);
      serviceReg = context.registerService(ManagedService.class.getName(), new ConfigUpdater() , properties);
  
  }
  
  @Override
  public void stop(BundleContext context) throws Exception {
      serviceReg.unregister();
  }
  
  /**
   * Updates the configuration in the application. Of course your class can also directly implement ManagedService but this
   * way you can work with pojos
   */
  private final class ConfigUpdater implements ManagedService {
      @SuppressWarnings("rawtypes")
      @Override
      public void updated(Dictionary config) throws ConfigurationException {
          if (config == null) {
              return;
          }
          if (app == null) {
              app = new VfsDAO();
          }
          app.setAllowed((String)config.get("title"));
          System.out.println("FROM................ bundle ACTIVATOR");
          app.refresh();
      }
  }
  
  }
  </code></pre>
  
  <p>Now if i make a object of VfsDAO() in any other class setAllowed is not called and so the String allowed is not initialized.How can i get the value when i make a new VfsDAO() object in any other class? or how can i call (String)config.get("title") in VfsDAO class to that when i make a new object of VfsDAO() in any other class string allowed is initiled.</p>