title: How to reload apache commons configurations2 properties
body: <p>can anyone guide me on how to perform a reload of an apache commons configuration2 properties. I'm unable to find any implementation of this anywhere. The apache docs are a bit too abstract. This is what I have so far but it's not working.</p>
  
  <pre><code>    CombinedConfiguration cc = new CombinedConfiguration();
  
      Parameters params = new Parameters();
      File configFile = new File("config.properties");
      File emsFile = new File("anotherconfig.properties");
  
      ReloadingFileBasedConfigurationBuilder&lt;FileBasedConfiguration&gt; configBuilder =
          new ReloadingFileBasedConfigurationBuilder&lt;FileBasedConfiguration&gt;(PropertiesConfiguration.class)
          .configure(params.fileBased()
              .setFile(configFile));
      PeriodicReloadingTrigger reloadTrg = new PeriodicReloadingTrigger(configBuilder.getReloadingController(), null, 5, TimeUnit.SECONDS);
      reloadTrg.start();
  
      cc.addConfiguration(configBuilder.getConfiguration());
  
      FileBasedConfigurationBuilder&lt;FileBasedConfiguration&gt; emsBuilder =
              new FileBasedConfigurationBuilder&lt;FileBasedConfiguration&gt;(PropertiesConfiguration.class)
              .configure(params.properties()
                  .setFile(emsFile));
      cc.addConfiguration(emsBuilder.getConfiguration());
  
      DataSource ds = EmsDataSource.getInstance().getDatasource(this);
  
       BasicConfigurationBuilder&lt;DatabaseConfiguration&gt; dbBuilder =
           new BasicConfigurationBuilder&lt;DatabaseConfiguration&gt;(DatabaseConfiguration.class);
       dbBuilder.configure(
           params.database()
               .setDataSource(ds)
               .setTable("EMS_CONFIG")
               .setKeyColumn("KEY")
               .setValueColumn("VALUE")
       );
      cc.addConfiguration(dbBuilder.getConfiguration());
  </code></pre>