org.openbp.common.setting
Class SystemPropertyProvider

java.lang.Object
  extended by org.openbp.common.setting.SystemPropertyProvider
All Implemented Interfaces:
SettingProvider

public final class SystemPropertyProvider
extends java.lang.Object
implements SettingProvider

Implementation of a setting provider that supports access to System properties. The returned setting values are always strings. This class is a singleton.

Author:
Heiko Erhardt

Method Summary
static SystemPropertyProvider getInstance()
          Gets the singleton instance of this class.
 java.lang.Object getSetting(java.lang.String name)
          Gets a setting value.
 boolean loadSettings()
          Loads the settings.
 boolean saveSettings()
          Saves the settings.
 boolean setSetting(java.lang.String name, java.lang.Object value)
          Sets a setting.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static SystemPropertyProvider getInstance()
Gets the singleton instance of this class.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getSetting

public java.lang.Object getSetting(java.lang.String name)
Gets a setting value.

Specified by:
getSetting in interface SettingProvider
Parameters:
name - Name of the setting
Returns:
The setting value or null if the setting does not exist

setSetting

public boolean setSetting(java.lang.String name,
                          java.lang.Object value)
Sets a setting. System properties cannot be saved, so the method returns always false.

Specified by:
setSetting in interface SettingProvider
Parameters:
name - Name of the setting
value - Value of the setting
Returns:
false

loadSettings

public boolean loadSettings()
Loads the settings. Does nothing.

Specified by:
loadSettings in interface SettingProvider
Returns:
true

saveSettings

public boolean saveSettings()
Saves the settings. Does nothing.

Specified by:
saveSettings in interface SettingProvider
Returns:
true


Copyright © 2011. All Rights Reserved.