public class ZKConfigClientImpl extends Object implements RemoteConfigReadClient, RemoteConfigPublishWatch
Constructor and Description |
---|
ZKConfigClientImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
exists(String key)
验证配置项是否存在
|
ConfigValue |
get(String key)
配置项获取
|
Map<String,ConfigValue> |
getAll()
获取指定环境配置项合集
|
EnvironmentManager |
getEnvironmentManager() |
void |
registerClientWatchPublish(String clientId)
应用启动,向配置中心发起监控注册
|
void |
retrieveRemoteConfig(Map<String,String> m)
重新获取远程配置
|
void |
setConfigPath(ConfigPath configPath) |
void |
setEnvironmentManager(EnvironmentManager environmentManager) |
void |
setNewEnvAble(boolean newEnvAble) |
void |
start()
客户端初始化
|
void |
stop()
客户端停止
|
protected static final Logger LOGGER
public EnvironmentManager getEnvironmentManager()
public void setEnvironmentManager(EnvironmentManager environmentManager)
public boolean exists(String key) throws BaseRuntimeException
ConfigItemReader
exists
in interface ConfigItemReader
key
- 配置中心,配置项变量名BaseRuntimeException
public ConfigValue get(String key) throws BaseRuntimeException
ConfigItemReader
get
in interface ConfigItemReader
key
- 配置中心,配置项变量名BaseRuntimeException
public Map<String,ConfigValue> getAll() throws BaseRuntimeException
ConfigItemReader
getAll
in interface ConfigItemReader
BaseRuntimeException
public void start()
RemoteConfigReadClient
start
in interface RemoteConfigReadClient
public void stop()
RemoteConfigReadClient
stop
in interface RemoteConfigReadClient
public void retrieveRemoteConfig(Map<String,String> m)
retrieveRemoteConfig
in interface ConfigItemReader
m
- public void registerClientWatchPublish(String clientId)
RemoteConfigPublishWatch
registerClientWatchPublish
in interface RemoteConfigPublishWatch
clientId
- 客户端IDpublic void setConfigPath(ConfigPath configPath)
public void setNewEnvAble(boolean newEnvAble)
Copyright © 2006–2018 TinyGroup. All rights reserved.