public class ConfigUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
getPid() |
static Properties |
getProperties(Set<ClassLoader> classLoaders)
Get dubbo properties.
|
static String |
getSystemProperty(String key)
System environment -> System properties
|
static boolean |
isDefault(String value) |
static boolean |
isEmpty(String value) |
static boolean |
isNotEmpty(String value) |
static String |
loadMigrationRule(Set<ClassLoader> classLoaders,
String fileName) |
static Properties |
loadProperties(Set<ClassLoader> classLoaders,
String fileName) |
static Properties |
loadProperties(Set<ClassLoader> classLoaders,
String fileName,
boolean allowMultiFile) |
static Properties |
loadProperties(Set<ClassLoader> classLoaders,
String fileName,
boolean allowMultiFile,
boolean optional)
Load properties file to
Properties from class path. |
static List<String> |
mergeValues(ExtensionDirector extensionDirector,
Class<?> type,
String cfg,
List<String> def)
Insert default extension into extension list.
|
static String |
replaceProperty(String expression,
Configuration configuration) |
static String |
replaceProperty(String expression,
Map<String,String> params) |
public static boolean isNotEmpty(String value)
public static boolean isEmpty(String value)
public static boolean isDefault(String value)
public static List<String> mergeValues(ExtensionDirector extensionDirector, Class<?> type, String cfg, List<String> def)
Extension list support
default, means the location for default extensions.
-, means remove. -foo1 will remove default extension 'foo'; -default will remove all default extensions.
type - Extension typecfg - Extension name listdef - Default extension listpublic static String replaceProperty(String expression, Configuration configuration)
public static Properties getProperties(Set<ClassLoader> classLoaders)
public static String getSystemProperty(String key)
key - keypublic static Properties loadProperties(Set<ClassLoader> classLoaders, String fileName)
public static Properties loadProperties(Set<ClassLoader> classLoaders, String fileName, boolean allowMultiFile)
public static Properties loadProperties(Set<ClassLoader> classLoaders, String fileName, boolean allowMultiFile, boolean optional)
Properties from class path.fileName - properties file name. for example: dubbo.properties, METE-INF/conf/foo.propertiesallowMultiFile - if false, throw IllegalStateException when found multi file on the class path.optional - is optional. if false, log warn when properties config file not found!sProperties content. IllegalStateException - not allow multi-file, but multi-file exist on class path.public static String loadMigrationRule(Set<ClassLoader> classLoaders, String fileName)
public static int getPid()
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.