Examples of Configurator


Examples of org.apache.ivy.util.Configurator

    public XmlSettingsParser(IvySettings ivy) {
        this.ivy = ivy;
    }

    public void parse(URL settings) throws ParseException, IOException {
        configurator = new Configurator();
        configurator.setFileResolver(new FileResolver() {
            public File resolveFile(String path, String filename) {
                return Checks.checkAbsolute(path, filename);
            }
        });
View Full Code Here

Examples of org.apache.ivy.util.Configurator

    public XmlSettingsParser(IvySettings ivy) {
        this.ivy = ivy;
    }

    public void parse(URL settings) throws ParseException, IOException {
        configurator = new Configurator();
        // put every type definition from ivy to configurator
        Map typeDefs = ivy.getTypeDefs();
        for (Iterator iter = typeDefs.keySet().iterator(); iter.hasNext();) {
            String name = (String) iter.next();
            configurator.typeDef(name, (Class) typeDefs.get(name));
View Full Code Here

Examples of org.apache.ivy.util.Configurator

    public XmlSettingsParser(IvySettings ivy) {
        this.ivy = ivy;
    }

    public void parse(URL settings) throws ParseException, IOException {
        configurator = new Configurator();
        // put every type definition from ivy to configurator
        Map typeDefs = ivy.getTypeDefs();
        for (Iterator iter = typeDefs.keySet().iterator(); iter.hasNext();) {
            String name = (String) iter.next();
            configurator.typeDef(name, (Class) typeDefs.get(name));
View Full Code Here

Examples of org.apache.ivy.util.Configurator

    public XmlSettingsParser(IvySettings ivy) {
        _ivy = ivy;
  }

    public void parse(URL settings) throws ParseException, IOException {
        _configurator = new Configurator();
        // put every type definition from ivy to configurator
        Map typeDefs = _ivy.getTypeDefs();
        for (Iterator iter = typeDefs.keySet().iterator(); iter.hasNext();) {
            String name = (String) iter.next();
            _configurator.typeDef(name, (Class)typeDefs.get(name));
View Full Code Here

Examples of org.apache.log4j.spi.Configurator

        if (log.isDebugEnabled()) {
            log.debug("Configuring from URL: " + url);
        }

        // Get the config delegate and target repository to config with
        Configurator delegate = null;
        try {
            delegate = getConfigurator(url);
        } catch (FileNotFoundException e) {
            return;
        }

        if (log.isTraceEnabled()) {
            log.trace("Configuring Log4j using configurator: " +
                    delegate + ", repository: " + repo);
        }

        // Now actually configure Log4j
        delegate.doConfigure(url, repo);
    }
View Full Code Here

Examples of org.apache.log4j.spi.Configurator

     @param hierarchy The {@link org.apache.log4j.Hierarchy} to act on.

     @since 1.1.4 */
  public static void selectAndConfigure(
    URL url, String clazz, LoggerRepository repository) {
    Configurator configurator = null;
    String filename = url.getFile();

    if ((clazz == null) && (filename != null) && filename.endsWith(".xml")) {
      clazz = JoranConfigurator.class.getName();
    }

    if (clazz != null) {
      Logger logger = repository.getLogger(OptionConverter.class.getName());
      logger.info("Preferred configurator class: " + clazz);

      configurator =
        (Configurator) instantiateByClassName(clazz, Configurator.class, null);

      if (configurator == null) {
        logger.error("Could not instantiate configurator [" + clazz + "].");
       
        return;
      }
    } else {
      configurator = new PropertyConfigurator();
    }
   
    configurator.doConfigure(url, repository);
    if(configurator instanceof ConfiguratorBase) {
      ((ConfiguratorBase)configurator).dumpErrors();
    }
  }
View Full Code Here

Examples of org.apache.log4j.spi.Configurator

        if (log.isDebugEnabled()) {
            log.debug("Configuring from URL: " + url);
        }

        // Get the config delegate and target repository to config with
        Configurator delegate = null;
        try {
            delegate = getConfigurator(url);
        } catch (FileNotFoundException e) {
            return;
        }

        if (log.isTraceEnabled()) {
            log.trace("Configuring Log4j using configurator: " +
                    delegate + ", repository: " + repo);
        }

        // Now actually configure Log4j
        delegate.doConfigure(url, repo);
    }
View Full Code Here

Examples of org.apache.log4j.spi.Configurator

        if (log.isDebugEnabled()) {
            log.debug("Configuring from URL: " + url);
        }

        // Get the config delegate and target repository to config with
        Configurator delegate = null;
        try {
            delegate = getConfigurator(url);
        } catch (FileNotFoundException e) {
            return;
        }

        if (log.isTraceEnabled()) {
            log.trace("Configuring Log4j using configurator: " +
                    delegate + ", repository: " + repo);
        }

        // Now actually configure Log4j
        delegate.doConfigure(url, repo);
    }
View Full Code Here

Examples of org.apache.log4j.spi.Configurator

            if (log.isDebugEnabled()) {
                log.debug("Configuring from URL: " + url);
            }

            // Get the config delegate and target repository to config with
            Configurator delegate = null;
            try {
                delegate = getConfigurator(url);
            } catch (FileNotFoundException e) {
                return;
            }

            if (log.isTraceEnabled()) {
                log.trace("Configuring Log4j using configurator: " +
                        delegate + ", repository: " + repo);
            }

            // Now actually configure Log4j
            delegate.doConfigure(url, repo);
        } catch (Throwable e) {
            log.info("conld not configure log4j", e);
        }
    }
View Full Code Here

Examples of org.apache.log4j.spi.Configurator

     @since 1.1.4 */

  static
  public
  void selectAndConfigure(URL url, String clazz, LoggerRepository hierarchy) {
   Configurator configurator = null;
   String filename = url.getFile();

   if(clazz == null && filename != null && filename.endsWith(".xml")) {
     clazz = "org.apache.log4j.xml.DOMConfigurator";
   }

   if(clazz != null) {
     LogLog.debug("Preferred configurator class: " + clazz);
     configurator = (Configurator) instantiateByClassName(clazz,
                Configurator.class,
                null);
     if(configurator == null) {
       LogLog.error("Could not instantiate configurator ["+clazz+"].");
       return;
     }
   } else {
     configurator = new PropertyConfigurator();
   }

   configurator.doConfigure(url, hierarchy);
  }
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.