/** * Get a processing parameter * * @param pKey key to lookup * @return the value or the default value from the key if no config value is set */ public String get(ConfigKey pKey) { String value = params.get(pKey); if (value != null) { return value; } else { return pKey.getDefaultValue(); } }
/** * Get a configuration value if set as configuration or the default * value if not * * @param pKey the configuration key to lookup * @return the configuration value or the default value if no configuration * was given. */ public String get(ConfigKey pKey) { String value = globalConfig.get(pKey); if (value == null) { value = pKey.getDefaultValue(); } return value; }
/** * 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()); }
private void initContext() { context = jolokiaConfig.get(ConfigKey.AGENT_CONTEXT); if (context == null) { context = ConfigKey.AGENT_CONTEXT.getDefaultValue(); } if (!context.endsWith("/")) { context += "/"; } }
/** * Get an configuration value as int value * @param pKey the configuration key * @return the value set or, if not, the default value */ public int getAsInt(ConfigKey pKey) { int ret; try { ret = Integer.parseInt(get(pKey)); } catch (NumberFormatException exp) { ret = Integer.parseInt(pKey.getDefaultValue()); } return ret; }
private String getConfiguration(ConfigKey pKey) { // TODO: Use fragments if available. String value = getConfigurationFromConfigAdmin(pKey); if (value == null) { value = bundleContext.getProperty(CONFIG_PREFIX + "." + pKey.getKeyValue()); } if (value == null) { value = pKey.getDefaultValue(); } return value; }
" (default: InetAddress.getLocalHost())\n" + " --port <port> Port to listen on (default: 8778)\n" + " --agentContext <context> HTTP Context under which the agent is reachable (default: " + ConfigKey.AGENT_CONTEXT.getDefaultValue() + ")\n" + " --agentId <agent-id> VM unique identifier used by this agent (default: autogenerated)\n" + " --agentDescription <desc> Agent description\n" +
/** * Get a processing parameter * * @param pKey key to lookup * @return the value or the default value from the key if no config value is set */ public String get(ConfigKey pKey) { String value = params.get(pKey); if (value != null) { return value; } else { return pKey.getDefaultValue(); } }
/** * Get a processing parameter * * @param pKey key to lookup * @return the value or the default value from the key if no config value is set */ public String get(ConfigKey pKey) { String value = params.get(pKey); if (value != null) { return value; } else { return pKey.getDefaultValue(); } }
/** * Get a configuration value if set as configuration or the default * value if not * * @param pKey the configuration key to lookup * @return the configuration value or the default value if no configuration * was given. */ public String get(ConfigKey pKey) { String value = globalConfig.get(pKey); if (value == null) { value = pKey.getDefaultValue(); } return value; }
/** * Get a configuration value if set as configuration or the default * value if not * * @param pKey the configuration key to lookup * @return the configuration value or the default value if no configuration * was given. */ public String get(ConfigKey pKey) { String value = globalConfig.get(pKey); if (value == null) { value = pKey.getDefaultValue(); } return value; }
/** * 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()); }
/** * 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()); }
/** * Get an configuration value as int value * @param pKey the configuration key * @return the value set or, if not, the default value */ public int getAsInt(ConfigKey pKey) { int ret; try { ret = Integer.parseInt(get(pKey)); } catch (NumberFormatException exp) { ret = Integer.parseInt(pKey.getDefaultValue()); } return ret; }
/** * Get an configuration value as int value * @param pKey the configuration key * @return the value set or, if not, the default value */ public int getAsInt(ConfigKey pKey) { int ret; try { ret = Integer.parseInt(get(pKey)); } catch (NumberFormatException exp) { ret = Integer.parseInt(pKey.getDefaultValue()); } return ret; }
private String getConfiguration(ConfigKey pKey) { // TODO: Use fragments if available. String value = getConfigurationFromConfigAdmin(pKey); if (value == null) { value = bundleContext.getProperty(CONFIG_PREFIX + "." + pKey.getKeyValue()); } if (value == null) { value = pKey.getDefaultValue(); } return value; }