com.arjuna.common.util.propertyservice
Interface PropertyServiceImple


public interface PropertyServiceImple

The PropertyServiceImple class provides a uniform interface to accessing and manipulating Java properties.

Since:
JTS 2.1.2.
Version:
$Id: PropertyServiceImple.java 2342 2006-03-30 13:06:17Z $
Author:
Mark Little (mark@arjuna.com)

Method Summary
 void addPropertiesFile(java.lang.String fileName)
          Add the specified property file to the list of registered property files.
 java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)
          Return the value associated with the property name.
 void loadProperties()
          Read in the properties file, if present.
 java.lang.String locateFile(java.lang.String propertyName)
          Locate property file
 void removePropertiesFile(java.lang.String fileName)
          Remove the specified property file from the list of registered property files.
 java.lang.String removeProperty(java.lang.String name, boolean flush)
          Remove the property.
 void saveProperties()
          Saves the altered properties back to the properties files from which they came.
 void setProperty(java.lang.String name, java.lang.String property, boolean flush, boolean warn)
          Set the property name to have the specified value.
 

Method Detail

addPropertiesFile

void addPropertiesFile(java.lang.String fileName)
Add the specified property file to the list of registered property files.


removePropertiesFile

void removePropertiesFile(java.lang.String fileName)
                          throws java.io.FileNotFoundException
Remove the specified property file from the list of registered property files. If the file was not added, then the FileNotFoundException will be thrown.

Throws:
java.io.FileNotFoundException

loadProperties

void loadProperties()
                    throws java.lang.SecurityException,
                           java.io.IOException
Read in the properties file, if present.

Throws:
java.lang.SecurityException
java.io.IOException

saveProperties

void saveProperties()
                    throws java.lang.SecurityException,
                           java.io.IOException
Saves the altered properties back to the properties files from which they came.

Throws:
java.lang.SecurityException
java.io.IOException

setProperty

void setProperty(java.lang.String name,
                 java.lang.String property,
                 boolean flush,
                 boolean warn)
Set the property name to have the specified value. If flush is true then we put the property value into the System so that a call to System.getProperty will succeed. Otherwise we cache it as a "volatile" value. If warn is true then issue a warning message if an existing property value is changed.


getProperty

java.lang.String getProperty(java.lang.String name,
                             java.lang.String defaultValue)
Return the value associated with the property name. If the name does not exist then the specified default value will be returned.


removeProperty

java.lang.String removeProperty(java.lang.String name,
                                boolean flush)
Remove the property.


locateFile

java.lang.String locateFile(java.lang.String propertyName)
                            throws java.io.FileNotFoundException
Locate property file

Throws:
java.io.FileNotFoundException