Package org.apache.dubbo.common.utils
Class ConfigUtils
java.lang.Object
org.apache.dubbo.common.utils.ConfigUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic intgetPid()static PropertiesgetProperties(Set<ClassLoader> classLoaders) Get dubbo properties.static StringgetSystemProperty(String key) System environment -> System propertiesstatic booleanstatic booleanstatic booleanisNotEmpty(String value) static StringloadMigrationRule(Set<ClassLoader> classLoaders, String fileName) static PropertiesloadProperties(Set<ClassLoader> classLoaders, String fileName) static PropertiesloadProperties(Set<ClassLoader> classLoaders, String fileName, boolean allowMultiFile) static PropertiesloadProperties(Set<ClassLoader> classLoaders, String fileName, boolean allowMultiFile, boolean optional) Load properties file toPropertiesfrom class path.mergeValues(ExtensionDirector extensionDirector, Class<?> type, String cfg, List<String> def) Insert default extension into extension list.static StringreplaceProperty(String expression, Map<String, String> params) static StringreplaceProperty(String expression, Configuration configuration)
-
Method Details
-
isNotEmpty
-
isEmpty
-
isDefault
-
mergeValues
public static List<String> mergeValues(ExtensionDirector extensionDirector, Class<?> type, String cfg, List<String> def) Insert default extension into extension list.Extension list support
- Special value
default, means the location for default extensions. - Special symbol
-, means remove.-foo1will remove default extension 'foo';-defaultwill remove all default extensions.
- Parameters:
type- Extension typecfg- Extension name listdef- Default extension list- Returns:
- result extension list
- Special value
-
replaceProperty
-
replaceProperty
-
getProperties
Get dubbo properties. It is not recommended using this method to modify dubbo properties.- Returns:
-
getSystemProperty
System environment -> System properties- Parameters:
key- key- Returns:
- value
-
loadProperties
-
loadProperties
public static Properties loadProperties(Set<ClassLoader> classLoaders, String fileName, boolean allowMultiFile) -
loadProperties
public static Properties loadProperties(Set<ClassLoader> classLoaders, String fileName, boolean allowMultiFile, boolean optional) Load properties file toPropertiesfrom class path.- Parameters:
fileName- properties file name. for example:dubbo.properties,METE-INF/conf/foo.propertiesallowMultiFile- iffalse, throwIllegalStateExceptionwhen found multi file on the class path.optional- is optional. iffalse, log warn when properties config file not found!s- Returns:
- loaded
Propertiescontent.- return empty Properties if no file found.
- merge multi properties file if found multi file
- Throws:
IllegalStateException- not allow multi-file, but multi-file exist on class path.
-
loadMigrationRule
-
getPid
public static int getPid()
-