Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.SystemConfiguration


   * set to 1 second to prevent excessive date stamp checking.
   */
  private void loadConfiguration(String configurationFile) throws ConfigurationException {
    //Properties from system properties
    CompositeConfiguration compositeConfig = new CompositeConfiguration();
    compositeConfig.addConfiguration(new SystemConfiguration());
    //Properties from XML file
    XMLConfiguration xmlConfig = null;
    if (configurationFile!=null) {
      xmlConfig = new XMLConfiguration(configurationFile);
    } else {
View Full Code Here


                logger.warn("Failed to create default dynamic configuration", e);
            }

            //TODO: sys/env above urls?
            if (!Boolean.getBoolean(DISABLE_DEFAULT_SYS_CONFIG)) {
                SystemConfiguration sysConfig = new SystemConfiguration();
                config.addConfiguration(sysConfig, SYS_CONFIG_NAME);
            }
            if (!Boolean.getBoolean(DISABLE_DEFAULT_ENV_CONFIG)) {
                EnvironmentConfiguration envConfig = new EnvironmentConfiguration();
                config.addConfiguration(envConfig, ENV_CONFIG_NAME);
View Full Code Here

        // interpolation takes place across the entirety of the
        // composite configuration. Without doing this each
        // configuration object only interpolates variables defined
        // inside itself.
        final MyConfiguration conf = new MyConfiguration();
        conf.addConfiguration(new SystemConfiguration()
        {
            protected String interpolate(String o)
            {
                return conf.interpolate(o);
            }
View Full Code Here

    protected final static String ZK_LEDGERS_ROOT_PATH = "zkLedgersRootPath";

    protected AbstractConfiguration() {
        super();
        // add configuration for system properties
        addConfiguration(new SystemConfiguration());
    }
View Full Code Here

        // interpolation takes place across the entirety of the
        // composite configuration. Without doing this each
        // configuration object only interpolates variables defined
        // inside itself.
        final MyConfiguration conf = new MyConfiguration();
        conf.addConfiguration(new SystemConfiguration()
        {
            protected String interpolate(String o)
            {
                return conf.interpolate(o);
            }
View Full Code Here

            {
                logger.debug( "Creating a default configuration - no configuration was provided" );
                configuration = new CombinedConfiguration();
            }

            configuration.addConfiguration( new SystemConfiguration() );

            this.configuration = configuration;
        }
        catch ( ConfigurationException e )
        {
View Full Code Here

   * @throws ConfigurationException on configuration error
   */
  public static Module bindSettings(String propertiesFileKey, Class<?>... settingsArg)
      throws ConfigurationException {
    final CompositeConfiguration config = new CompositeConfiguration();
    config.addConfiguration(new SystemConfiguration());
    String propertyFile = config.getString(propertiesFileKey);
    if (propertyFile != null) {
      config.addConfiguration(new PropertiesConfiguration(propertyFile));
    }

View Full Code Here

    return envConfig;
  }
 
  public Configuration getSystemConfiguration() {
    if (null == sysConfig)
      sysConfig = new SystemConfiguration();
    return sysConfig;
  }
View Full Code Here

    public FileServer() {
        org.apache.log4j.PropertyConfigurator.configure("config/logging.properties");

        try {
            config = new CompositeConfiguration();
            config.addConfiguration(new SystemConfiguration());
            config.addConfiguration(new PropertiesConfiguration("config/server.properties"));

            final String data = config.getString("fileserver.data");
            final String services = config.getString("fileserver.services");
            final String logs = config.getString("fileserver.logs");
View Full Code Here

                }
            }
            basicConfiguration.addConfiguration(config);

            CompositeConfiguration compositeConfiguration = new CompositeConfiguration();
            compositeConfiguration.addConfiguration(new SystemConfiguration());
            compositeConfiguration.addConfiguration(basicConfiguration);
            configuration = new VirtualHostConfiguration(virtualHostName, compositeConfiguration , _broker);
        }
        else
        {
View Full Code Here

TOP

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

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.