Examples of IConfig


Examples of de.mhus.lib.config.IConfig

  public void init() {
    try {
      if (configPath != null) {
        File file = new File(configPath);
        if (file.exists()) {
          IConfig config = MConfigFactory.getInstance().createConfigFor(file);
          IConfig cDb = config.getConfig("database");
          if (cDb == null) {
            cDb = config.createConfig("database");
          }
          IConfig cConnection = cDb.getConfig("connection");
          if (cConnection == null) {
            cConnection = cDb.createConfig("connection");
          }
          if (!MString.isEmpty(password)) cConnection.setString("pass", password);
          if (!MString.isEmpty(url)) cConnection.setString("url", url);
          if (!MString.isEmpty(user)) cConnection.setString("user", user);
          if (!MString.isEmpty(driver)) cConnection.setString("driver", driver);
          setConfig(config);
        }
      }
    } catch (Throwable t) {
      log.d(t);
View Full Code Here

Examples of de.mhus.lib.config.IConfig

   * @param config
   * @throws MException
   */
  public static void fillTables(MetadataBundle bundle, IConfig config) throws MException {
    for (Entry<String, CaoMetadata> meta : bundle.getBundle().entrySet()) {
      IConfig cTab = config.createConfig("table");
      cTab.setProperty("name", meta.getKey());
      fillColumns(meta.getValue(),cTab);
    }
  }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

   * @param config
   * @throws MException
   */
  public static void fillColumns(CaoMetadata meta, IConfig config) throws MException {
    for (CaoMetaDefinition m : meta) {
      IConfig cM = config.createConfig("column");

      cM.setProperty("name", m.getName());
      cM.setProperty("type", m.getType().toString() );
      if (m.getNls() != null)
        cM.setProperty("nls", m.getNls());
      if (m.getSize() > 0)
        cM.setProperty("size", String.valueOf(m.getSize()) );
      if(m.getCategories() != null)
        cM.setProperty("categories", MString.join(m.getCategories(),',') );
    }
  }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

       
      }
    }
   
   
    IConfig cRules = config.getConfig("rules");
    if (cRules != null) {
     
      String def = cRules.getExtracted("default","OWN").toUpperCase();
      log.d("default rule",this,def);
      setDefaultRule(RESULT.valueOf(def));
     
      LinkedList<Rule> r = new LinkedList<DynamicClassLoader.Rule>();
      for (IConfig sub : cRules.getConfigBundle("rule")) {
        log.d("add rule",this,sub.getExtracted("pattern"),sub.getExtracted("result","FORWARD"));
        r.add(new Rule(sub.getExtracted("pattern"), RESULT.valueOf(sub.getExtracted("result","FORWARD").toUpperCase()) ));
      }
      setRules(r);
    }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

     return f.exists() ? f.getAbsolutePath() : null;
  }
 
  @JmxManaged
  public String dumpPersistentConfig(String name) {
    IConfig p = getPersistence(name);
    if (p == null) return null;
   
    Element e = ((XmlConfigFile)p).getXmlElement();
   
    try {
View Full Code Here

Examples of de.mhus.lib.config.IConfig

  public JpaProperties(IConfig config) {
    super();
    this.config = config;
    // fill from config
    IConfig cproperties = config.getConfig("properties");
    if (cproperties != null) {
      for (IConfig prop : cproperties.getConfigBundle("property")) {
        setProperty(prop.getExtracted("name"), prop.getExtracted("value"));
      }
    }
   
  }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

    HttpUnitOptions.setScriptingEnabled(false);

    JackConfiguration c = ((JackConnection)app.getConnection()).getConfiguration();
    setAuthorization(c.getUser(), c.getPassword());
    setUserAgent("cao");
    IConfig proxy = app.getConfig().getConfig("proxy");
    if (proxy != null) {
      setProxyServer(proxy.getExtracted("host"), MCast.toint(proxy.getExtracted("port", "8080"),8080), proxy.getExtracted("user"), proxy.getExtracted("password"));
    }
  }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

     WebRequest req = new GetMethodWebRequest( app.getUri(element) + suffix );
     WebResponse res = getResponse( req );
     if ( res.getResponseCode() != 200 )
       return null;
     String content = res.getText();
     IConfig config = MConfigFactory.getInstance().toConfig(content);
     return config;
  }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

     }
     WebResponse res = getResponse( req );
     if ( res.getResponseCode() != 200 )
       return null;
     String content = res.getText();
     IConfig config = MConfigFactory.getInstance().toConfig(content);
     return config;
  }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

     WebResponse res = getResponse( req );
     if ( res.getResponseCode() != 200 )
       return null;
     String content = res.getText();
     IConfig config = MConfigFactory.getInstance().toConfig(content);
     return config;
  }
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.