Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.DefaultConfigurationBuilder


    protected UsersRepository getUsersRepository() throws Exception {
        factory = OpenJPAPersistence.getEntityManagerFactory(properties);
        JPAUsersRepository repos = new JPAUsersRepository();
        repos.setLog(LoggerFactory.getLogger("JPA"));
        repos.setEntityManagerFactory(factory);
        repos.configure(new DefaultConfigurationBuilder());
        return repos;
    }
View Full Code Here


    CompositeConfiguration config = new CompositeConfiguration();

    try {
      LOGGER.debug("Trying to load configuration from file "
          + CONFIG_FILE);
      DefaultConfigurationBuilder factory = new DefaultConfigurationBuilder(
          CONFIG_FILE);
      Configuration xmlConf = factory.getConfiguration();
      LOGGER.debug("Configuration successfully loaded.");
      config.addConfiguration(xmlConf);
    } catch (ConfigurationException e) {
      LOGGER.info("Unable to locate " + CONFIG_FILE
          + ". Using default configuration.");
View Full Code Here

                return config;
            }
        }

        try {
            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder(name);
            builder.clearErrorListeners();
            builder.addErrorListener(new ConfigurationErrorListener() {
                @Override
                public void configurationError(ConfigurationErrorEvent event) {
                    if (event.getType() == DefaultConfigurationBuilder.EVENT_ERR_LOAD_OPTIONAL) {
                        LOG.debug("Could not load optional configuration file {}", event.getPropertyName(),
                            event.getCause());
                    } else {
                        LOG.warn("Configuration error on {}", event.getPropertyName(), event.getCause());
                    }
                }
            });
            config = builder.getConfiguration(true);
            buffer.put(name, config);
        } catch (ConfigurationException e) {
            LOG.error("Cannot load configuration {}", e, name);
        }
        return config;
View Full Code Here

                return config;
            }
        }

        try {
            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder(name);
            builder.clearErrorListeners();
            builder.addErrorListener(new ConfigurationErrorListener() {
                @Override
                public void configurationError(ConfigurationErrorEvent event) {
                    if (event.getType() == DefaultConfigurationBuilder.EVENT_ERR_LOAD_OPTIONAL) {
                        LOG.debug("Could not load optional configuration file {}", event.getPropertyName(),
                            event.getCause());
                    } else {
                        LOG.warn("Configuration error on {}", event.getPropertyName(), event.getCause());
                    }
                }
            });
            config = builder.getConfiguration(true);
            buffer.put(name, config);
        } catch (ConfigurationException e) {
            LOG.error("Cannot load configuration {}", e, name);
        }
        return config;
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration.DefaultConfigurationBuilder

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.