Package org.apache.commons.configuration.reloading

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


            forgeXml = new XMLConfiguration(getProjectSettings(project).getUnderlyingResourceObject());
         }
         catch (org.apache.commons.configuration.ConfigurationException e) {
            throw new ConfigurationException(e);
         }
         forgeXml.setReloadingStrategy(new FileChangedReloadingStrategy());
         forgeXml.setAutoSave(true);
         projectConfig.setScopedConfiguration(ConfigurationScope.PROJECT,
                  new ConfigurationAdapter(projectConfig, forgeXml));
         projectConfig.setScopedConfiguration(ConfigurationScope.USER, getUserConfig(projectConfig));
         this.projectConfig = projectConfig;
View Full Code Here


                     .getUnderlyingResourceObject());
         }
         catch (org.apache.commons.configuration.ConfigurationException e) {
            throw new ConfigurationException(e);
         }
         globalXml.setReloadingStrategy(new FileChangedReloadingStrategy());
         globalXml.setAutoSave(true);
         userConfig = new ConfigurationAdapter(config, globalXml);
      }
      return userConfig;
   }
View Full Code Here

    }
    log.info("Reading UDDI Client properties file " + xmlConfig.getBasePath() + " use -D"+UDDI_CONFIG_FILENAME_PROPERTY+ " to override");
    this.configurationFile = xmlConfig.getBasePath();
    long refreshDelay = xmlConfig.getLong(Property.UDDI_RELOAD_DELAY, 1000l);
    log.debug("Setting refreshDelay to " + refreshDelay);
    FileChangedReloadingStrategy fileChangedReloadingStrategy = new FileChangedReloadingStrategy();
    fileChangedReloadingStrategy.setRefreshDelay(refreshDelay);
    xmlConfig.setReloadingStrategy(fileChangedReloadingStrategy);
    compositeConfig.addConfiguration(xmlConfig);
    //Making the new configuration globally accessible.
    config = compositeConfig;
    readConfig(properties);
View Full Code Here

    super();

    File config = new File(fileName);
    setFile(config);
    this.setAutoSave(true);
    this.setReloadingStrategy(new FileChangedReloadingStrategy());
    this.setDelimiterParsingDisabled(true);
    this.setListDelimiter((char) 0);

    if (config.exists()) {
      this.load();
View Full Code Here

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

         projectConfig.setScopedConfiguration(ConfigurationScope.PROJECT, new ConfigurationAdapter(projectConfig,
                  projectLocalConfig));
         projectConfig.setScopedConfiguration(ConfigurationScope.USER, getUserConfig());
View Full Code Here

         }
         catch (org.apache.commons.configuration.ConfigurationException e)
         {
            throw new ConfigurationException(e);
         }
         globalXml.setReloadingStrategy(new FileChangedReloadingStrategy());
         globalXml.setAutoSave(true);
         userConfig = new ScopedConfigurationAdapter(ConfigurationScope.USER, new ConfigurationAdapter(globalXml));
      }
      return userConfig;
   }
View Full Code Here

    }
    URL url = ClassUtil.getResource(JUDDI_PROPERTIES, this.getClass());
    log.info("Reading from properties file:  " + url);
    long refreshDelay = propConfig.getLong(Property.JUDDI_CONFIGURATION_RELOAD_DELAY, 1000l);
    log.debug("Setting refreshDelay to " + refreshDelay);
    FileChangedReloadingStrategy fileChangedReloadingStrategy = new FileChangedReloadingStrategy();
    fileChangedReloadingStrategy.setRefreshDelay(refreshDelay);
    propConfig.setReloadingStrategy(fileChangedReloadingStrategy);
    compositeConfig.addConfiguration(propConfig);
   
    // Properties from the persistence layer (must first initialize the entityManagerFactory).
    PersistenceManager.initializeEntityManagerFactory(propConfig.getString(Property.JUDDI_PERSISTENCEUNIT_NAME));
View Full Code Here

            forgeXml = new XMLConfiguration(getProjectSettings(project).getUnderlyingResourceObject());
         }
         catch (org.apache.commons.configuration.ConfigurationException e) {
            throw new ConfigurationException(e);
         }
         forgeXml.setReloadingStrategy(new FileChangedReloadingStrategy());
         forgeXml.setAutoSave(true);
         projectConfig.setScopedConfiguration(ConfigurationScope.PROJECT,
                  new ConfigurationAdapter(projectConfig, forgeXml));
         projectConfig.setScopedConfiguration(ConfigurationScope.USER, getUserConfig(projectConfig));
         this.projectConfig = projectConfig;
View Full Code Here

                     .getUnderlyingResourceObject());
         }
         catch (org.apache.commons.configuration.ConfigurationException e) {
            throw new ConfigurationException(e);
         }
         globalXml.setReloadingStrategy(new FileChangedReloadingStrategy());
         globalXml.setAutoSave(true);
         if (config != null)
            userConfig = new ConfigurationAdapter(config, globalXml);
         else
            userConfig = new ConfigurationAdapter(new ScopedConfigurationAdapter(), globalXml);
View Full Code Here

     * implementation accesses methods of the configuration that in turn cause a reload.
     */
    public void testReentrantReload()
    {
        conf.setProperty("shouldReload", Boolean.FALSE);
        conf.setReloadingStrategy(new FileChangedReloadingStrategy()
        {
            public boolean reloadingRequired()
            {
                return configuration.getBoolean("shouldReload");
            }
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.