public final class ConfigurationUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
get(ScopeModel scopeModel,
String property,
int defaultValue) |
static int |
get(String property,
int defaultValue)
Deprecated.
Replaced to
get(ScopeModel, String, int) |
static String |
getCachedDynamicProperty(ScopeModel realScopeModel,
String key,
String defaultValue) |
static String |
getCachedDynamicProperty(String key,
String defaultValue)
Deprecated.
|
static DynamicConfigurationFactory |
getDynamicConfigurationFactory(ExtensionAccessor extensionAccessor,
String name)
Get an instance of
DynamicConfigurationFactory by the specified name. |
static Configuration |
getDynamicGlobalConfiguration()
Deprecated.
Replaced to
getDynamicGlobalConfiguration(ScopeModel) |
static Configuration |
getDynamicGlobalConfiguration(ScopeModel scopeModel) |
static String |
getDynamicProperty(ScopeModel scopeModel,
String property) |
static String |
getDynamicProperty(ScopeModel scopeModel,
String property,
String defaultValue) |
static String |
getDynamicProperty(String property)
Deprecated.
Replaced to
getDynamicProperty(ScopeModel, String) |
static String |
getDynamicProperty(String property,
String defaultValue)
Deprecated.
Replaced to
getDynamicProperty(ScopeModel, String, String) |
static Configuration |
getEnvConfiguration()
Deprecated.
Replaced to
getEnvConfiguration(ScopeModel) |
static Configuration |
getEnvConfiguration(ScopeModel scopeModel)
Used to get properties from the os environment
|
static Configuration |
getGlobalConfiguration()
Deprecated.
Replaced to
getGlobalConfiguration(ScopeModel) |
static Configuration |
getGlobalConfiguration(ScopeModel scopeModel)
Used to get a composite property value.
|
static String |
getProperty(ScopeModel scopeModel,
String property) |
static String |
getProperty(ScopeModel scopeModel,
String property,
String defaultValue) |
static String |
getProperty(String property)
Deprecated.
Replaced to
getProperty(ScopeModel, String) |
static String |
getProperty(String property,
String defaultValue)
Deprecated.
Replaced to
getProperty(ScopeModel, String, String) |
static int |
getServerShutdownTimeout(ScopeModel scopeModel)
Server shutdown wait timeout mills
|
static <V> Set<String> |
getSubIds(Collection<Map<String,V>> configMaps,
String prefix)
Search props and extract config ids
|
static <V> Map<String,V> |
getSubProperties(Collection<Map<String,V>> configMaps,
String prefix)
Search props and extract sub properties.
|
static <V> Map<String,V> |
getSubProperties(Map<String,V> configMap,
String prefix) |
static Configuration |
getSystemConfiguration()
Deprecated.
Replaced to
getSystemConfiguration(ScopeModel) |
static Configuration |
getSystemConfiguration(ScopeModel scopeModel)
Used to get properties from the jvm
|
static <V> boolean |
hasSubProperties(Collection<Map<String,V>> configMaps,
String prefix) |
static <V> boolean |
hasSubProperties(Map<String,V> configMap,
String prefix) |
static boolean |
isEmptyValue(Object value) |
static Map<String,String> |
parseProperties(String content) |
static int |
reCalShutdownTime(int expected) |
static void |
setExpectedShutdownTime(long expectedShutdownTime) |
public static Configuration getSystemConfiguration(ScopeModel scopeModel)
public static Configuration getEnvConfiguration(ScopeModel scopeModel)
public static Configuration getGlobalConfiguration(ScopeModel scopeModel)
Also see Environment.getConfiguration()
public static Configuration getDynamicGlobalConfiguration(ScopeModel scopeModel)
public static int getServerShutdownTimeout(ScopeModel scopeModel)
public static int reCalShutdownTime(int expected)
public static void setExpectedShutdownTime(long expectedShutdownTime)
public static String getCachedDynamicProperty(ScopeModel realScopeModel, String key, String defaultValue)
public static String getDynamicProperty(ScopeModel scopeModel, String property)
public static String getDynamicProperty(ScopeModel scopeModel, String property, String defaultValue)
public static String getProperty(ScopeModel scopeModel, String property)
public static String getProperty(ScopeModel scopeModel, String property, String defaultValue)
public static int get(ScopeModel scopeModel, String property, int defaultValue)
public static Map<String,String> parseProperties(String content) throws IOException
IOExceptionpublic static boolean isEmptyValue(Object value)
public static <V> Map<String,V> getSubProperties(Collection<Map<String,V>> configMaps, String prefix)
# 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 - public static <V> Map<String,V> getSubProperties(Map<String,V> configMap, String prefix)
public static <V> boolean hasSubProperties(Collection<Map<String,V>> configMaps, String prefix)
public static <V> Set<String> getSubIds(Collection<Map<String,V>> configMaps, String prefix)
# properties
dubbo.registries.registry1.address=xxx
dubbo.registries.registry2.port=xxx
# extract ids
Set configIds = getSubIds("dubbo.registries.")
# result
configIds: ["registry1", "registry2"]
configMaps - prefix - public static DynamicConfigurationFactory getDynamicConfigurationFactory(ExtensionAccessor extensionAccessor, String name)
DynamicConfigurationFactory by the specified name. If not found, take the default
extension of DynamicConfigurationFactoryname - the name of extension of DynamicConfigurationFactory2.7.4@Deprecated public static Configuration getSystemConfiguration()
getSystemConfiguration(ScopeModel)@Deprecated public static Configuration getEnvConfiguration()
getEnvConfiguration(ScopeModel)@Deprecated public static Configuration getGlobalConfiguration()
getGlobalConfiguration(ScopeModel)@Deprecated public static Configuration getDynamicGlobalConfiguration()
getDynamicGlobalConfiguration(ScopeModel)@Deprecated public static String getCachedDynamicProperty(String key, String defaultValue)
getCachedDynamicProperty(ScopeModel, String, String)@Deprecated public static String getDynamicProperty(String property)
getDynamicProperty(ScopeModel, String)@Deprecated public static String getDynamicProperty(String property, String defaultValue)
getDynamicProperty(ScopeModel, String, String)@Deprecated public static String getProperty(String property)
getProperty(ScopeModel, String)@Deprecated public static String getProperty(String property, String defaultValue)
getProperty(ScopeModel, String, String)@Deprecated public static int get(String property, int defaultValue)
get(ScopeModel, String, int)Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.