Package org.xmlBlaster.contrib

Examples of org.xmlBlaster.contrib.InfoHelper$Replacer


    * @param prefs The configuration store
    */
   public Info(Preferences prefs) {
      this.prefs = prefs;
      this.objects = new HashMap();
      this.helper = new InfoHelper(this);
      this.helper.replaceAllEntries(this, null);
   }
View Full Code Here


      if (id == null)
         this.prefs = Preferences.userRoot();
      else
         this.prefs = Preferences.userRoot().node(id);
      this.objects = new HashMap();
      this.helper = new InfoHelper(this);
      this.helper.replaceAllEntries(this, null);
   }
View Full Code Here

   /**
    * @param clientPropertyMap Can be null
    */
   public DbInfo(I_DbPool pool, String id, I_Info info) throws Exception {
      this.storage = new DbStorage(info, pool, id);
      this.helper = new InfoHelper(this);
      this.objects = new HashMap();
      // performance impact. It should anyway be clean what is in the Db.
      // this.helper.replaceAllEntries(this, null);
      // to add this to JMX
      if (pool instanceof DbPool) {
View Full Code Here

      info.put("dbs.keyName", keyName);
      info.put("dbs.valueName", valueName);
      info.put("dbs.typeName", typeName);
      info.put("dbs.encodingName", encodingName);
     
      InfoHelper helper = new InfoHelper(info);
     
      tmp = "CREATE TABLE ${dbs.table} (${dbs.contextName} VARCHAR(255), ${dbs.keyName} VARCHAR(255), ${dbs.valueName} VARCHAR(255), ${dbs.typeName} VARCHAR(16), ${dbs.encodingName} VARCHAR(16), PRIMARY KEY (${dbs.contextName}, ${dbs.keyName}))";
      createSql = helper.replace(info.get("dbs.createSql", tmp));
      createTableOrReadColumnNames(originalNames, info);

     
      log.fine("create statement: '" + createSql + "'");
      tmp = "UPDATE ${dbs.table} SET ${dbs.valueName}=?, ${dbs.typeName}=?, ${dbs.encodingName}=? WHERE ${dbs.contextName}=? AND ${dbs.keyName}=?";
      modifySql = helper.replace(info.get("dbs.mofifySql", tmp));
      log.fine("modify statement: '" + modifySql + "'");
      tmp = "INSERT INTO ${dbs.table} VALUES(?, ?, ?, ?, ?)";
      addSql = helper.replace(info.get("dbs.addSql", tmp));
      log.fine("add statement: '" + addSql + "'");
      tmp = "SELECT * FROM ${dbs.table} WHERE ${dbs.contextName}=? AND ${dbs.keyName}=?";
      getSql = helper.replace(info.get("dbs.getSql", tmp));
      log.fine("get statement: '" + getSql + "'");
      tmp = "DELETE FROM ${dbs.table} WHERE ${dbs.contextName}='${dbs.context}'";
      cleanSql = helper.replace(info.get("dbs.cleanSql", tmp));
      log.fine("clean statement: '" + cleanSql + "'");
      tmp = "SELECT ${dbs.keyName} FROM ${dbs.table} WHERE ${dbs.contextName}=?";
      getKeysSql = helper.replace(info.get("db.getKeysSql", tmp));
      log.fine("getKeys statement: '" + getKeysSql + "'");
      tmp = "DELETE FROM ${dbs.table} WHERE ${dbs.contextName}='${dbs.context}' AND ${dbs.keyName}=?";
      deleteSql = helper.replace(info.get("dbs.deleteSql", tmp));
      log.fine("delete statement: '" + deleteSql + "'");
      /*
      this.createSql = "CREATE TABLE " + table + " (context VARCHAR(255), " + KEY_TXT + " VARCHAR(255), value VARCHAR(255), type VARCHAR(16), encoding VARCHAR(16), PRIMARY KEY (context, " + KEY_TXT + "))";
      this.modifySql = "UPDATE " + table + " SET value=?, type=?, encoding=? WHERE context=? AND " + KEY_TXT + "=?";
      this.addSql = "INSERT INTO " + table + " VALUES(?, ?, ?, ?, ?)";
View Full Code Here

      assertEquals("testing key '" + key + "'", "${five}", val);
     
     
      props.put("test.${one}", "testOne");
      props.put("test.${two}", "test_${two}");
      InfoHelper helper = new InfoHelper(propInfo);
      helper.replaceAllEntries(propInfo, null);
      Map testProps = InfoHelper.getPropertiesStartingWith("test.", propInfo, null);
      assertEquals("wrong number of properties starting with *" + testProps + "'", 2, testProps.size());
     
      log.info("SUCCESS");
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.contrib.InfoHelper$Replacer

Copyright © 2018 www.massapicom. 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.