Package org.apache.avalon.framework.configuration

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


            useRoles = false;
            getLogger().info("Not using seperate roles file");
        }
        // 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();
View Full Code Here


        // 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

        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

    // 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();
        final boolean errorsOnly = rc.isErrorLogging();
        final boolean successOnly = rc.isSuccessOnlyLogging();
        for (int i = 0; i < samples.length; i++) {
            SampleResult result = OldSaveService.getSampleResult(samples[i]);
View Full Code Here

    private void updateConfigurations() {
        DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
        Configuration cfg;
        try {
            cfg = cfgBuilder.buildFromFile(this.userConfigURL);
        } catch (SAXException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (ConfigurationException e) {
View Full Code Here

    public static void main(String[] args) {
        try {
            //Read configuration
            File cfgFile = new File(args[0]);
            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
            Configuration cfg = builder.buildFromFile(cfgFile);
           
            boolean doPrompt = cfg.getAttributeAsBoolean("prompt", false);
            if (doPrompt) {
                prompt();
            }
View Full Code Here

     * @throws IOException In case of a I/O problem
     */
    public void runBatch(File cfgFile)
                throws ConfigurationException, SAXException, IOException {
        DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
        Configuration cfg = cfgBuilder.buildFromFile(cfgFile);
        runBatch(cfg);
    }

    /**
     * Runs the batch
View Full Code Here

     * @throws SAXException if a parsing error occurs
     */
    public void setUserConfig(File userConfigFile) throws SAXException, IOException {
        try {
            DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
            setUserConfig(cfgBuilder.buildFromFile(userConfigFile));
        } catch (ConfigurationException e) {
            throw new FOPException(e);
        }
    }
   
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

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.