audiojury.action
Class ConfigManager

java.lang.Object
  |
  +--audiojury.domain.ConfigBase
        |
        +--audiojury.action.ConfigManager
All Implemented Interfaces:
ConfigProcessing

public class ConfigManager
extends ConfigBase
implements ConfigProcessing

Wrapper for the ConfigPlugin. It mostly forwards all requests to the plugin. The class implements the Singleton design pattern, which means there is only one instance of this class. This is necessary to make concurrent access to configuration settings impossible.

See Also:
ConfigPlugin

Field Summary
 
Fields inherited from class audiojury.domain.ConfigBase
APPLICATION_ROOT, BROWSE_SOUND_PATH, PERSON_INFO, PROJECTS_PATH, REPORT_PATH, RESULT_PATH, SHARED_PATH
 
Method Summary
static ConfigManager getUniqueInstance()
          Enforces the Singleton design pattern by always returning the same instance of ConfigManager.
 java.lang.String getValue(int type)
          Gets the value of a a configuration parameter.
 java.lang.String[] getValues(int type)
          Gets the values of a a multi-valued configuration parameter.
 void saveConfiguration()
          Saves the configuration settings.
 void setConfigPlugin(ConfigPlugin realSubject)
          Use this method to choose which storage plugin to use.
 void setValue(int type, java.lang.String value)
          Sets a configuration parameter.
 void setValues(int type, java.lang.String[] values)
          Sets a multi-valued configuration parameter.
 
Methods inherited from class audiojury.domain.ConfigBase
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setConfigPlugin

public void setConfigPlugin(ConfigPlugin realSubject)
Use this method to choose which storage plugin to use.

Parameters:
realSubject - The desired ConfigPlugin.

setValues

public void setValues(int type,
                      java.lang.String[] values)
Sets a multi-valued configuration parameter.

Specified by:
setValues in interface ConfigProcessing
Parameters:
type - A parameter constant as defined in ConfigBase.
values - The values to assign to the configuration parameter.

getValues

public java.lang.String[] getValues(int type)
Gets the values of a a multi-valued configuration parameter.

Specified by:
getValues in interface ConfigProcessing
Parameters:
type - A parameter identifier as defined in ConfigBase.
Returns:
The values of the configuration parameter.

setValue

public void setValue(int type,
                     java.lang.String value)
Sets a configuration parameter.

Specified by:
setValue in interface ConfigProcessing
Parameters:
type - A parameter identifier as defined in ConfigBase.
value - The value to assign to the configuration parameter.

getValue

public java.lang.String getValue(int type)
Gets the value of a a configuration parameter.

Specified by:
getValue in interface ConfigProcessing
Parameters:
type - A parameter identifier as defined in ConfigBase.
Returns:
The value of the configuration parameter.

getUniqueInstance

public static ConfigManager getUniqueInstance()
Enforces the Singleton design pattern by always returning the same instance of ConfigManager. This should be used instead of a constructor.

Returns:
A unique single ConfigManager instance.

saveConfiguration

public void saveConfiguration()
Saves the configuration settings.