Package org.apache.avalon.framework.configuration

Examples of org.apache.avalon.framework.configuration.DefaultConfigurationBuilder.buildFromFile()


        // process configuration files
        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        Configuration sysConfig = builder.buildFromFile(configFileName);
        if (useRoles)
        {
            Configuration roleConfig = builder.buildFromFile(roleFileName);
            // Setup the RoleManager
            DefaultRoleManager roles = new DefaultRoleManager();
            roles.enableLogging(lm.getLoggerForCategory("org.apache.fulcrum"));
            roles.configure(roleConfig);
      this.manager.setRoleManager(roles);
View Full Code Here


     */
    private Configuration getConfiguration(String filename)
        throws SAXException, IOException, ConfigurationException
    {
        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        return builder.buildFromFile(filename);
    }

    public void clear()
    {
        current = -1;
View Full Code Here

            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
            String path = getServletContextPath() + getSchedulerConfigurationPath();
            log.debug("Initializing scheduler configuration: " + path);

            File configurationFile = new File(path);
            Configuration configuration = builder.buildFromFile(configurationFile);

            return configuration;
        } catch (Exception e) {
            log.error("Can't initialize scheduler configuration: ", e);
View Full Code Here

        File configurationFile = new File(configurationFilePath);

        if (configurationFile.isFile()) {
            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
            Configuration configuration = builder.buildFromFile(configurationFile);
            configure(configuration);

        } else {
            log.info("Task configuration not loaded - file [" + configurationFile.getAbsolutePath()
                    + "] does not exist.");
View Full Code Here

        File configurationFile = new File(configurationFilePath);

        try {
            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
            Configuration configuration = builder.buildFromFile(configurationFile);
            configure(configuration);
        } catch (Exception e) {
            log.info("Did not load publishing configuration from publisher.xconf (No such file or directory: "
                    + configurationFile
                    + "). "
View Full Code Here

        Hierarchy hier = Hierarchy.getDefaultHierarchy();
        LogKitLoggerManager manager = new LogKitLoggerManager(null, hier, null, null);

        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        try {
            Configuration c = builder.buildFromFile(cfg);
            Context ctx = new DefaultContext();
            manager.contextualize(ctx);
            manager.configure(c);
        } catch (IllegalArgumentException e) {
            // This happens if the default log-target id-ref specifies a non-existent target
View Full Code Here

        log.debug("Role File:   " + roleConfigFilename);

        // process configuration files

        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        Configuration sysConfig  = builder.buildFromFile(sysConfigFilename);
        Configuration roleConfig = builder.buildFromFile(roleConfigFilename);

        // Create the LoggerManager for Log4J
        LoggerManager lm = new Log4JLoggerManager();
View Full Code Here

        // process configuration files

        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        Configuration sysConfig  = builder.buildFromFile(sysConfigFilename);
        Configuration roleConfig = builder.buildFromFile(roleConfigFilename);

        // Create the LoggerManager for Log4J
        LoggerManager lm = new Log4JLoggerManager();

        // Setup the RoleManager
View Full Code Here

        builder.setEntityResolver( new MyEntityResolver() );
        File basedir = getWorkDir();
        File testFile = new File( basedir, TEST_PATH );
        File external = new File( testFile, EXTERNAL_FILE_NAME );
        Configuration conf = builder.buildFromFile( external  );
        simpleAssertions( conf );
    }
   
    /**
     * Mock implementation for EntityResolver
View Full Code Here

  // Called by ResultCollector#loadExistingFile()
  public static void processSamples(String filename, Visualizer visualizer, ResultCollector rc)
    throws SAXException, IOException, ConfigurationException
  {
    DefaultConfigurationBuilder cfgbuilder = new DefaultConfigurationBuilder();
    Configuration savedSamples = cfgbuilder.buildFromFile(filename);
    Configuration[] samples = savedSamples.getChildren();
    for (int i = 0; i < samples.length; i++) {
        SampleResult result = OldSaveService.getSampleResult(samples[i]);
        if (rc.isSampleWanted(result.isSuccessful())) {
          visualizer.add(result);
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.