Examples of IConfig


Examples of de.mhus.lib.config.IConfig

  private Dialect dialect;
 
  @Override
  public synchronized Dialect getDialect() {
    if (dialect == null) {
      IConfig concon = config.getConfig("connection");
      String dialectName = concon.getExtracted("dialect");
      if (dialect != null) {
        try {
          dialect = (Dialect)activator.getObject(dialectName);
        } catch (Exception e) {
          log().t(dialect,e);
        }
      }
      if (dialect == null) {
        String driver = concon.getExtracted("driver");
        if (driver != null) {
          if (driver.indexOf("hsqldb") > 0)
            dialect = new DialectHsqldb();
          else
          if (driver.indexOf("mysql") > 0)
View Full Code Here

Examples of de.mhus.lib.config.IConfig

    return dialect;
  }

  @Override
  public InternalDbConnection createConnection() throws Exception {
    IConfig concon = config.getConfig("connection");
    String driver = concon.getExtracted("driver");
    String url = concon.getExtracted("url");
    String user = concon.getExtracted("user");
    String pass = concon.getExtracted("pass");
   
    if (!MString.isEmpty(driver)) {
//      activator.getClazz(driver);
      Class.forName(driver);
    }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

    config = null// force to reload config
  }
 
  public void initActivator() {
   
    IConfig cactivator = getConfig(MActivator.class,null);
    if (cactivator == null) return;
   
    log().t("Initialize Activator");
    try {
      IConfig cloader = cactivator.getConfig("loader");
      DynamicClassLoader loader = null;
      if (cloader != null) {
        loader = new DynamicClassLoader("main");
        loader.doSetupFromConfig(cloader);
      }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

      log().w(t);
    }
  }

  protected void initLogger() {
    IConfig clog = getConfig(MLog.class,null);
    if (clog == null) return;
   
    log().t("Initialize Logger");
    try {
      IConfig firstLogger = clog.getConfig("logger");
      if (firstLogger != null) {
        // create a logger
        Log log = LogInitializer.createLogFactroy(firstLogger);
        if (log != null) {
          setLogFactory(log);
View Full Code Here

Examples of de.mhus.lib.config.IConfig

    }
  }
 

  protected void initPersistence() {
    IConfig conf = getConfig(MPersistenceManager.class,null);
    if (conf == null) return;
    if (!conf.getBoolean("enabled", true)) return;
    log().t("Initialize Persistence");
   
    try {
      String clazz = conf.getExtracted("class",DefaultPersistence.class.getCanonicalName());
      if (clazz != null) {
        MPersistenceManager obj = (MPersistenceManager)getActivator().createObject(clazz);
        obj.init(conf);
        if (persistence != null) persistence.close();
        persistence = obj;
View Full Code Here

Examples of de.mhus.lib.config.IConfig

    }
   
  }
 
  protected void initJMX() {
    IConfig cjmx = getConfig(MRemoteManager.class,null);
    if (cjmx == null) return;

    log().t("Initialize JMX");
    try {
      getJmxManager().open();
View Full Code Here

Examples of de.mhus.lib.config.IConfig

      log().w(t);
    }
  }

  protected void initInjection() {
    IConfig ci = getConfig().getConfig("initialize");
    if (ci == null) return;
    for (IConfig cc : ci.getConfigBundle("start")) {
      if (ConfigUtil.checkCondition(cc)) {
        String clazz = cc.getExtracted("class");
        if (clazz != null) {
          try {
            Object obj = getActivator().createObject(clazz);
View Full Code Here

Examples of de.mhus.lib.config.IConfig

    if (isClosed) return;
    isClosed = true;
    log().i("close",name,cnt,getHitsPerSecond());
    try {
      if (MSingleton.instance().isPersistence()) {
        IConfig persistence = MSingleton.instance().getPersistenceManager().sessionScope().getPersistence("de.mhus.lib");
        long uid = MSingleton.instance().nextUniqueId();
        persistence.setString(getJmxName() + "_" + name + "_" + uid, getStatusAsString());
        if (rrd != null) {
          persistence.setString(getJmxName() + "_" + name + "_rrd_" + uid, rrd.dump());
        }
        persistence.save();
      }
    } catch (Throwable t) {
      log().t(t);
    }
  }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

   
    return this;
  }
 
  protected void build(XLayElement parent, IConfig layout) throws Exception {
    IConfig layoutLayout = layout.getConfig("layout");
    if (layoutLayout == null) return;
   
    for (IConfig cChild : layoutLayout.getConfigBundle()) {
      XLayElement child = activator.createObject(XLayElement.class, cChild.getName());
      parent.doAppendChild(child,cChild);
      child.setConfig(cChild);
     
      // remember if have name
View Full Code Here

Examples of de.mhus.lib.config.IConfig

          FieldRelation fr = new FieldRelation(manager, this, mName, setter, getter, ret, r);
          addField(fr);
         
        } else {
          log().t("field",mName);
          IConfig attr = MConfigFactory.getInstance().toConfig(toAttributes(p));
          boolean v = (p !=null && p.virtual());
         
          // check for doubled
          if (getField(mName) != null || getFieldRelation(mName) != null) {
            log().t("double field definition", mName);
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.