类 CompositeDynamicConfiguration
- java.lang.Object
-
- org.apache.dubbo.common.config.configcenter.wrapper.CompositeDynamicConfiguration
-
- 所有已实现的接口:
AutoCloseable,DynamicConfiguration,Configuration
public class CompositeDynamicConfiguration extends Object implements DynamicConfiguration
support multiple config center, simply iterating each concrete config center.
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringNAME-
从接口继承的字段 org.apache.dubbo.common.config.configcenter.DynamicConfiguration
DEFAULT_GROUP
-
-
构造器概要
构造器 构造器 说明 CompositeDynamicConfiguration()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddConfiguration(DynamicConfiguration configuration)voidaddListener(String key, String group, ConfigurationListener listener)Register a configuration listener for a specified key The listener only works for service governance purpose, so the target group would always be the value user specifies at startup or 'dubbo' by default.StringgetConfig(String key, String group, long timeout)Get the configuration mapped to the given key and the given group.SortedSet<String>getConfigKeys(String group)Get the config keys by the specified groupObjectgetInternalProperty(String key)StringgetProperties(String key, String group, long timeout)This method are mostly used to get a compound config file, such as a complete dubbo.properties file.booleanpublishConfig(String key, String group, String content)Publish Config mapped to the given key and the given group.voidremoveListener(String key, String group, ConfigurationListener listener)Stops one listener from listening to value changes in the specified key.-
从接口继承的方法 org.apache.dubbo.common.config.Configuration
containsKey, convert, getBoolean, getBoolean, getBoolean, getInt, getInt, getInteger, getProperty, getProperty, getString, getString
-
从接口继承的方法 org.apache.dubbo.common.config.configcenter.DynamicConfiguration
addListener, close, getConfig, getDefaultGroup, getDefaultTimeout, getProperties, publishConfig, removeConfig, removeListener
-
-
-
-
方法详细资料
-
addConfiguration
public void addConfiguration(DynamicConfiguration configuration)
-
addListener
public void addListener(String key, String group, ConfigurationListener listener)
从接口复制的说明:DynamicConfigurationRegister a configuration listener for a specified key The listener only works for service governance purpose, so the target group would always be the value user specifies at startup or 'dubbo' by default. This method will only register listener, which means it will not trigger a notification that contains the current value.- 指定者:
addListener在接口中DynamicConfiguration- 参数:
key- the key to represent a configurationgroup- the group where the key belongs tolistener- configuration listener
-
removeListener
public void removeListener(String key, String group, ConfigurationListener listener)
从接口复制的说明:DynamicConfigurationStops one listener from listening to value changes in the specified key.- 指定者:
removeListener在接口中DynamicConfiguration- 参数:
key- the key to represent a configurationgroup- the group where the key belongs tolistener- configuration listener
-
getConfig
public String getConfig(String key, String group, long timeout) throws IllegalStateException
从接口复制的说明:DynamicConfigurationGet the configuration mapped to the given key and the given group. If the configuration fails to fetch after timeout exceeds, IllegalStateException will be thrown.- 指定者:
getConfig在接口中DynamicConfiguration- 参数:
key- the key to represent a configurationgroup- the group where the key belongs totimeout- timeout value for fetching the target config- 返回:
- target configuration mapped to the given key and the given group, IllegalStateException will be thrown if timeout exceeds.
- 抛出:
IllegalStateException
-
getProperties
public String getProperties(String key, String group, long timeout) throws IllegalStateException
从接口复制的说明:DynamicConfigurationThis method are mostly used to get a compound config file, such as a complete dubbo.properties file.- 指定者:
getProperties在接口中DynamicConfiguration- 抛出:
IllegalStateException
-
getInternalProperty
public Object getInternalProperty(String key)
- 指定者:
getInternalProperty在接口中Configuration
-
publishConfig
public boolean publishConfig(String key, String group, String content) throws UnsupportedOperationException
从接口复制的说明:DynamicConfigurationPublish Config mapped to the given key and the given group.- 指定者:
publishConfig在接口中DynamicConfiguration- 参数:
key- the key to represent a configurationgroup- the group where the key belongs tocontent- the content of configuration- 返回:
trueif success, orfalse- 抛出:
UnsupportedOperationException- If the under layer does not support
-
getConfigKeys
public SortedSet<String> getConfigKeys(String group) throws UnsupportedOperationException
从接口复制的说明:DynamicConfigurationGet the config keys by the specified group- 指定者:
getConfigKeys在接口中DynamicConfiguration- 参数:
group- the specified group- 返回:
- the read-only non-null sorted
setof config keys - 抛出:
UnsupportedOperationException- If the under layer does not support
-
-