public class NacosDynamicConfiguration extends Object implements DynamicConfiguration
DynamicConfiguration| 限定符和类型 | 类和说明 |
|---|---|
class |
NacosDynamicConfiguration.NacosConfigListener |
DEFAULT_GROUP| 限定符和类型 | 方法和说明 |
|---|---|
void |
addListener(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.
|
String |
getConfig(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.
|
long |
getDefaultTimeout()
Get the default timeout for the operations in milliseconds
|
Object |
getInternalProperty(String key) |
boolean |
publishConfig(String key,
String group,
String content)
Publish Config mapped to the given key and the given group.
|
boolean |
removeConfig(String key,
String group) |
void |
removeListener(String key,
String group,
ConfigurationListener listener)
Stops one listener from listening to value changes in the specified key.
|
addListener, close, getConfig, getDefaultGroup, getDynamicConfiguration, getDynamicConfiguration, getProperties, getProperties, getRuleKey, publishConfig, removeListenercontainsKey, convert, getBoolean, getBoolean, getBoolean, getInt, getInt, getInteger, getProperty, getProperty, getString, getString, toBooleanObjectpublic void addListener(String key, String group, ConfigurationListener listener)
DynamicConfigurationaddListener 在接口中 DynamicConfigurationkey - the key to represent a configurationgroup - the group where the key belongs tolistener - configuration listenerpublic void removeListener(String key, String group, ConfigurationListener listener)
DynamicConfigurationremoveListener 在接口中 DynamicConfigurationkey - the key to represent a configurationgroup - the group where the key belongs tolistener - configuration listenerpublic String getConfig(String key, String group, long timeout) throws IllegalStateException
DynamicConfigurationgetConfig 在接口中 DynamicConfigurationkey - the key to represent a configurationgroup - the group where the key belongs totimeout - timeout value for fetching the target configIllegalStateExceptionpublic Object getInternalProperty(String key)
getInternalProperty 在接口中 Configurationpublic boolean publishConfig(String key, String group, String content)
DynamicConfigurationpublishConfig 在接口中 DynamicConfigurationkey - the key to represent a configurationgroup - the group where the key belongs tocontent - the content of configurationtrue if success, or falsepublic long getDefaultTimeout()
DynamicConfigurationgetDefaultTimeout 在接口中 DynamicConfiguration-1Lpublic SortedSet<String> getConfigKeys(String group)
getConfigKeys 在接口中 DynamicConfigurationgroup - the specified grouppublic boolean removeConfig(String key, String group)
removeConfig 在接口中 DynamicConfigurationkey - the key to represent a configurationgroup - the group where the key belongs totrue if success, or falseCopyright © 2011–2021 The Apache Software Foundation. All rights reserved.