Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.XMLConfiguration.configurationsAt()


    try {
      final XMLConfiguration initial = new XMLConfiguration(gui.getConfig().getProperty("genericconffile"));
      initial.setExpressionEngine(new XPathExpressionEngine());
     
      for (final HierarchicalConfiguration subconf : (java.util.List<HierarchicalConfiguration>)
          initial.configurationsAt("/generic/template")) {
        final String name = subconf.getString("name");
        if (name != null) values.add(name);
      }
    } catch (final ConfigurationException ex) {
      log.error("Exception", ex);
View Full Code Here


    try {
      final XMLConfiguration initial = new XMLConfiguration(gui.getConfig().getProperty("genericconffile"));
      initial.setExpressionEngine(new XPathExpressionEngine());

      for (final HierarchicalConfiguration subconf : (java.util.List<HierarchicalConfiguration>)
          initial.configurationsAt("/generic/template")) {
        final String subconf_name = subconf.getString("name");
        if (subconf_name != null && subconf_name.equals(name)) {
          for (final String key : new String [] { "name", "title", "cmdline", "filename", "workdir", "unit" })
            values.put(key, subconf.getString(key));
          return values;
View Full Code Here

      conf = new XMLConfiguration(config);
    } catch (ConfigurationException e) {
      throw new FitsConfigurationException("Error reading "+config+"fits.xml",e);
    }
   
    List fields = conf.configurationsAt("map");
    for(Iterator it = fields.iterator(); it.hasNext();)  {
        HierarchicalConfiguration sub = (HierarchicalConfiguration) it.next();
        // sub contains now all data about a single field
        String format = sub.getString("[@format]");
        String transform = sub.getString("[@transform]");
View Full Code Here

  public static ArrayList<ServerInfo> getServerInfo() {
    ArrayList<ServerInfo> ret = new ArrayList<ServerInfo>();
    XMLConfiguration config;
    try {
      config = new XMLConfiguration(FileSystem.getFile("app://servers.xml"));
      List<HierarchicalConfiguration> servers = config.configurationsAt("server");
      for (HierarchicalConfiguration server : servers)
      {
        ServerInfo toBeAdded = new ServerInfo();
        toBeAdded.region = server.getString("region");
        toBeAdded.platform = server.getString("platform");
View Full Code Here

        wrkld.setTerminals(xmlConfig.getInt("terminals"));
        wrkld.setIsolationMode(xmlConfig.getString("isolation", "TRANSACTION_SERIALIZABLE"));
        wrkld.setScaleFactor(xmlConfig.getDouble("scalefactor", 1.0));
        wrkld.setRecordAbortMessages(xmlConfig.getBoolean("recordabortmessages", false));

        int size = xmlConfig.configurationsAt("works.work").size();
        for (int i = 0; i < size; i++) {
            if ((int) xmlConfig.getInt("works.work(" + i + ").rate") < 1) {
                LOG.fatal("You cannot use less than 1 TPS in a Phase of your expeirment");
                System.exit(-1);
            }
View Full Code Here

            wrkld.addWork(xmlConfig.getInt("works.work(" + i + ").time"),
                          xmlConfig.getInt("works.work(" + i + ").rate"),
                          xmlConfig.getList("works.work(" + i + ").weights"));
        } // FOR

        final int numTxnTypes = xmlConfig.configurationsAt("transactiontypes.transactiontype").size();

        // CHECKING INPUT PHASES
        int j = 0;
        for (Phase p : wrkld.getAllPhases()) {
            j++;
View Full Code Here

        final XMLConfiguration properties = new XMLConfiguration();
        properties.load(Application.class.getResourceAsStream("rexster-integration-test.xml"));
        rexsterServer = new HttpRexsterServer(properties);

        final List<HierarchicalConfiguration> graphConfigs = properties.configurationsAt(Tokens.REXSTER_GRAPH_PATH);
        final RexsterApplication application = new XmlRexsterApplication(graphConfigs);
        rexsterServer.start(application);

        client = Client.create(clientConfiguration);
    }
View Full Code Here

        final XMLConfiguration properties = new XMLConfiguration();
        properties.load(AbstractRexsterPerformanceTest.class.getResourceAsStream("rexster-performance-test.xml"));
        rexProServer = new RexProRexsterServer(properties);
        httpServer = new HttpRexsterServer(properties);

        final List<HierarchicalConfiguration> graphConfigs = properties.configurationsAt(Tokens.REXSTER_GRAPH_PATH);
        final RexsterApplication application = new XmlRexsterApplication(graphConfigs);
        EngineController.configure(-1, null);
        rexProServer.start(application);
        httpServer.start(application);
View Full Code Here

    @Test
    public void shouldConfiguredFromXmlConfiguration() throws Exception {
        final XMLConfiguration properties = new XMLConfiguration();
        properties.load(rexsterXmlReader);
        final List<HierarchicalConfiguration> graphConfigs = properties.configurationsAt(Tokens.REXSTER_GRAPH_PATH);

        final RexsterApplication ra = new XmlRexsterApplication(graphConfigs);

        Assert.assertEquals(2, ra.getGraphNames().size());
        final List<String> graphNames = new ArrayList<String>(ra.getGraphNames());
View Full Code Here

        final XMLConfiguration properties = new XMLConfiguration();
        properties.load(Application.class.getResourceAsStream("rexster-integration-test.xml"));
        rexsterServer = new RexProRexsterServer(properties);

        final List<HierarchicalConfiguration> graphConfigs = properties.configurationsAt(Tokens.REXSTER_GRAPH_PATH);
        final RexsterApplication application = new XmlRexsterApplication(graphConfigs);
        EngineController.configure(-1, null);
        rexsterServer.start(application);
    }
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.