com.is.jrf
Class JRFProperties

java.lang.Object
  |
  +--com.is.jrf.JRFProperties

public class JRFProperties
extends java.lang.Object

Use of this class or it's properties file is not required. This class is used only when the AbstractDomain subclass has not set a DatabasePolicy or JDBCHelper information.

This class manages the properties file for the jRelationalFramework.

The location of the properties file can be set with the -DjrfPropertiesFile= JVM argument. Otherwise, the default is assumed to be jrf.properties somewhere in the root of one of the directories (or jars) in the classpath.


Constructor Summary
JRFProperties()
           
 
Method Summary
static DatabasePolicy getDatabasePolicy()
          Return the DatabasePolicy instance.
static java.lang.String getProperty(java.lang.String aString)
          If the first time, then read the properties file.
static void initialize()
          Check the jrfPropertiesFile system property (set with a jvm argument of -DjrfPropertiesFile=abc -- The ".properties" file suffix is assumed).
static void initialize(java.util.Properties properties)
           
static void initialize(java.lang.String bundleName)
          To use this method, there must be a bundleName.properties file somewhere in the classpath.
static boolean propertyIsTrue(java.lang.String aString)
          Return true if the property exists and it's value is "true" or "yes".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRFProperties

public JRFProperties()
Method Detail

initialize

public static void initialize()
Check the jrfPropertiesFile system property (set with a jvm argument of -DjrfPropertiesFile=abc -- The ".properties" file suffix is assumed). If there is no property with that name, we assume the properties file is named jrf.properties and is in the root of one of the directories (or jars) in the classpath.

initialize

public static void initialize(java.lang.String bundleName)
To use this method, there must be a bundleName.properties file somewhere in the classpath. Note that understanding how java.util.ResourceBundle works will help in understanding how this works.
Parameters:
bundleName - a value of type 'String'. See java.util.ResourceBundle

initialize

public static void initialize(java.util.Properties properties)

getProperty

public static java.lang.String getProperty(java.lang.String aString)
If the first time, then read the properties file. Return the value of the specified property.
Parameters:
aString - a value of type 'String'
Returns:
a value of type 'String'

propertyIsTrue

public static boolean propertyIsTrue(java.lang.String aString)
Return true if the property exists and it's value is "true" or "yes". The default is false if the property does not exist.
Returns:
a value of type 'boolean'

getDatabasePolicy

public static DatabasePolicy getDatabasePolicy()
Return the DatabasePolicy instance. Be warned that if this database policy object has instance variables and you are in a multi-threaded environment, that this instance may need to be synchronized or else this will need to return a clone of the database policy.
Returns:
a value of type 'DatabasePolicy'