Examples of FileChangedReloadingStrategy


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

            out.close();
            out = null;

            PropertiesConfiguration config = new PropertiesConfiguration(
                    configFile);
            config.setReloadingStrategy(new FileChangedReloadingStrategy());
            config.setAutoSave(true);

            assertEquals("one", config.getProperty("a"));
            config.setProperty("b", "two");
            assertEquals("one", config.getProperty("a"));
View Full Code Here

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

     * Rigourous Test :-)
     */
    public void testMultiConfiguration()
    {
        //set up a reloading strategy
        FileChangedReloadingStrategy strategy = new FileChangedReloadingStrategy();
        strategy.setRefreshDelay(10000);

        MultiFileHierarchicalConfiguration config = new MultiFileHierarchicalConfiguration(PATTERN1);
        config.setReloadingStrategy(strategy);

        System.setProperty("Id", "1001");
View Full Code Here

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

     * Rigourous Test :-)
     */
    public void testMultiConfiguration()
    {
        //set up a reloading strategy
        FileChangedReloadingStrategy strategy = new FileChangedReloadingStrategy();
        strategy.setRefreshDelay(10000);

        PatternSubtreeConfigurationWrapper config = new PatternSubtreeConfigurationWrapper(this.conf, PATTERN);
        config.setReloadingStrategy(strategy);
        config.setExpressionEngine(new XPathExpressionEngine());

View Full Code Here

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

     * 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

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

            out.close();
            out = null;

            PropertiesConfiguration config = new PropertiesConfiguration(
                    configFile);
            config.setReloadingStrategy(new FileChangedReloadingStrategy());
            config.setAutoSave(true);

            assertEquals("one", config.getProperty("a"));
            config.setProperty("b", "two");
            assertEquals("one", config.getProperty("a"));
View Full Code Here

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

  private ConfigDispayRules() {
    configPfad = this.helper.getGoobiConfigDirectory() + "goobi_metadataDisplayRules.xml";
    try {
      config = new XMLConfiguration(configPfad);
      config.setReloadingStrategy(new FileChangedReloadingStrategy());
      getDisplayItems();
    } catch (ConfigurationException e) {
      /*
       * no configuration file found, default configuration (textarea) will be used, nothing to do here
       */
 
View Full Code Here

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

  public static List<String> getCredencials(String requestIp, String requestPassword) {
    ArrayList<String> allowed = new ArrayList<String>();
    try {
      XMLConfiguration config = new XMLConfiguration(new Helper().getGoobiConfigDirectory() +"goobi_webapi.xml");
      config.setListDelimiter('&');
      config.setReloadingStrategy(new FileChangedReloadingStrategy());

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

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

      logger.trace("config 3");

      config.setListDelimiter('&');

      logger.trace("config 4");
      config.setReloadingStrategy(new FileChangedReloadingStrategy());
      logger.trace("config 5");

      int count = config.getMaxIndex("hotfolder");
      logger.trace("config 6");
View Full Code Here

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

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
TOP
Copyright © 2018 www.massapi.com. 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.