Class SystemPropertyProvider
java.lang.Object
de.aristaflow.adept2.base.configuration.PropertyProvider
de.aristaflow.adept2.base.configuration.ConfigurationPropertyProvider
de.aristaflow.adept2.base.configuration.SystemPropertyProvider
A
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):
- os.name
- arflow.logdir (default:
./logs, referring either to the current or user home directory, the one which can be written) - arflow.datadir (default:
./data, referring either to the current or user home directory, the one which can be read) - arflow.libdir (default:
./lib, referring either to the current or user home directory, the one which can be written) - arflow.useSunSecProvider (default:
false) - arflow.confurl
- arflow.confdir (applies only if arflow.confurl not set, optional default:
./conf, referring either to the current or user home directory, the one which can be read) - arflow.configuration.runtime.defaultdatasource (default:
false) - arflow.confdir.runtime (default: "rtConf/" below arflow.datadir)
- arflow.configuration.bundle (default:
false) - arflow.debug.configuration (default:
false) - arflow.logging.keephandler (default:
false) - arflow.confVar.*
-
Field Summary
Fields inherited from class de.aristaflow.adept2.base.configuration.PropertyProvider
DIRECTORY_PROPERTY_NAMES, logger -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a newSystemPropertyProviderand parses all corresponding system properties and/or sets the properties appropriately.SystemPropertyProvider(boolean useDefaultConfDir) Creates a newSystemPropertyProviderand parses all corresponding system properties and/or sets the properties appropriately.SystemPropertyProvider(boolean useDefaultConfDir, boolean defaultDsForRtConf) Creates a newSystemPropertyProviderand parses all corresponding system properties and/or sets the properties appropriately.SystemPropertyProvider(Map<String, String> overrides) Creates a newSystemPropertyProviderand parses the properties from the designated map.SystemPropertyProvider(Map<String, String> overrides, boolean useDefaultConfDir) Creates a newSystemPropertyProviderand parses the properties from the designated map.protectedSystemPropertyProvider(Map<String, String> properties, boolean useDefaultConfDir, boolean defaultDsForRtConf) Creates a newSystemPropertyProviderby delegating directly to the parent provider. -
Method Summary
Methods inherited from class de.aristaflow.adept2.base.configuration.ConfigurationPropertyProvider
getAfterConfDirs, getBeforeConfDirs, getBundleConfigSubdir, getConfDirs, getDebugConfig, getKeepLogHandler, getRuntimeConfDir, getUseDefDsForRtConf, initialiseProperties, injectDefaultConfDir, parseConfDirsMethods inherited from class de.aristaflow.adept2.base.configuration.PropertyProvider
getBaseForDefaultDirs, getSkipClosing, getSubstitutedVariables, getTotalMemPerthousandStreamThreshold, getUserHomeBaseDir, getUseSunSecurityProviders, resolveConfVar
-
Constructor Details
-
SystemPropertyProvider
Creates a newSystemPropertyProviderand parses all corresponding system properties and/or sets the properties appropriately. If no configuration directory or URL is specified,./conf(referring either to the current or user home directory, the one which can be read) will be used.- Throws:
ConfigurationException- If there are problems retrieving a required global property or a substituted variables from the system properties, aConfigurationExceptionwill be thrown.
-
SystemPropertyProvider
Creates a newSystemPropertyProviderand parses all corresponding system properties and/or sets the properties appropriately. If no configuration directory or URL is specified,./conf(referring either to the current or user home directory, the one which can be read) will be used or not depending on the designated flag.- Parameters:
useDefaultConfDir- Whether./confshould be used as default configuration directory in case no other configuration directory or URL is set.- Throws:
ConfigurationException- If the default configuration directory is to be used but cannot be accessed or there are problems retrieving a required global property or a substituted variables from the designated map, aConfigurationExceptionwill be thrown.
-
SystemPropertyProvider
public SystemPropertyProvider(boolean useDefaultConfDir, boolean defaultDsForRtConf) throws ConfigurationException Creates a newSystemPropertyProviderand parses all corresponding system properties and/or sets the properties appropriately. If no configuration directory or URL is specified,./conf(referring either to the current or user home directory, the one which can be read) will be used or not depending on the designated flag.- Parameters:
useDefaultConfDir- Whether./confshould 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.- Throws:
ConfigurationException- If the default configuration directory is to be used but cannot be accessed or there are problems retrieving a required global property or a substituted variables from the designated map, aConfigurationExceptionwill be thrown.
-
SystemPropertyProvider
Creates a newSystemPropertyProviderand 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.- Parameters:
overrides- The properties overriding the system properties.- Throws:
ConfigurationException- If there are problems retrieving a required global property or a substituted variables from the system properties or the designated map, aConfigurationExceptionwill be thrown.
-
SystemPropertyProvider
public SystemPropertyProvider(Map<String, String> overrides, boolean useDefaultConfDir) throws ConfigurationExceptionCreates a newSystemPropertyProviderand parses the properties from the designated map. If an entry does not exist in the designated map, the corresponding system property will apply.- Parameters:
overrides- The properties overriding the system properties.useDefaultConfDir- Whether./confshould be used as default configuration directory in case no other configuration directory or URL is set.- Throws:
ConfigurationException- If there are problems retrieving a required global property or a substituted variables from the system properties or the designated map, aConfigurationExceptionwill be thrown.
-
SystemPropertyProvider
protected SystemPropertyProvider(Map<String, String> properties, boolean useDefaultConfDir, boolean defaultDsForRtConf) throws ConfigurationExceptionCreates a newSystemPropertyProviderby delegating directly to the parent provider.- Parameters:
properties- A map providing all required global properties and values for substituted variables.useDefaultConfDir- Whether./confshould 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.- Throws:
ConfigurationException- If the default configuration directory is to be used but cannot be accessed or there are problems retrieving a required global property or a substituted variables from the designated map, aConfigurationExceptionwill be thrown.- See Also:
-
-
Method Details
-
merge
protected static Map<String,String> merge(Map<String, String> overrides, Map<String, String> properties) Merges the designated maps, whereas theoverridestake precedence over theproperties.- Parameters:
overrides- The map containing the properties to be used with high priority.properties- The map containing the properties to be used with low priority.- Returns:
- A map containing the properties of the designated maps according to their respective priority.
-