Package org.jolokia.server.core.config
Class StaticConfiguration
java.lang.Object
org.jolokia.server.core.config.StaticConfiguration
- All Implemented Interfaces:
Configuration
Class encapsulating all Agent configuration, global config and processing parameters
- Since:
- 07.02.13
- Author:
- roland
-
Constructor Summary
ConstructorsConstructorDescriptionStaticConfiguration(Object... keyAndValues) Convenience constructor for setting up base configuration with key values pairs.StaticConfiguration(Map<String, String> pConfig) Initialise this configuration from a string-string map. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(ConfigKey pKey) Check whether the given configuration holds a value for the given keyGet a configuration value if set as configuration or the default value if notGet a configuration value if set as configuration or the default value if notGet all keys stored in this configurationvoidupdate(ConfigExtractor pExtractor) Update the configuration hold by this objectvoidupdate(Configuration pConfig) Update from another configuration object whose values take precedence
-
Constructor Details
-
StaticConfiguration
Convenience constructor for setting up base configuration with key values pairs. This constructor is especially suited for unit tests.- Parameters:
keyAndValues- an array with even number of elements and ConfigKey and String alternating.
-
StaticConfiguration
Initialise this configuration from a string-string map. Only the known keys are taken from the given map- Parameters:
pConfig- config map from where to take the configuration
-
-
Method Details
-
update
Update the configuration hold by this object- Parameters:
pExtractor- an extractor for retrieving the configuration from some external object
-
update
Update from another configuration object whose values take precedence- Parameters:
pConfig- update configuration from the given config
-
getConfig
Get a configuration value if set as configuration or the default value if not- Specified by:
getConfigin interfaceConfiguration- Parameters:
pKey- the configuration key to lookup- Returns:
- the configuration value or the default value if no configuration was given.
-
getConfig
Get a configuration value if set as configuration or the default value if not- Specified by:
getConfigin interfaceConfiguration- Parameters:
pKey- the configuration key to lookupcheckSysOrEnv- whether system property or environment variable should be checked first- Returns:
- the configuration value or the default value if no configuration was given.
-
getConfigKeys
Get all keys stored in this configuration- Specified by:
getConfigKeysin interfaceConfiguration
-
containsKey
Check whether the given configuration holds a value for the given key- Specified by:
containsKeyin interfaceConfiguration- Parameters:
pKey- key to check- Returns:
- true if the configuration has this key
-