public class ConfigurationManagerImpl extends Object implements ConfigurationManager
Constructor and Description |
---|
ConfigurationManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
distributeConfiguration()
分发应用配置
应用配置会促使配置管理器把配置信息推送到配置订阅者 |
XmlNode |
getApplicationConfiguration()
返回管理器的应用配置
|
XmlNode |
getComponentConfiguration(String key)
返回单个组件配置信息
|
Map<String,XmlNode> |
getComponentConfigurationMap()
以map数据结构返回配置管理器关联的所有组件配置信息
|
Map<String,String> |
getConfiguration()
Deprecated.
|
<T> T |
getConfiguration(Class<T> type,
String key,
T defaultValue)
返回指定类型的配置信息,内部会进行类型转换
|
String |
getConfiguration(String key)
返回key对应的配置信息
|
void |
loadConfiguration() |
void |
replace()
重新加载应用配置信息,进行变量替换,然后返回变量替换后的配置信息作为新的应用配置信息
|
void |
setApplicationConfiguration(XmlNode applicationConfiguration)
给配置管理器设置应用配置信息
|
void |
setComponentConfiguration(String key,
XmlNode componentConfiguration)
设置单个组件配置
|
void |
setComponentConfigurationMap(Map<String,XmlNode> componentConfigurationMap)
设置组件配置信息
|
void |
setConfiguration(String key,
String value)
设置KeyValue形式的值
|
void |
setConfigurationList(Collection<Configuration> configurationList)
设置配置管理器内部管理的所有配置对象
|
void |
setConfigurationLoader(ConfigurationLoader configurationLoader)
设置配置加载器
|
public void setConfigurationLoader(ConfigurationLoader configurationLoader)
ConfigurationManager
setConfigurationLoader
in interface ConfigurationManager
configurationLoader
- 配置加载器public void setComponentConfiguration(String key, XmlNode componentConfiguration)
ConfigurationManager
setComponentConfiguration
in interface ConfigurationManager
key
- 组件配置映射的keycomponentConfiguration
- 组件配置public XmlNode getApplicationConfiguration()
ConfigurationManager
getApplicationConfiguration
in interface ConfigurationManager
public void setApplicationConfiguration(XmlNode applicationConfiguration)
ConfigurationManager
setApplicationConfiguration
in interface ConfigurationManager
applicationConfiguration
- 应用配置信息,指的是application.xml文件public Map<String,XmlNode> getComponentConfigurationMap()
ConfigurationManager
getComponentConfigurationMap
in interface ConfigurationManager
public void setComponentConfigurationMap(Map<String,XmlNode> componentConfigurationMap)
ConfigurationManager
setComponentConfigurationMap
in interface ConfigurationManager
componentConfigurationMap
- 所有组件配置组成的mappublic XmlNode getComponentConfiguration(String key)
ConfigurationManager
getComponentConfiguration
in interface ConfigurationManager
key
- 组件配置映射的keypublic void distributeConfiguration()
ConfigurationManager
distributeConfiguration
in interface ConfigurationManager
public void setConfigurationList(Collection<Configuration> configurationList)
ConfigurationManager
setConfigurationList
in interface ConfigurationManager
configurationList
- 配置对象组成的列表public void setConfiguration(String key, String value)
ConfigurationManager
setConfiguration
in interface ConfigurationManager
key
- 配置名称value
- 配置名称对应的值public <T> T getConfiguration(Class<T> type, String key, T defaultValue)
ConfigurationManager
getConfiguration
in interface ConfigurationManager
type
- 类型key
- 配置名称defaultValue
- 默认值public void loadConfiguration()
@Deprecated public Map<String,String> getConfiguration()
ConfigurationManager
getConfiguration
in interface ConfigurationManager
public String getConfiguration(String key)
ConfigurationManager
getConfiguration
in interface ConfigurationManager
key
- 配置名称public void replace()
ConfigurationManager
replace
in interface ConfigurationManager
public void clear()
clear
in interface ConfigurationManager
Copyright © 2006–2018 TinyGroup. All rights reserved.