public abstract class SystemPropertiesSupport extends Object
SystemPropertiesSupport.HOSTED_PROPERTIES
. Other important system properties need to be computed at run time.
However, we want to do the computation lazily to reduce the startup cost. For example, getting
the current working directory is quite expensive. We initialize such a property either when it is
explicitly accessed, or when all properties are accessed.Modifier | Constructor and Description |
---|---|
protected |
SystemPropertiesSupport() |
Modifier and Type | Method and Description |
---|---|
String |
clearProperty(String key) |
Properties |
getProperties() |
protected String |
getProperty(String key) |
Map<String,String> |
getSavedProperties() |
void |
initializeProperty(String key,
String value)
Initializes a property at startup from external input (e.g., command line arguments).
|
protected abstract String |
osVersionValue() |
void |
setProperties(Properties props) |
String |
setProperty(String key,
String value) |
protected abstract String |
tmpdirValue() |
String |
userDir() |
protected abstract String |
userDirValue() |
String |
userHome() |
protected abstract String |
userHomeValue() |
String |
userName() |
protected abstract String |
userNameValue() |
public Properties getProperties()
public void setProperties(Properties props)
public void initializeProperty(String key, String value)
public String userName()
public String userHome()
public String userDir()
protected abstract String userNameValue()
protected abstract String userHomeValue()
protected abstract String userDirValue()
protected abstract String tmpdirValue()
protected abstract String osVersionValue()