类 ConfigUtils
- java.lang.Object
-
- org.apache.dubbo.common.utils.ConfigUtils
-
public class ConfigUtils extends Object
-
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidaddProperties(Properties properties)This method should be called before Dubbo starting.static intgetPid()static PropertiesgetProperties()Get dubbo properties.static StringgetProperty(String key)static StringgetProperty(String key, String defaultValue)static StringgetProperty(Properties properties, String key, String defaultValue)static StringgetSystemProperty(String key)System environment -> System propertiesstatic booleanisDefault(String value)static booleanisEmpty(String value)static booleanisNotEmpty(String value)static StringloadMigrationRule(String fileName)static PropertiesloadProperties(String fileName)static PropertiesloadProperties(String fileName, boolean allowMultiFile)static PropertiesloadProperties(String fileName, boolean allowMultiFile, boolean optional)Load properties file toPropertiesfrom class path.static List<String>mergeValues(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)static voidsetProperties(Properties properties)This method should be called before Dubbo starting.
-
-
-
方法详细资料
-
isNotEmpty
public static boolean isNotEmpty(String value)
-
isEmpty
public static boolean isEmpty(String value)
-
isDefault
public static boolean isDefault(String value)
-
mergeValues
public static List<String> mergeValues(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.
- 参数:
type- Extension typecfg- Extension name listdef- Default extension list- 返回:
- result extension list
- Special value
-
replaceProperty
public static String replaceProperty(String expression, Map<String,String> params)
-
replaceProperty
public static String replaceProperty(String expression, Configuration configuration)
-
getProperties
public static Properties getProperties()
Get dubbo properties. It is not recommended to use this method to modify dubbo properties.- 返回:
-
setProperties
public static void setProperties(Properties properties)
This method should be called before Dubbo starting. It is not recommended to use this method to modify dubbo properties.
-
addProperties
public static void addProperties(Properties properties)
This method should be called before Dubbo starting. It is not recommended to use this method to modify dubbo properties.
-
getProperty
public static String getProperty(Properties properties, String key, String defaultValue)
-
getSystemProperty
public static String getSystemProperty(String key)
System environment -> System properties- 参数:
key- key- 返回:
- value
-
loadProperties
public static Properties loadProperties(String fileName)
-
loadProperties
public static Properties loadProperties(String fileName, boolean allowMultiFile)
-
loadProperties
public static Properties loadProperties(String fileName, boolean allowMultiFile, boolean optional)
Load properties file toPropertiesfrom class path.- 参数:
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- 返回:
- loaded
Propertiescontent.- return empty Properties if no file found.
- merge multi properties file if found multi file
- 抛出:
IllegalStateException- not allow multi-file, but multi-file exist on class path.
-
getPid
public static int getPid()
-
-