类 Environment
- java.lang.Object
-
- org.apache.dubbo.common.context.LifecycleAdapter
-
- org.apache.dubbo.common.config.Environment
-
- 所有已实现的接口:
ApplicationExt,Lifecycle,Disposable
- 直接已知子类:
ModuleEnvironment
public class Environment extends LifecycleAdapter implements ApplicationExt
-
-
构造器概要
构造器 构造器 说明 Environment(ScopeModel scopeModel)
-
方法概要
-
从类继承的方法 org.apache.dubbo.common.context.LifecycleAdapter
start
-
-
-
-
构造器详细资料
-
Environment
public Environment(ScopeModel scopeModel)
-
-
方法详细资料
-
initialize
public void initialize() throws IllegalStateException从接口复制的说明:LifecycleInitialize the component beforestart- 指定者:
initialize在接口中Lifecycle- 覆盖:
initialize在类中LifecycleAdapter- 抛出:
IllegalStateException
-
setLocalMigrationRule
@Deprecated public void setLocalMigrationRule(String localMigrationRule)
已过时。only for ut
-
setExternalConfigMap
@DisableInject public void setExternalConfigMap(Map<String,String> externalConfiguration)
-
setAppExternalConfigMap
@DisableInject public void setAppExternalConfigMap(Map<String,String> appExternalConfiguration)
-
setAppConfigMap
@DisableInject public void setAppConfigMap(Map<String,String> appConfiguration)
-
updateAppConfigMap
public void updateAppConfigMap(Map<String,String> map)
Merge target map properties into app configuration- 参数:
map-
-
getPrefixedConfiguration
public Configuration getPrefixedConfiguration(AbstractConfig config, String prefix)
At start-up, Dubbo is driven by various configuration, such as Application, Registry, Protocol, etc. All configurations will be converged into a data bus - URL, and then drive the subsequent process.At present, there are many configuration sources, including AbstractConfig (API, XML, annotation), - D, config center, etc. This methood helps us t filter out the most priority values from various configuration sources.
- 参数:
config-prefix-- 返回:
-
getConfiguration
public CompositeConfiguration getConfiguration()
There are two ways to get configuration during exposure / reference or at runtime: 1. URL, The value in the URL is relatively fixed. we can get value directly. 2. The configuration exposed in this method is convenient for us to query the latest values from multiple prioritized sources, it also guarantees that configs changed dynamically can take effect on the fly.
-
getConfigurationMaps
public List<Map<String,String>> getConfigurationMaps(AbstractConfig config, String prefix)
Get configuration map list for target instance- 参数:
config-prefix-- 返回:
-
getConfigurationMaps
public List<Map<String,String>> getConfigurationMaps()
Get global configuration as map list- 返回:
-
destroy
public void destroy() throws IllegalStateException从接口复制的说明:LifecycleDestroy the component- 指定者:
destroy在接口中Disposable- 指定者:
destroy在接口中Lifecycle- 覆盖:
destroy在类中LifecycleAdapter- 抛出:
IllegalStateException
-
reset
public void reset()
Reset environment. For test only.
-
getPropertiesConfiguration
public PropertiesConfiguration getPropertiesConfiguration()
-
getSystemConfiguration
public SystemConfiguration getSystemConfiguration()
-
getEnvironmentConfiguration
public EnvironmentConfiguration getEnvironmentConfiguration()
-
getExternalConfiguration
public InmemoryConfiguration getExternalConfiguration()
-
getAppExternalConfiguration
public InmemoryConfiguration getAppExternalConfiguration()
-
getAppConfiguration
public InmemoryConfiguration getAppConfiguration()
-
getLocalMigrationRule
public String getLocalMigrationRule()
-
refreshClassLoaders
public void refreshClassLoaders()
-
getDynamicGlobalConfiguration
public Configuration getDynamicGlobalConfiguration()
-
getDynamicConfiguration
public Optional<DynamicConfiguration> getDynamicConfiguration()
-
setDynamicConfiguration
@DisableInject public void setDynamicConfiguration(DynamicConfiguration defaultDynamicConfiguration)
-
-