Examples of DefaultConfigurationBuilder

Whitespace handling. Since mixed content is not allowed in the configurations, whitespace is completely discarded in non-leaf nodes. For the leaf nodes the default behavior is to trim the space surrounding the value. This can be changed by specifying xml:space attribute with value of preserve in that case the whitespace is left intact.

@author Avalon Development Team @version CVS $Revision: 1.33 $ $Date: 2004/04/03 23:55:54 $
  • org.apache.commons.configuration.DefaultConfigurationBuilder
    pache.org/configuration/team-list.html">Commons Configuration team @version $Id: DefaultConfigurationBuilder.java 595043 2007-11-14 20:44:43Z oheger $

  • Examples of org.apache.avalon.framework.configuration.DefaultConfigurationBuilder

            getLogger().debug(".act(): Creator : " + creator.getClass().getName());

            // Init creator
            // "Read" the configuration from the DOM node
            DefaultConfigurationBuilder defaultConfigBuilder = new DefaultConfigurationBuilder();
            Configuration[] docTypeConfigs = defaultConfigBuilder.buildFromFile(absoluteDoctypesPath +
                    "doctypes.xconf").getChildren();

            Configuration doctypeConf = null;

            for (int i = 0; i < docTypeConfigs.length; i++) {
    View Full Code Here

    Examples of org.apache.avalon.framework.configuration.DefaultConfigurationBuilder

         * Reads the scheduler configuration.
         * @return A configuration.
         */
        protected Configuration getSchedulerConfiguration() {
            try {
                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

    Examples of org.apache.avalon.framework.configuration.DefaultConfigurationBuilder

         * @return the configuration value
         */
        private Configuration getConfiguration(String filename)
                throws SAXException, IOException, ConfigurationException
        {
            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();

            return builder.buildFromFile(filename);
        }
    View Full Code Here

    Examples of org.apache.avalon.framework.configuration.DefaultConfigurationBuilder

        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

    Examples of org.apache.avalon.framework.configuration.DefaultConfigurationBuilder

                clContext.setLogger(log);
                appContext.put(Constants.CONTEXT_ENVIRONMENT_CONTEXT, clContext);
                DefaultLogKitManager logKitManager = null;
                if(logKit != null) {
                    final FileInputStream fis = new FileInputStream(logKit);
                    final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
                    final Configuration logKitConf = builder.build(fis);
                    logKitManager = new DefaultLogKitManager(Hierarchy.getDefaultHierarchy());
                    logKitManager.setLogger(log);
                    final DefaultContext subcontext = new DefaultContext(appContext);
                    subcontext.put("context-root", contextDir);
                    logKitManager.contextualize(subcontext);
    View Full Code Here

    Examples of org.apache.avalon.framework.configuration.DefaultConfigurationBuilder

                //Configure the logkit management
                final String logkitConfig = getInitParameter("logkit-config");
                if (logkitConfig != null) {
                    final FileInputStream fis = new FileInputStream(this.servletContext.getRealPath("/") + logkitConfig);
                    final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
                    final Configuration conf = builder.build(fis);
                    logKitManager.configure(conf);
                }
            } catch (Exception e) {
                Hierarchy.getDefaultHierarchy().log("Could not set up Cocoon Logger, will use screen instead", e);
            }
    View Full Code Here

    Examples of org.apache.avalon.framework.configuration.DefaultConfigurationBuilder

         * @return the configuration value
         */
        private Configuration getConfiguration(String filename)
                throws SAXException, IOException, ConfigurationException
        {
            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();

            return builder.buildFromFile(filename);
        }
    View Full Code Here

    Examples of org.apache.avalon.framework.configuration.DefaultConfigurationBuilder

                clContext.setLogger(log);
                appContext.put(Constants.CONTEXT_ENVIRONMENT_CONTEXT, clContext);
                DefaultLogKitManager logKitManager = null;
                if (logKit != null) {
                    final FileInputStream fis = new FileInputStream(logKit);
                    final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
                    final Configuration logKitConf = builder.build(fis);
                    logKitManager = new DefaultLogKitManager(Hierarchy.getDefaultHierarchy());
                    logKitManager.setLogger(log);
                    final DefaultContext subcontext = new DefaultContext(appContext);
                    subcontext.put("context-root", contextDir);
                    logKitManager.contextualize(subcontext);
    View Full Code Here

    Examples of org.apache.avalon.framework.configuration.DefaultConfigurationBuilder

        try {
          org.apache.cocoon.environment.Context context =
            (org.apache.cocoon.environment.Context)cocoonContext.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);

          InputStream is = context.getResource(componentsFileName).openStream();
          DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
          Configuration conf = builder.build(is);
          loadComponents(conf);
        } catch (Exception ex) {
          ex.printStackTrace();
          throw new ConfigurationException("Cannot load sitemap components file "
                                           + componentsFileName
    View Full Code Here

    Examples of org.apache.avalon.framework.configuration.DefaultConfigurationBuilder

                if (logkitConfig == null) {
                    logkitConfig = "/WEB-INF/logkit.xconf";
                }

                final InputStream is = this.servletContext.getResourceAsStream(logkitConfig);
                final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
                final Configuration conf = builder.build(is);
                logKitManager.configure(conf);
            } catch (Exception e) {
                Hierarchy.getDefaultHierarchy().log("Could not set up Cocoon Logger, will use screen instead", e);
            }
    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.