Class SystemConfiguration

    • Field Detail

      • LOG

        private static final org.apache.commons.logging.Log LOG
        The logger.
    • Constructor Detail

      • SystemConfiguration

        public SystemConfiguration()
        Create a Configuration based on the system properties.
        See Also:
        System.getProperties()
    • Method Detail

      • setSystemProperties

        public static void setSystemProperties​(Configuration systemConfig)
        Sets System properties from a configuration object.
        Parameters:
        systemConfig - The configuration containing the properties to be set.
        Since:
        1.6
      • setSystemProperties

        public static void setSystemProperties​(java.lang.String fileName)
                                        throws ConfigurationException
        Sets system properties from a file specified by its file name. This is just a short cut for setSystemProperties(null, fileName).
        Parameters:
        fileName - The name of the property file.
        Throws:
        ConfigurationException - if an error occurs.
        Since:
        1.6
      • setSystemProperties

        public static void setSystemProperties​(java.lang.String basePath,
                                               java.lang.String fileName)
                                        throws ConfigurationException
        Sets system properties from a file specified using its base path and file name. The file can either be a properties file or an XML properties file. It is loaded, and all properties it contains are added to system properties.
        Parameters:
        basePath - The base path to look for the property file.
        fileName - The name of the property file.
        Throws:
        ConfigurationException - if an error occurs.
        Since:
        1.6
      • getKeysInternal

        protected java.util.Iterator<java.lang.String> getKeysInternal()
        Actually creates an iterator for iterating over the keys in this configuration. This method is called by getKeys(), it has to be defined by concrete subclasses. This implementation returns a snapshot of the keys in the system properties. If another thread modifies system properties concurrently, these changes are not reflected by the iterator returned by this method.
        Overrides:
        getKeysInternal in class MapConfiguration
        Returns:
        an Iterator with all property keys in this configuration