public class ALDEnvironmentConfig extends Object
This class serves as helper class for reading and writing environment variables and Java environment properties, respectively.
Every Alida operator and also every other class can define properties.
To ensure a certain structure of the properties and avoid chaos in property
names the properties defined should respect the following convention:
alida.operatorname.property
The corresponding environment variable will then be
ALIDA_OPERATORNAME_PROPERTY
following common Unix/Linux conventions.
Constructor and Description |
---|
ALDEnvironmentConfig() |
Modifier and Type | Method and Description |
---|---|
static String |
getConfigValue(String _operator,
String _propname)
Reads the value of the specified property from the environment.
|
static String |
getConfigValue(String _prefix,
String _operator,
String _propname)
Gets the value of a property from the environment.
|
static String |
getEnvVarValue(String _operator,
String _propname)
Reads the value of the specified property from environment variables.
|
static String |
getJVMPropValue(String _operator,
String _propname)
Reads the value of specified property from JVM properties.
|
static String |
getJVMPropValue(String _prefix,
String _operator,
String _propname)
Reads the value of the specified property from JVM properties.
|
public static String getConfigValue(String _prefix, String _operator, String _propname)
Environment properties can be defined in terms of environment variables, or java properties passed to the virtual machine. The options are checked in exactly this order. If the requested property is not found in either of the two configuration environments, null is returned.
The actual name of the property for which the environment is queried is assembled from the specified prefix, the given operator name and the environment variable name (in this order). For checking environment variables all strings are converted to upper-case and linked together by inserting '_' in between. For checking JVM properties, dots are inserted in between and all strings are converted to lower-case.
_prefix
- Prefix._operator
- Name of the operator._propname
- Name of the property.null
if not existing.public static String getConfigValue(String _operator, String _propname)
Here the default prefix "alida" is assumed. It is combined with the provided operator and environment variable names in this order.
_operator
- Name of the operator._propname
- Name of the property.null
if not existing.public static String getEnvVarValue(String _operator, String _propname)
Default prefix is "alida".
_operator
- Name of operator, ignored if null._propname
- Name of the property.null
if not existing.public static String getJVMPropValue(String _prefix, String _operator, String _propname)
_prefix
- Prefix, ignored if null._operator
- Name of operator, ignored if null._propname
- Name of the property.null
if not existing.public static String getJVMPropValue(String _operator, String _propname)
Default prefix is "alida".
_operator
- Name of operator, ignored if null._propname
- Name of the property.null
if not existing.Copyright © 2010–2021 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.