Examples of ConfigurationParser


Examples of org.jconfig.parser.ConfigurationParser

    /**
     * Loads the configuration from a xml file.
     * @throws ConfigurationManagerException
     */
    public synchronized Configuration load(String configurationName) throws ConfigurationManagerException {
    ConfigurationParser parser = ConfigurationParserFactory.getParser(configurationName);
    return load(configurationName,parser);
    }
View Full Code Here

Examples of org.jconfig.parser.ConfigurationParser

    }
   
    /**
     * @throws ConfigurationManagerException  */
    public synchronized Configuration load(String configurationName) throws ConfigurationManagerException {
    ConfigurationParser parser = ConfigurationParserFactory.getParser(configurationName);
        return load(file,configurationName,parser);
    }
View Full Code Here

Examples of org.jconfig.parser.ConfigurationParser

  public Configuration load(String configurationName, ConfigurationParser parser) throws ConfigurationManagerException {
    return load(file,configurationName,parser);
  }
   
  public synchronized Configuration load(File file,String configurationName) throws ConfigurationManagerException {
    ConfigurationParser parser = ConfigurationParserFactory.getParser(configurationName);
        return load(file,configurationName,parser);
  }
View Full Code Here

Examples of org.jmxtrans.embedded.config.ConfigurationParser

        EmbeddedJmxTransIntegrationTest integrationTest = new EmbeddedJmxTransIntegrationTest();
        integrationTest.integrationTest();
    }

    public void integrationTest() throws Exception {
        EmbeddedJmxTrans embeddedJmxTrans = new ConfigurationParser().newEmbeddedJmxTrans("classpath:org/jmxtrans/embedded/embedded-integ-test.json");
        embeddedJmxTrans.start();

        generateJvmActivity();

        System.out.println("bye");
View Full Code Here

Examples of org.jmxtrans.embedded.config.ConfigurationParser

    public void contextInitialized(ServletContextEvent sce) {
        sce.getServletContext().log("Start embedded-jmxtrans ...");

        mbeanServer = ManagementFactory.getPlatformMBeanServer();

        ConfigurationParser configurationParser = new ConfigurationParser();

        String configuration = configureFromSystemProperty(sce);
        if (configuration == null || configuration.isEmpty()){
            configuration = configureFromWebXmlParam(sce);
            if (configuration == null || configuration.isEmpty()){
                configuration = "classpath:jmxtrans.json, classpath:org/jmxtrans/embedded/config/jmxtrans-internals-servlet-container.json";
            }
        }

        List<String> configurationUrls = StringUtils2.delimitedStringToList(configuration);
        embeddedJmxTrans = configurationParser.newEmbeddedJmxTrans(configurationUrls);
        String on = "org.jmxtrans.embedded:type=EmbeddedJmxTrans,name=jmxtrans,path=" + sce.getServletContext().getContextPath();
        try {
            objectName = mbeanServer.registerMBean(embeddedJmxTrans, new ObjectName(on)).getObjectName();
        } catch (Exception e) {
            throw new EmbeddedJmxTransException("Exception registering '" + objectName + "'", e);
View Full Code Here

Examples of org.jmxtrans.embedded.config.ConfigurationParser

        if (embeddedJmxTrans == null) {

            if (configurationUrls == null) {
                configurationUrls = Collections.singletonList(DEFAULT_CONFIGURATION_URL);
            }
            ConfigurationParser parser = new ConfigurationParser();
            SpringEmbeddedJmxTrans newJmxTrans = new SpringEmbeddedJmxTrans();
            newJmxTrans.setObjectName("org.jmxtrans.embedded:type=EmbeddedJmxTrans,name=" + beanName);

            for (String delimitedConfigurationUrl : configurationUrls) {
                String[] tokens = StringUtils.commaDelimitedListToStringArray(delimitedConfigurationUrl);
                tokens = StringUtils.trimArrayElements(tokens);
                for (String configurationUrl : tokens) {
                    configurationUrl = configurationUrl.trim();
                    logger.debug("Load configuration {}", configurationUrl);
                    Resource configuration = resourceLoader.getResource(configurationUrl);
                    if (configuration.exists()) {
                        try {
                            parser.mergeEmbeddedJmxTransConfiguration(configuration.getInputStream(), newJmxTrans);
                        } catch (Exception e) {
                            throw new EmbeddedJmxTransException("Exception loading configuration " + configuration, e);
                        }
                    } else if (ignoreConfigurationNotFound) {
                        logger.debug("Ignore missing configuration file {}", configuration);
View Full Code Here

Examples of org.mybatis.generator.config.xml.ConfigurationParser

    List<String> warnings = new ArrayList<String>();
    boolean overwrite = true;
    String genCfg = "generatorConfig.xml";
    File configFile = new File(MyBatisGeneratorTool.class.getResource(
        genCfg).getFile());
    ConfigurationParser cp = new ConfigurationParser(warnings);
    Configuration config = null;
    try
    {
      System.out
          .println("--------->>>Start to generate code....--------------------");
      config = cp.parseConfiguration(configFile);
      DefaultShellCallback callback = new DefaultShellCallback(overwrite);
      MyBatisGenerator myBatisGenerator = null;
      myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
      myBatisGenerator.generate(null);
      System.out
View Full Code Here

Examples of org.mybatis.generator.config.xml.ConfigurationParser

        }
      }
    }

    try {
      ConfigurationParser cp = new ConfigurationParser(warnings);
      Configuration config = cp.parseConfiguration(configurationFile);

      DefaultShellCallback shellCallback = new DefaultShellCallback(arguments.containsKey(OVERWRITE));

      MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, shellCallback, warnings);
View Full Code Here

Examples of org.mybatis.generator.config.xml.ConfigurationParser

    }

    try {
      Properties p = propertyset == null ? null : propertyset.getProperties();

      ConfigurationParser cp = new ConfigurationParser(p, warnings);
      Configuration config = cp.parseConfiguration(configurationFile);

      DefaultShellCallback callback = new DefaultShellCallback(overwrite);

      MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
View Full Code Here

Examples of org.mybatis.generator.config.xml.ConfigurationParser

public class MyBatisGeneratorTest {

    @Test
    public void testGenerateMyBatis3() throws Exception {
        List<String> warnings = new ArrayList<String>();
        ConfigurationParser cp = new ConfigurationParser(warnings);
        Configuration config = cp.parseConfiguration(this.getClass().getClassLoader().getResourceAsStream("generatorConfigMyBatis3.xml"));
           
        DefaultShellCallback shellCallback = new DefaultShellCallback(true);
       
        boolean gotException = false;
        try {
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.