类 AbstractDynamicConfiguration
- java.lang.Object
-
- org.apache.dubbo.common.config.configcenter.AbstractDynamicConfiguration
-
- 所有已实现的接口:
AutoCloseable,DynamicConfiguration,Configuration
- 直接已知子类:
TreePathDynamicConfiguration
public abstract class AbstractDynamicConfiguration extends Object implements DynamicConfiguration
The abstract implementation ofDynamicConfiguration- 从以下版本开始:
- 2.7.5
-
-
字段概要
字段 修饰符和类型 字段 说明 static longDEFAULT_THREAD_POOL_KEEP_ALIVE_TIMEDefault keep alive time in milliseconds for threads inThreadPoolExecutoris 1 minute( 60 * 1000 ms)static StringDEFAULT_THREAD_POOL_PREFIXstatic intDEFAULT_THREAD_POOL_SIZEstatic StringGROUP_PARAM_NAMEThe parameter name of group for config-centerstatic StringPARAM_NAME_PREFIXstatic StringTHREAD_POOL_KEEP_ALIVE_TIME_PARAM_NAMEThe keep alive time in milliseconds for threads inThreadPoolExecutorstatic StringTHREAD_POOL_PREFIX_PARAM_NAMEstatic StringTHREAD_POOL_SIZE_PARAM_NAMEstatic StringTIMEOUT_PARAM_NAMEThe parameter name of timeout for config-center-
从接口继承的字段 org.apache.dubbo.common.config.configcenter.DynamicConfiguration
DEFAULT_GROUP
-
-
构造器概要
构造器 构造器 说明 AbstractDynamicConfiguration(String threadPoolPrefixName, int threadPoolSize, long keepAliveTime, String group, long timeout)AbstractDynamicConfiguration(URL url)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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.voidclose()Close the configurationStringgetConfig(String key, String group, long timeout)Get the configuration mapped to the given key and the given group.StringgetDefaultGroup()Get the default group for the operationslonggetDefaultTimeout()Get the default timeout for the operations in millisecondsObjectgetInternalProperty(String key)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, getConfig, getConfigKeys, getProperties, getProperties, publishConfig, publishConfig, removeListener
-
-
-
-
字段详细资料
-
THREAD_POOL_KEEP_ALIVE_TIME_PARAM_NAME
public static final String THREAD_POOL_KEEP_ALIVE_TIME_PARAM_NAME
The keep alive time in milliseconds for threads inThreadPoolExecutor- 另请参阅:
- 常量字段值
-
GROUP_PARAM_NAME
public static final String GROUP_PARAM_NAME
The parameter name of group for config-center- 从以下版本开始:
- 2.7.8
- 另请参阅:
- 常量字段值
-
TIMEOUT_PARAM_NAME
public static final String TIMEOUT_PARAM_NAME
The parameter name of timeout for config-center- 从以下版本开始:
- 2.7.8
- 另请参阅:
- 常量字段值
-
DEFAULT_THREAD_POOL_SIZE
public static final int DEFAULT_THREAD_POOL_SIZE
- 另请参阅:
- 常量字段值
-
DEFAULT_THREAD_POOL_KEEP_ALIVE_TIME
public static final long DEFAULT_THREAD_POOL_KEEP_ALIVE_TIME
Default keep alive time in milliseconds for threads inThreadPoolExecutoris 1 minute( 60 * 1000 ms)
-
-
方法详细资料
-
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 final 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
-
close
public final void close() throws Exception从接口复制的说明:DynamicConfigurationClose the configuration- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中DynamicConfiguration- 抛出:
Exception
-
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
-
getDefaultGroup
public String getDefaultGroup()
从接口复制的说明:DynamicConfigurationGet the default group for the operations- 指定者:
getDefaultGroup在接口中DynamicConfiguration- 返回:
- the default group
- 从以下版本开始:
- 2.7.8
-
getDefaultTimeout
public long getDefaultTimeout()
从接口复制的说明:DynamicConfigurationGet the default timeout for the operations in milliseconds- 指定者:
getDefaultTimeout在接口中DynamicConfiguration- 返回:
- the default timeout
- 从以下版本开始:
- 2.7.8
-
-