Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-62

[configuration] Using FileChangedReloadingStrategy for XMLConfiguration

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: Windows 2000
      Platform: Other

    • Bugzilla Id:
      35118

      Description

      We are trying to use FileChangedReloadingStrategy for XMLConfiguration, but its
      not working.

      We are using CompositeConfiguration and we have properties files as well as
      some xml files.

      I set FileChangedReloadingStrategy for all the configuration which is sub
      class of FileConfiguration. But reloading is only working for properties.

      Code:
      ============
      Configuration config = null;

      ConfigurationFactory factory = new ConfigurationFactory();
      String configFile="c:/config.xml";

      factory.setConfigurationFileName(configFile);
      config = factory.getConfiguration();
      CompositeConfiguration cc=((CompositeConfiguration)config);
      int noOfConfig=cc.getNumberOfConfigurations();
      for(int i=0;i<noOfConfig;i++){
      System.out.println(cc.getConfiguration.getClass() +" : " +
      (cc.getConfiguration instanceof FileConfiguration));
      if((cc.getConfiguration instanceof FileConfiguration)){
      ((FileConfiguration)cc.getConfiguration).setReloadingStrategy(new
      FileChangedReloadingStrategy());
      }

      Is it possible to use FileChangedReloadingStrategy for xmlconfiguration.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              raman.mishra@gmail.com Raman
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: