Handles a single configuration line.
This routine tokenizes the configuration line and then handles it by means of #ConfigurationTokensHandler objects. The handler to be used is determined by the first token extracted by the configuration line. Throws std::runtime_error if the correct handler to be used is not found or if there is any error in processing the tokens. Some commands are handled directly by this routine:
Define <aliasName>
- Defines an alias for a given value Include <fileName> - Includes another configuration file Plugin <fileName> - Loads the specified plugin MaxMemory
<units> - Defines the maximum usable memory (approx.) MemLevels
- Defines the memory levels as percentages of MaxMemory
Aliases defined with Define can be expanded in other commands by means of the $ heading character followed by the alias name. It is not allowed to define aliases for command names.
Included files will be parsed at the moment the Include directive is encountered. All the previous Define will be valid when parsing the included file; likewise, all the Define in the included file will still be valid when resuming the parse of the original file.
The maximum usable memory is a hint for the garbage collector for limiting the used memory below the given threshold; units can be KB, MB or GB. This is not a hard limit, and it might be impossible to effectively keep the memory usage always below this limit. The memory levels are defined as percentages of the maximum usable memory that defines a memory status; the three values must be in strictly increasing order and included between 0 and 100. For example, using 70, 80 and 95 will mean that a memory usage less than 70% of max memory will give a NORMAL memory status, a usage between 70% and 80% will give a WARNING status, between 80% and 95% a CRITICAL status and over 95% an EXHAUSTED status; the worse the memory status, the more pressing the request from the garbage collector to the object producers to free the unused memory. Setting lower levels will result in worse status codes: while this can help in maintaining a low memory usage it can also impact performance since it might trigger an unneeded free of buffer memory.
- Parameters
-
line | The configuration line to process. |
Implements EA::ConfigLineHandler.