Class TreePathDynamicConfiguration
java.lang.Object
org.apache.dubbo.common.config.configcenter.AbstractDynamicConfiguration
org.apache.dubbo.common.config.configcenter.TreePathDynamicConfiguration
- All Implemented Interfaces:
AutoCloseable,DynamicConfiguration,Configuration
An abstract implementation of
DynamicConfiguration is like "tree-structure" path :
-
invalid reference
"file" -
invalid reference
"zookeeper"
- Since:
- 2.7.8
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe parameter name of URL for the config base pathstatic final StringThe parameter name of URL for the config root pathstatic final StringThe default value of parameter of URL for the config base pathFields inherited from class org.apache.dubbo.common.config.configcenter.AbstractDynamicConfiguration
DEFAULT_THREAD_POOL_KEEP_ALIVE_TIME, DEFAULT_THREAD_POOL_PREFIX, DEFAULT_THREAD_POOL_SIZE, GROUP_PARAM_NAME, PARAM_NAME_PREFIX, THREAD_POOL_KEEP_ALIVE_TIME_PARAM_NAME, THREAD_POOL_PREFIX_PARAM_NAME, THREAD_POOL_SIZE_PARAM_NAME, TIMEOUT_PARAM_NAMEFields inherited from interface org.apache.dubbo.common.config.Configuration
interfaceLevelLoggerFields inherited from interface org.apache.dubbo.common.config.configcenter.DynamicConfiguration
DEFAULT_GROUP -
Constructor Summary
ConstructorsConstructorDescriptionTreePathDynamicConfiguration(String rootPath, String threadPoolPrefixName, int threadPoolSize, long keepAliveTime, String group, long timeout) -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.final booleanpublishConfig(String key, String group, String content) Publish Config mapped to the given key and the given group.final voidremoveListener(String key, String group, ConfigurationListener listener) Stops one listener from listening to value changes in the specified key.Methods inherited from class org.apache.dubbo.common.config.configcenter.AbstractDynamicConfiguration
close, getConfig, getDefaultGroup, getDefaultTimeout, getInternalProperty, removeConfigMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.dubbo.common.config.Configuration
containsKey, convert, getBoolean, getBoolean, getBoolean, getInt, getInt, getInteger, getProperty, getProperty, getString, getStringMethods inherited from interface org.apache.dubbo.common.config.configcenter.DynamicConfiguration
addListener, getConfig, getConfigItem, getProperties, getProperties, publishConfig, publishConfigCas, removeListener
-
Field Details
-
CONFIG_ROOT_PATH_PARAM_NAME
The parameter name of URL for the config root path- See Also:
-
CONFIG_BASE_PATH_PARAM_NAME
The parameter name of URL for the config base path- See Also:
-
DEFAULT_CONFIG_BASE_PATH
The default value of parameter of URL for the config base path- See Also:
-
-
Constructor Details
-
TreePathDynamicConfiguration
-
TreePathDynamicConfiguration
-
-
Method Details
-
publishConfig
Description copied from interface:DynamicConfigurationPublish Config mapped to the given key and the given group.- Parameters:
key- the key to represent a configurationgroup- the group where the key belongs tocontent- the content of configuration- Returns:
trueif success, orfalse
-
addListener
Description copied from interface: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.- Specified by:
addListenerin interfaceDynamicConfiguration- Overrides:
addListenerin classAbstractDynamicConfiguration- Parameters:
key- the key to represent a configurationgroup- the group where the key belongs tolistener- configuration listener
-
removeListener
Description copied from interface:DynamicConfigurationStops one listener from listening to value changes in the specified key.- Specified by:
removeListenerin interfaceDynamicConfiguration- Overrides:
removeListenerin classAbstractDynamicConfiguration- Parameters:
key- the key to represent a configurationgroup- the group where the key belongs tolistener- configuration listener
-