Package org.apache.commons.configuration.reloading

Examples of org.apache.commons.configuration.reloading.FileChangedReloadingStrategy


    } catch (ConfigurationException e) {
      logger.error(e);
      config = new XMLConfiguration();
    }
    config.setListDelimiter('&');
    config.setReloadingStrategy(new FileChangedReloadingStrategy());

    // run though all properties
    int countProperties = config.getMaxIndex("property");
    for (int i = 0; i <= countProperties; i++) {
View Full Code Here


    try {
      File file = new File(new Helper().getGoobiConfigDirectory() + "goobi_exportXml.xml");
      if (file.exists() && file.canRead()) {
        XMLConfiguration config = new XMLConfiguration(file);
        config.setListDelimiter('&');
        config.setReloadingStrategy(new FileChangedReloadingStrategy());

        int count = config.getMaxIndex(xmlpath);
        for (int i = 0; i <= count; i++) {
          String name = config.getString(xmlpath + "(" + i + ")[@name]");
          String value = config.getString(xmlpath + "(" + i + ")[@value]");
View Full Code Here

    try {
      File file = new File(new Helper().getGoobiConfigDirectory() + "goobi_exportXml.xml");
      if (file.exists() && file.canRead()) {
        XMLConfiguration config = new XMLConfiguration(file);
        config.setListDelimiter('&');
        config.setReloadingStrategy(new FileChangedReloadingStrategy());

        int count = config.getMaxIndex("namespace");
        for (int i = 0; i <= count; i++) {
          String name = config.getString("namespace(" + i + ")[@name]");
          String value = config.getString("namespace(" + i + ")[@value]");
View Full Code Here

    } catch (ConfigurationException e) {
      logger.error(e);
      config = new XMLConfiguration();
    }
    config.setListDelimiter('&');
    config.setReloadingStrategy(new FileChangedReloadingStrategy());
    return config;
  }
View Full Code Here

      config = new PropertiesConfiguration();
    }
    // config.setDelimiterParsingDisabled(true);
    config.setListDelimiter('|');

    config.setReloadingStrategy(new FileChangedReloadingStrategy());
  }
View Full Code Here

    } catch (ConfigurationException e) {
      logger.error(e);
      this.config = new XMLConfiguration();
    }
    this.config.setListDelimiter('&');
    this.config.setReloadingStrategy(new FileChangedReloadingStrategy());

    int countProjects = this.config.getMaxIndex("project");
    for (int i = 0; i <= countProjects; i++) {
      String title = this.config.getString("project(" + i + ")[@name]");
      if (title.equals(projectTitle)) {
View Full Code Here

          log.debug("Loading config file: " + mFile.getAbsolutePath());
        try {
          xConfig = new XMLConfiguration(mFile);
          xConfig.append(getEnvironmentConfiguration());
          xConfig.addConfigurationListener(new MetricsConfigListener());
          xConfig.setReloadingStrategy(new FileChangedReloadingStrategy());
         
          // Start a background Thread that checks a property from the XMLConfiguration
          // every so often to force the FileChangedReloadingStrategy to fire.
          if (null == watcher || !watcher.isAlive()) {
            watcher = new MetricsConfigWatcher();
View Full Code Here

      } catch (ConfigurationException e) {
         e.printStackTrace();
         this.config = new XMLConfiguration();
      }
      this.config.setListDelimiter('&');
      this.config.setReloadingStrategy(new FileChangedReloadingStrategy());
   }
View Full Code Here

   {
      try
      {
         XMLConfiguration commonsConfig = new XMLConfiguration(file);
         commonsConfig.setEncoding("UTF-8");
         commonsConfig.setReloadingStrategy(new FileChangedReloadingStrategy());
         commonsConfig.setAutoSave(true);
         return new ConfigurationAdapter().setDelegate(commonsConfig);
      }
      catch (org.apache.commons.configuration.ConfigurationException e)
      {
View Full Code Here

      }
      catch (org.apache.commons.configuration.ConfigurationException e)
      {
         throw new ConfigurationException(e);
      }
      projectLocalConfig.setReloadingStrategy(new FileChangedReloadingStrategy());
      projectLocalConfig.setAutoSave(true);

      ConfigurationAdapter adapter = BeanManagerUtils.getContextualInstance(bm, ConfigurationAdapter.class,
               new ConfigAdapterQualifierLiteral());
      adapter.setParent(projectConfig);
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration.reloading.FileChangedReloadingStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.