类 Environment
- java.lang.Object
-
- org.apache.dubbo.common.context.LifecycleAdapter
-
- org.apache.dubbo.common.config.Environment
-
- 所有已实现的接口:
FrameworkExt
,Lifecycle
public class Environment extends LifecycleAdapter implements FrameworkExt
-
-
构造器概要
构造器 构造器 说明 Environment()
-
方法概要
-
从类继承的方法 org.apache.dubbo.common.context.LifecycleAdapter
start
-
-
-
-
方法详细资料
-
initialize
public void initialize() throws IllegalStateException
从接口复制的说明:Lifecycle
Initialize the component beforestart
- 指定者:
initialize
在接口中Lifecycle
- 覆盖:
initialize
在类中LifecycleAdapter
- 抛出:
IllegalStateException
-
setLocalMigrationRule
@Deprecated public void setLocalMigrationRule(String localMigrationRule)
已过时。
-
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 method helps us to 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- 返回:
-
getDynamicGlobalConfiguration
public Configuration getDynamicGlobalConfiguration()
-
getDynamicConfiguration
public Optional<DynamicConfiguration> getDynamicConfiguration()
-
setDynamicConfiguration
@DisableInject public void setDynamicConfiguration(DynamicConfiguration dynamicConfiguration)
-
destroy
public void destroy() throws IllegalStateException
从接口复制的说明:Lifecycle
Destroy the component- 指定者:
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()
-
-