Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.CompositeConfiguration.addConfiguration()


    LOG.info("Starting up cluster...");
    CompositeConfiguration config = new CompositeConfiguration();
    if (System.getProperty("config") != null) {
      config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
    }
    config.addConfiguration(new PropertiesConfiguration(this.configResource));
    clusterSpec = ClusterSpec.withTemporaryKeys(config);
    controller = new ClusterController();

    cluster = controller.launchCluster(clusterSpec);
    proxy = new HadoopProxy(clusterSpec, cluster);
View Full Code Here


   * @return The composite configuration.
   */
  protected Configuration getConfiguration(
                                           ClusterSpec clusterSpec, Configuration defaults) {
    CompositeConfiguration cc = new CompositeConfiguration();
    cc.addConfiguration(clusterSpec.getConfiguration());
    cc.addConfiguration(defaults);
    return cc;
  }

  protected Configuration getConfiguration(ClusterSpec clusterSpec,
View Full Code Here

   */
  protected Configuration getConfiguration(
                                           ClusterSpec clusterSpec, Configuration defaults) {
    CompositeConfiguration cc = new CompositeConfiguration();
    cc.addConfiguration(clusterSpec.getConfiguration());
    cc.addConfiguration(defaults);
    return cc;
  }

  protected Configuration getConfiguration(ClusterSpec clusterSpec,
                                           String defaultsPropertiesFile) throws IOException {
View Full Code Here

  }
 
  private Configuration composeWithDefaults(Configuration userConfig)
      throws ConfigurationException {
    CompositeConfiguration composed = new CompositeConfiguration();
    composed.addConfiguration(userConfig);
    composed.addConfiguration(new PropertiesConfiguration(
        getClass().getClassLoader().getResource(DEFAULT_PROPERTIES)));
    return composed;
  }
View Full Code Here

 
  private Configuration composeWithDefaults(Configuration userConfig)
      throws ConfigurationException {
    CompositeConfiguration composed = new CompositeConfiguration();
    composed.addConfiguration(userConfig);
    composed.addConfiguration(new PropertiesConfiguration(
        getClass().getClassLoader().getResource(DEFAULT_PROPERTIES)));
    return composed;
  }

  protected void checkAndSetKeyPair() throws ConfigurationException {
View Full Code Here

  public void testApplySubroleAliases() throws ConfigurationException {
    CompositeConfiguration c = new CompositeConfiguration();
    Configuration config = new PropertiesConfiguration();
    config.addProperty("whirr.instance-templates",
      "1 puppet:somepup::pet+something-else, 1 something-else-only");
    c.addConfiguration(config);
    InstanceTemplate template = InstanceTemplate.parse(c).get(0);
    Set<String> expected = Sets.newLinkedHashSet(Arrays.asList(new String[]{
      "puppet:somepup::pet", "something-else"}));
    assertThat(template.getRoles(), is(expected));
View Full Code Here

       *  and put it into this context as an attribute 'properties' available to all resources
       */
      File localPropsFile = new File(System.getProperty("user.dir") + File.separator + "local.widgetserver.properties");
      PropertiesConfiguration localConfiguration = new PropertiesConfiguration(localPropsFile);
      CompositeConfiguration configuration = new CompositeConfiguration();
      configuration.addConfiguration(localConfiguration);
      configuration.addConfiguration(new PropertiesConfiguration("widgetserver.properties"));
     
      context.setAttribute("properties", (Configuration) configuration);
      
       // load these up now so we don't have to do it on every request(i.e. filter) in the future
View Full Code Here

       */
      File localPropsFile = new File(System.getProperty("user.dir") + File.separator + "local.widgetserver.properties");
      PropertiesConfiguration localConfiguration = new PropertiesConfiguration(localPropsFile);
      CompositeConfiguration configuration = new CompositeConfiguration();
      configuration.addConfiguration(localConfiguration);
      configuration.addConfiguration(new PropertiesConfiguration("widgetserver.properties"));
     
      context.setAttribute("properties", (Configuration) configuration);
      
       // load these up now so we don't have to do it on every request(i.e. filter) in the future
       usePreferenceInstanceQueues = configuration.getBoolean(WidgetRuntimeHelper.USE_PREFERENCE_INSTANCE_QUEUES)
View Full Code Here

       *  as an attribute 'opensocial' available to all resources
       */
      File localOpenSocialPropsFile = new File(System.getProperty("user.dir") + File.separator + "local.opensocial.properties");
            PropertiesConfiguration localOpenSocialConfiguration = new PropertiesConfiguration(localOpenSocialPropsFile);
            CompositeConfiguration opensocialConfiguration = new CompositeConfiguration();
            opensocialConfiguration.addConfiguration(localOpenSocialConfiguration);
            opensocialConfiguration.addConfiguration(new PropertiesConfiguration("opensocial.properties"));
      context.setAttribute("opensocial", (Configuration) opensocialConfiguration);
     
      /*
       * Load installed features
View Full Code Here

       */
      File localOpenSocialPropsFile = new File(System.getProperty("user.dir") + File.separator + "local.opensocial.properties");
            PropertiesConfiguration localOpenSocialConfiguration = new PropertiesConfiguration(localOpenSocialPropsFile);
            CompositeConfiguration opensocialConfiguration = new CompositeConfiguration();
            opensocialConfiguration.addConfiguration(localOpenSocialConfiguration);
            opensocialConfiguration.addConfiguration(new PropertiesConfiguration("opensocial.properties"));
      context.setAttribute("opensocial", (Configuration) opensocialConfiguration);
     
      /*
       * Load installed features
       */
 
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.