ca.mcgill.cs.postina.util.properties
Class PropertyManager

java.lang.Object
  extended by ca.mcgill.cs.postina.util.properties.PropertyManager

public class PropertyManager
extends java.lang.Object

The PropertyManager allows to read a properties defined in the property files. It reads two property files: a global file postina.properties and a local, machine-specific one. The machine-specific property file's name must be of form postina..properties where is the fully qualified hostname in lowercases of the machine for which these properties should be applied. Example: postina.rogue.cs.mcgill.ca.properties

Version:
9-Jan-08
Author:
Dominik Zindel

Field Summary
private static java.util.Properties generalProperties
          The field generalProperties contains the properties defined in the global property file.
private static java.util.Properties localProperties
          The field localProperties contains the properties defined in the local, machine-specific property file.
private static org.apache.log4j.Logger logger
           
 
Constructor Summary
PropertyManager()
           
 
Method Summary
static java.lang.String getProperty(java.lang.String key)
          This method allows to get a property by its string name.
private static void readPropertyFiles()
          This method reads in both property files and thus does the main work of the PropertyManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

generalProperties

private static java.util.Properties generalProperties
The field generalProperties contains the properties defined in the global property file.


localProperties

private static java.util.Properties localProperties
The field localProperties contains the properties defined in the local, machine-specific property file.


logger

private static final org.apache.log4j.Logger logger
Constructor Detail

PropertyManager

public PropertyManager()
Method Detail

getProperty

public static java.lang.String getProperty(java.lang.String key)
This method allows to get a property by its string name.

Parameters:
key - The string name of the property of which the value has to be read.
Returns:
The string value of the property.

readPropertyFiles

private static void readPropertyFiles()
This method reads in both property files and thus does the main work of the PropertyManager. It is called only once.