public abstract class AbstractDynamicConfiguration extends Object implements DynamicConfiguration
DynamicConfiguration| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_THREAD_POOL_KEEP_ALIVE_TIME
Default keep alive time in milliseconds for threads in
ThreadPoolExecutor is 1 minute( 60 * 1000 ms) |
static String |
DEFAULT_THREAD_POOL_PREFIX |
static int |
DEFAULT_THREAD_POOL_SIZE |
static String |
GROUP_PARAM_NAME
The parameter name of group for config-center
|
static String |
PARAM_NAME_PREFIX |
static String |
THREAD_POOL_KEEP_ALIVE_TIME_PARAM_NAME
The keep alive time in milliseconds for threads in
ThreadPoolExecutor |
static String |
THREAD_POOL_PREFIX_PARAM_NAME |
static String |
THREAD_POOL_SIZE_PARAM_NAME |
static String |
TIMEOUT_PARAM_NAME
The parameter name of timeout for config-center
|
DEFAULT_GROUPinterfaceLevelLogger| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
close()
Close the configuration
|
String |
getConfig(String key,
String group,
long timeout)
Get the configuration mapped to the given key and the given group.
|
String |
getDefaultGroup()
Get the default group for the operations
|
long |
getDefaultTimeout()
Get the default timeout for the operations in milliseconds
|
Object |
getInternalProperty(String key) |
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.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListener, getConfig, getConfigItem, getProperties, getProperties, getRuleKey, publishConfig, publishConfig, publishConfigCas, removeListenercontainsKey, convert, getBoolean, getBoolean, getBoolean, getInt, getInt, getInteger, getProperty, getProperty, getString, getString, toBooleanObjectpublic static final String PARAM_NAME_PREFIX
public static final String THREAD_POOL_PREFIX_PARAM_NAME
public static final String DEFAULT_THREAD_POOL_PREFIX
public static final String THREAD_POOL_SIZE_PARAM_NAME
public static final String THREAD_POOL_KEEP_ALIVE_TIME_PARAM_NAME
ThreadPoolExecutorpublic static final String GROUP_PARAM_NAME
public static final String TIMEOUT_PARAM_NAME
public static final int DEFAULT_THREAD_POOL_SIZE
public static final long DEFAULT_THREAD_POOL_KEEP_ALIVE_TIME
ThreadPoolExecutor is 1 minute( 60 * 1000 ms)public void addListener(String key, String group, ConfigurationListener listener)
DynamicConfigurationaddListener in interface 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 in interface DynamicConfigurationkey - the key to represent a configurationgroup - the group where the key belongs tolistener - configuration listenerpublic final String getConfig(String key, String group, long timeout) throws IllegalStateException
DynamicConfigurationgetConfig in interface 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 in interface Configurationpublic final void close()
throws Exception
DynamicConfigurationclose in interface AutoCloseableclose in interface DynamicConfigurationExceptionpublic boolean removeConfig(String key, String group)
removeConfig in interface DynamicConfigurationkey - the key to represent a configurationgroup - the group where the key belongs totrue if success, or falsepublic String getDefaultGroup()
DynamicConfigurationgetDefaultGroup in interface DynamicConfigurationpublic long getDefaultTimeout()
DynamicConfigurationgetDefaultTimeout in interface DynamicConfigurationCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.