类 NacosDynamicConfiguration
- java.lang.Object
-
- org.apache.dubbo.configcenter.support.nacos.NacosDynamicConfiguration
-
- 所有已实现的接口:
AutoCloseable,DynamicConfiguration,Configuration
public class NacosDynamicConfiguration extends Object implements DynamicConfiguration
The nacos implementation ofDynamicConfiguration
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 classNacosDynamicConfiguration.NacosConfigListener
-
字段概要
-
从接口继承的字段 org.apache.dubbo.common.config.configcenter.DynamicConfiguration
DEFAULT_GROUP
-
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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)TODO Nacos does not support atomic update of the value mapped to a key.longgetDefaultTimeout()Get the default timeout for the operations in millisecondsObjectgetInternalProperty(String key)booleanpublishConfig(String key, String group, String content)Publish Config mapped to the given key and the given group.booleanremoveConfig(String key, String 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, getProperties, getProperties, publishConfig, removeListener
-
-
-
-
方法详细资料
-
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
-
getInternalProperty
public Object getInternalProperty(String key)
- 指定者:
getInternalProperty在接口中Configuration
-
publishConfig
public boolean publishConfig(String key, String group, String content)
从接口复制的说明: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
-
getDefaultTimeout
public long getDefaultTimeout()
从接口复制的说明:DynamicConfigurationGet the default timeout for the operations in milliseconds- 指定者:
getDefaultTimeout在接口中DynamicConfiguration- 返回:
- The default value is
-1L
-
getConfigKeys
public SortedSet<String> getConfigKeys(String group)
TODO Nacos does not support atomic update of the value mapped to a key.- 指定者:
getConfigKeys在接口中DynamicConfiguration- 参数:
group- the specified group- 返回:
-
removeConfig
public boolean removeConfig(String key, String group)
- 指定者:
removeConfig在接口中DynamicConfiguration- 参数:
key- the key to represent a configurationgroup- the group where the key belongs to- 返回:
trueif success, orfalse
-
-