Exemple #1
0
 public void load() {
   log.debug("requesting config keys for " + prefix);
   Set<String> nameKeys =
       ObjectConfig.getInstance().filterProperties(prefix + ".names").stringPropertyNames();
   for (String key : nameKeys) {
     log.debug("key: " + key);
     String keyBase = key.replace(prefix + ".names", "");
     String name = ObjectConfig.getInstance().getValue(key, "");
     log.debug("Requesting value for key: " + prefix + ".values" + keyBase);
     StringValue value = ObjectConfig.getStringValue(prefix + ".values" + keyBase, "");
     if (value != null && !value.equals("")) {
       map.put(name, value);
     }
   }
 }
Exemple #2
0
 /** remove a key-value pair by key */
 public void remove(String name) {
   StringValue v = get(name);
   if (v != null) {
     log.debug("Removing name: " + name);
     map.remove(name);
     ObjectConfig.remove(v.key);
     ObjectConfig.remove(v.key.replace(".values.", ".names."));
   }
 }