public class SystemPropertyProvider extends ConfigurationPropertyProvider
SystemPropertyProvider provides the means to retrieve global
properties and the variables to be substituted directly from
system properties of the JVM. This is
useful for stand-alone applications, that are applications running as a
single application in a JVM as opposite to applications running in an
execution context like an application server.
This class parses the following property from the system environment (in parentheses the default value that will apply if the property is not set):
./logs)./examples)./lib)false)./conf)false)false)false)false)logger| Modifier | Constructor and Description |
|---|---|
|
SystemPropertyProvider()
Creates a new
SystemPropertyProvider and parses all
corresponding system properties and/or sets the properties appropriately. |
|
SystemPropertyProvider(boolean useDefaultConfDir)
Creates a new
SystemPropertyProvider and parses all
corresponding system properties and/or sets the properties appropriately. |
|
SystemPropertyProvider(boolean useDefaultConfDir,
boolean defaultDsForRtConf)
Creates a new
SystemPropertyProvider and parses all
corresponding system properties and/or sets the properties appropriately. |
|
SystemPropertyProvider(java.util.Map<java.lang.String,java.lang.String> overrides)
Creates a new
SystemPropertyProvider and parses the properties
from the designated map. |
protected |
SystemPropertyProvider(java.util.Map<java.lang.String,java.lang.String> properties,
boolean useDefaultConfDir,
boolean defaultDsForRtConf)
Creates a new
SystemPropertyProvider by delegating directly to
the parent provider. |
| Modifier and Type | Method and Description |
|---|---|
protected static java.util.Map<java.lang.String,java.lang.String> |
merge(java.util.Map<java.lang.String,java.lang.String> overrides,
java.util.Map<java.lang.String,java.lang.String> properties)
Merges the designated maps, whereas the
overrides take
precedence over the properties. |
getAfterConfDirs, getBeforeConfDirs, getBundleConfigSubdir, getConfDirs, getDebugConfig, getKeepLogHandler, getRuntimeConfDir, getUseDefDsForRtConf, initialiseProperties, injectDefaultConfDir, parseConfDirsgetSubstitutedVariables, getUseSunSecurityProviderspublic SystemPropertyProvider()
throws ConfigurationException
SystemPropertyProvider and parses all
corresponding system properties and/or sets the properties appropriately.
If no configuration directory or URL is specified, ./conf will
be used.ConfigurationException - If there are problems retrieving a required
global property or a substituted variables from the system
properties, a ConfigurationException will be thrown.public SystemPropertyProvider(boolean useDefaultConfDir)
throws ConfigurationException
SystemPropertyProvider and parses all
corresponding system properties and/or sets the properties appropriately.
If no configuration directory or URL is specified, ./conf will
be used or not depending on the designated flag.useDefaultConfDir - Whether ./conf should be used as
default configuration directory in case no other configuration
directory or URL is set.ConfigurationException - If there are problems retrieving a required
global property or a substituted variables from the system
properties, a ConfigurationException will be thrown.public SystemPropertyProvider(boolean useDefaultConfDir,
boolean defaultDsForRtConf)
throws ConfigurationException
SystemPropertyProvider and parses all
corresponding system properties and/or sets the properties appropriately.
If no configuration directory or URL is specified, ./conf will
be used or not depending on the designated flag.useDefaultConfDir - Whether ./conf should be used as
default configuration directory in case no other configuration
directory or URL is set.defaultDsForRtConf - The default value for whether to use the default data source for
runtime configurations. This will overridden if present in the designated properties.ConfigurationException - If there are problems retrieving a required
global property or a substituted variables from the system
properties, a ConfigurationException will be thrown.public SystemPropertyProvider(java.util.Map<java.lang.String,java.lang.String> overrides)
throws ConfigurationException
SystemPropertyProvider and parses the properties
from the designated map. If an entry does not exist in the designated map,
the corresponding system property will apply. No default configuration
directory or URL will be used.overrides - The properties overriding the system properties.ConfigurationException - If there are problems retrieving a required
global property or a substituted variables from the system
properties or the designated map, a
ConfigurationException will be thrown.protected SystemPropertyProvider(java.util.Map<java.lang.String,java.lang.String> properties,
boolean useDefaultConfDir,
boolean defaultDsForRtConf)
throws ConfigurationException
SystemPropertyProvider by delegating directly to
the parent provider.properties - A map providing all required global properties and values
for substituted variables.useDefaultConfDir - Whether ./conf should be used as
default configuration directory in case no other configuration
directory or URL is set.defaultDsForRtConf - The default value for whether to use the default data source for
runtime configurations. This will overridden if present in the designated properties.ConfigurationException - If there are problems retrieving a required
global property or a substituted variables from the designated
map, a ConfigurationException will be thrown.ConfigurationPropertyProvider#ConfigurationPropertyProvider(Map, boolean)protected static java.util.Map<java.lang.String,java.lang.String> merge(java.util.Map<java.lang.String,java.lang.String> overrides,
java.util.Map<java.lang.String,java.lang.String> properties)
overrides take
precedence over the properties.overrides - The map containing the properties to be used with high
priority.properties - The map containing the properties to be used with low
priority.