Nova Ordis Utilities Environment Variable Support: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * novaordis-utilities =Overview=")
 
No edit summary
Line 4: Line 4:


=Overview=
=Overview=
We install a static EnvironmentVariableProvider per class loading domain (JVM), to allow for environment-independent testing.
=Usage Pattern=
<pre>
...
EnvironmentVariableProvider p = EnvironmentVariableProvider.getInstance();
...
<pre>
    * @return the default EnvironmentVariableProvider for this JVM. If "env.variable.provider.class.name" (the exact
    * string is defined by ENVIRONMENT_VARIABLE_PROVIDER_CLASS_NAME_SYSTEM_PROPERTY) is defined and points to a fully
    * qualified class name that implements EnvironmentVariableProvider, it will be instantiated, cached and used.
    * If the system property is not defined, SystemEnvironmentVariableProvider will be used.
    *
    * @exception IllegalStateException if failure to instantiate the custom class is encountered.

Revision as of 16:59, 20 December 2016

Internal

Overview

We install a static EnvironmentVariableProvider per class loading domain (JVM), to allow for environment-independent testing.

Usage Pattern

...
EnvironmentVariableProvider p = EnvironmentVariableProvider.getInstance();
...


     * @return the default EnvironmentVariableProvider for this JVM. If "env.variable.provider.class.name" (the exact
     * string is defined by ENVIRONMENT_VARIABLE_PROVIDER_CLASS_NAME_SYSTEM_PROPERTY) is defined and points to a fully
     * qualified class name that implements EnvironmentVariableProvider, it will be instantiated, cached and used.
     * If the system property is not defined, SystemEnvironmentVariableProvider will be used.
     *
     * @exception IllegalStateException if failure to instantiate the custom class is encountered.