示例#1
0
 private String getConfiguration(ConfigKey pKey) {
   // TODO: Use fragments and/or configuration service if available.
   String value = bundleContext.getProperty(CONFIG_PREFIX + "." + pKey.getKeyValue());
   if (value == null) {
     value = pKey.getDefaultValue();
   }
   return value;
 }
示例#2
0
 // Customizer for registering servlet at a HttpService
 private Dictionary<String, String> getConfiguration() {
   Dictionary<String, String> config = new Hashtable<String, String>();
   for (ConfigKey key : ConfigKey.values()) {
     String value = getConfiguration(key);
     if (value != null) {
       config.put(key.getKeyValue(), value);
     }
   }
   return config;
 }
示例#3
0
 /**
  * Get a processing configuration as a boolean value
  *
  * @param pConfigKey configuration to lookup
  * @return boolean value of the configuration, the default value or false if the default value is
  *     null
  */
 public Boolean getParameterAsBool(ConfigKey pConfigKey) {
   String booleanS = getParameter(pConfigKey);
   return Boolean.parseBoolean(booleanS != null ? booleanS : pConfigKey.getDefaultValue());
 }