Class SystemPropertyProvider


  • public class SystemPropertyProvider
    extends ConfigurationPropertyProvider
    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)
    • arflow.datadir (default: ./examples)
    • arflow.libdir (default: ./lib)
    • arflow.useSunSecProvider (default: false)
    • arflow.confurl
    • arflow.confdir (applies only if arflow.confurl not set, optional default ./conf)
    • 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.*
    • Constructor Detail

      • SystemPropertyProvider

        public SystemPropertyProvider()
                               throws ConfigurationException
        Creates a new 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.
        Throws:
        ConfigurationException - If there are problems retrieving a required global property or a substituted variables from the system properties, a ConfigurationException will be thrown.
      • SystemPropertyProvider

        public SystemPropertyProvider​(boolean useDefaultConfDir)
                               throws ConfigurationException
        Creates a new 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.
        Parameters:
        useDefaultConfDir - Whether ./conf should 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, a ConfigurationException will be thrown.
      • SystemPropertyProvider

        public SystemPropertyProvider​(boolean useDefaultConfDir,
                                      boolean defaultDsForRtConf)
                               throws ConfigurationException
        Creates a new 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.
        Parameters:
        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.
        Throws:
        ConfigurationException - If there are problems retrieving a required global property or a substituted variables from the system properties, a ConfigurationException will be thrown.
      • SystemPropertyProvider

        public SystemPropertyProvider​(Map<String,​String> overrides)
                               throws ConfigurationException
        Creates a new 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.
        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, a ConfigurationException will be thrown.
      • SystemPropertyProvider

        protected SystemPropertyProvider​(Map<String,​String> properties,
                                         boolean useDefaultConfDir,
                                         boolean defaultDsForRtConf)
                                  throws ConfigurationException
        Creates a new SystemPropertyProvider by delegating directly to the parent provider.
        Parameters:
        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.
        Throws:
        ConfigurationException - If there are problems retrieving a required global property or a substituted variables from the designated map, a ConfigurationException will be thrown.
        See Also:
        ConfigurationPropertyProvider(Map, boolean, boolean)
    • Method Detail

      • merge

        protected static Map<String,​String> merge​(Map<String,​String> overrides,
                                                        Map<String,​String> properties)
        Merges the designated maps, whereas the overrides take precedence over the properties.
        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.