Package org.apache.dubbo.config.context
Class AbstractConfigManager
java.lang.Object
org.apache.dubbo.common.context.LifecycleAdapter
org.apache.dubbo.config.context.AbstractConfigManager
- All Implemented Interfaces:
Lifecycle,Disposable
- Direct Known Subclasses:
ConfigManager,ModuleConfigManager
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractConfigManager(ScopeModel scopeModel, Collection<Class<? extends AbstractConfig>> supportedConfigTypes) -
Method Summary
Modifier and TypeMethodDescriptionfinal <T extends AbstractConfig>
TaddConfig(AbstractConfig config) Add the dubboconfigvoidclear()voiddestroy()Destroy the component<T extends AbstractConfig>
Optional<T> Get config instance by id or by name<C extends AbstractConfig>
Collection<C> getConfigs(Class<C> configType) <C extends AbstractConfig>
Map<String, C> getConfigsMap(Class<C> cls) <C extends AbstractConfig>
List<C> getDefaultConfigs(Class<C> cls) voidInitialize the component beforestartbooleanabstract void<T extends AbstractConfig>
List<T> loadConfigsOfTypeFromProps(Class<T> cls) voidbooleanremoveConfig(AbstractConfig config) In some scenario, we may need to add and remove ServiceConfig or ReferenceConfig dynamically.Methods inherited from class org.apache.dubbo.common.context.LifecycleAdapter
start
-
Constructor Details
-
AbstractConfigManager
public AbstractConfigManager(ScopeModel scopeModel, Collection<Class<? extends AbstractConfig>> supportedConfigTypes)
-
-
Method Details
-
initialize
Description copied from interface:LifecycleInitialize the component beforestart- Specified by:
initializein interfaceLifecycle- Overrides:
initializein classLifecycleAdapter- Throws:
IllegalStateException
-
addConfig
Add the dubboconfig- Parameters:
config- the dubboconfig
-
getConfigsMap
-
getConfigs
-
getConfig
Get config instance by id or by name- Parameters:
cls- Config typeidOrName- the id or name of the config- Returns:
-
getDefaultConfigs
-
loadConfigs
public abstract void loadConfigs() -
loadConfigsOfTypeFromProps
-
refreshAll
public void refreshAll() -
removeConfig
In some scenario, we may need to add and remove ServiceConfig or ReferenceConfig dynamically.- Parameters:
config- the config instance to remove.- Returns:
-
destroy
Description copied from interface:LifecycleDestroy the component- Specified by:
destroyin interfaceDisposable- Specified by:
destroyin interfaceLifecycle- Overrides:
destroyin classLifecycleAdapter- Throws:
IllegalStateException
-
clear
public void clear() -
isInitialized
public boolean isInitialized()
-