|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.helpers.ALDEnvironmentConfig
public class ALDEnvironmentConfig
Helper class to access environment variables and properties.
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 Summary | |
---|---|
ALDEnvironmentConfig()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ALDEnvironmentConfig()
Method Detail |
---|
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |