类 ConfigurationUtils
- java.lang.Object
-
- org.apache.dubbo.common.config.ConfigurationUtils
-
public class ConfigurationUtils extends Object
Utilities for manipulating configurations from different sources
-
-
构造器概要
构造器 构造器 说明 ConfigurationUtils()
-
方法概要
-
-
-
方法详细资料
-
getSystemConfiguration
public static Configuration getSystemConfiguration(ScopeModel scopeModel)
Used to get properties from the jvm- 返回:
-
getEnvConfiguration
public static Configuration getEnvConfiguration(ScopeModel scopeModel)
Used to get properties from the os environment- 返回:
-
getGlobalConfiguration
public static Configuration getGlobalConfiguration(ScopeModel scopeModel)
Used to get an composite property value.Also see
Environment.getConfiguration()- 返回:
-
getDynamicGlobalConfiguration
public static Configuration getDynamicGlobalConfiguration(ScopeModel scopeModel)
-
getServerShutdownTimeout
public static int getServerShutdownTimeout(ScopeModel scopeModel)
Server shutdown wait timeout mills- 返回:
-
getCachedDynamicProperty
public static String getCachedDynamicProperty(ScopeModel realScopeModel, String key, String defaultValue)
-
getDynamicProperty
public static String getDynamicProperty(ScopeModel scopeModel, String property)
-
getDynamicProperty
public static String getDynamicProperty(ScopeModel scopeModel, String property, String defaultValue)
-
getProperty
public static String getProperty(ScopeModel scopeModel, String property)
-
getProperty
public static String getProperty(ScopeModel scopeModel, String property, String defaultValue)
-
get
public static int get(ScopeModel scopeModel, String property, int defaultValue)
-
parseProperties
public static Map<String,String> parseProperties(String content) throws IOException
- 抛出:
IOException
-
isEmptyValue
public static boolean isEmptyValue(Object value)
-
getSubProperties
public static <V> Map<String,V> getSubProperties(Collection<Map<String,V>> configMaps, String prefix)
Search props and extract sub properties.# properties dubbo.protocol.name=dubbo dubbo.protocol.port=1234 # extract protocol props Map props = getSubProperties("dubbo.protocol."); # result props: {"name": "dubbo", "port" : "1234"}- 类型参数:
V-- 参数:
configMaps-prefix-- 返回:
-
getSubProperties
public static <V> Map<String,V> getSubProperties(Map<String,V> configMap, String prefix)
-
hasSubProperties
public static <V> boolean hasSubProperties(Collection<Map<String,V>> configMaps, String prefix)
-
hasSubProperties
public static <V> boolean hasSubProperties(Map<String,V> configMap, String prefix)
-
getSubIds
public static <V> Set<String> getSubIds(Collection<Map<String,V>> configMaps, String prefix)
Search props and extract config ids# properties dubbo.registries.registry1.address=xxx dubbo.registries.registry2.port=xxx # extract ids Set configIds = getSubIds("dubbo.registries.") # result configIds: ["registry1", "registry2"]- 参数:
configMaps-prefix-- 返回:
-
getDynamicConfigurationFactory
public static DynamicConfigurationFactory getDynamicConfigurationFactory(ExtensionAccessor extensionAccessor, String name)
Get an instance ofDynamicConfigurationFactoryby the specified name. If not found, take the default extension ofDynamicConfigurationFactory- 参数:
name- the name of extension ofDynamicConfigurationFactory- 返回:
- non-null
-
getSystemConfiguration
@Deprecated public static Configuration getSystemConfiguration()
已过时。Replaced togetSystemConfiguration(ScopeModel)For compact single instance
-
getEnvConfiguration
@Deprecated public static Configuration getEnvConfiguration()
已过时。Replaced togetEnvConfiguration(ScopeModel)For compact single instance
-
getGlobalConfiguration
@Deprecated public static Configuration getGlobalConfiguration()
已过时。Replaced togetGlobalConfiguration(ScopeModel)For compact single instance
-
getDynamicGlobalConfiguration
@Deprecated public static Configuration getDynamicGlobalConfiguration()
已过时。Replaced togetDynamicGlobalConfiguration(ScopeModel)For compact single instance
-
getCachedDynamicProperty
@Deprecated public static String getCachedDynamicProperty(String key, String defaultValue)
已过时。For compact single instance
-
getDynamicProperty
@Deprecated public static String getDynamicProperty(String property)
已过时。Replaced togetDynamicProperty(ScopeModel, String)For compact single instance
-
getDynamicProperty
@Deprecated public static String getDynamicProperty(String property, String defaultValue)
已过时。Replaced togetDynamicProperty(ScopeModel, String, String)For compact single instance
-
getProperty
@Deprecated public static String getProperty(String property)
已过时。Replaced togetProperty(ScopeModel, String)For compact single instance
-
getProperty
@Deprecated public static String getProperty(String property, String defaultValue)
已过时。Replaced togetProperty(ScopeModel, String, String)For compact single instance
-
get
@Deprecated public static int get(String property, int defaultValue)
已过时。Replaced toget(ScopeModel, String, int)For compact single instance
-
-