|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.config.ConfigurationManager
public class ConfigurationManager
The configuration manager is a central place where it manages the system wide Configuration and deployment context.
During initialization, this class will check system property "archaius.default.configuration.class" and "archaius.default.configuration.factory". If the former is set, it will use the class name to instantiate it using its default no-arg constructor. If the later is set, it will call its static method getInstance(). In both cases, the returned Configuration object will be set as the system wide configuration.
| Field Summary | |
|---|---|
static java.lang.String |
APPLICATION_PROPERTIES
|
static java.lang.String |
DISABLE_DEFAULT_ENV_CONFIG
System property to disable adding EnvironmentConfiguration to the default ConcurrentCompositeConfiguration |
static java.lang.String |
DISABLE_DEFAULT_SYS_CONFIG
System property to disable adding SystemConfiguration to the default ConcurrentCompositeConfiguration |
static java.lang.String |
ENV_CONFIG_NAME
|
static java.lang.String |
PROP_NEXT_LOAD
|
static java.lang.String |
SYS_CONFIG_NAME
|
static java.lang.String |
URL_CONFIG_NAME
|
| Constructor Summary | |
|---|---|
ConfigurationManager()
|
|
| Method Summary | |
|---|---|
static org.apache.commons.configuration.AbstractConfiguration |
getConfigFromPropertiesFile(java.net.URL startingUrl)
|
static org.apache.commons.configuration.AbstractConfiguration |
getConfigInstance()
Get the current system wide configuration. |
static DeploymentContext |
getDeploymentContext()
|
static java.util.Set<java.lang.String> |
getLoadedPropertiesURLs()
|
static java.util.Properties |
getPropertiesFromFile(java.net.URL startingUrl)
|
static void |
install(org.apache.commons.configuration.AbstractConfiguration config)
Install the system wide configuration with the ConfigurationManager. |
static boolean |
isConfigurationInstalled()
|
static void |
loadAppOverrideProperties(java.lang.String appConfigName)
|
static void |
loadCascadedPropertiesFromResources(java.lang.String configName)
Load resource configName.properties first. |
static void |
loadProperties(java.util.Properties properties)
Load the specified properties into system wide configuration |
static void |
loadPropertiesFromConfiguration(org.apache.commons.configuration.AbstractConfiguration config)
Load properties from the specified configuration into system wide configuration |
static void |
loadPropertiesFromResources(java.lang.String path)
Load properties from resource file(s) into the system wide configuration |
static void |
setDeploymentContext(DeploymentContext context)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROP_NEXT_LOAD
public static final java.lang.String URL_CONFIG_NAME
public static final java.lang.String SYS_CONFIG_NAME
public static final java.lang.String ENV_CONFIG_NAME
public static final java.lang.String DISABLE_DEFAULT_ENV_CONFIG
public static final java.lang.String DISABLE_DEFAULT_SYS_CONFIG
public static final java.lang.String APPLICATION_PROPERTIES
| Constructor Detail |
|---|
public ConfigurationManager()
| Method Detail |
|---|
public static java.util.Set<java.lang.String> getLoadedPropertiesURLs()
public static void install(org.apache.commons.configuration.AbstractConfiguration config)
throws java.lang.IllegalStateException
DynamicPropertyFactory by calling DynamicPropertyFactory.initWithConfigurationSource(AbstractConfiguration).
This call can be made only once, otherwise IllegalStateException will be thrown.
java.lang.IllegalStateExceptionpublic static boolean isConfigurationInstalled()
public static org.apache.commons.configuration.AbstractConfiguration getConfigInstance()
ConcurrentCompositeConfiguration which contains a SystemConfiguration from Apache Commons
Configuration and a DynamicURLConfiguration.
public static void loadPropertiesFromResources(java.lang.String path)
throws java.io.IOException
path - relative path of the resources
java.io.IOException
public static void loadCascadedPropertiesFromResources(java.lang.String configName)
throws java.io.IOException
configName - prefix of the properties file name.
java.io.IOExceptionDeploymentContext.getDeploymentEnvironment()
public static void loadAppOverrideProperties(java.lang.String appConfigName)
throws java.io.IOException
java.io.IOExceptionpublic static void loadPropertiesFromConfiguration(org.apache.commons.configuration.AbstractConfiguration config)
public static void loadProperties(java.util.Properties properties)
public static void setDeploymentContext(DeploymentContext context)
public static DeploymentContext getDeploymentContext()
public static org.apache.commons.configuration.AbstractConfiguration getConfigFromPropertiesFile(java.net.URL startingUrl)
throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static java.util.Properties getPropertiesFromFile(java.net.URL startingUrl)
throws java.io.FileNotFoundException
java.io.FileNotFoundException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||