org.codehaus.groovy.grails.commons
Class ConfigurationHolder

java.lang.Object
  extended by org.codehaus.groovy.grails.commons.ConfigurationHolder

public class ConfigurationHolder
extends Object

Holds a reference to the ConfigObject instance.

Since:
0.6
Author:
Graeme Rocher

Constructor Summary
ConfigurationHolder()
           
 
Method Summary
static groovy.util.ConfigObject getConfig()
          Retrieve the ConfigObject.
static Map getFlatConfig()
          Returns the ConfigObject has a flattened map for easy access from Java in a properties file like way.
static void setConfig(groovy.util.ConfigObject newConfig)
          Sets the ConfigObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationHolder

public ConfigurationHolder()
Method Detail

setConfig

public static void setConfig(groovy.util.ConfigObject newConfig)
Sets the ConfigObject. Synchronized to avoid the flatten() method being called concurrently.

Parameters:
newConfig -

getConfig

public static groovy.util.ConfigObject getConfig()
Retrieve the ConfigObject. Note unsynchronized access is granted for performance reasons, however typically the ConfigObject is only set on application load or by the plugin scanner during development, so this is not an issue.

Returns:
The ConfigObject

getFlatConfig

public static Map getFlatConfig()
Returns the ConfigObject has a flattened map for easy access from Java in a properties file like way.

Returns:
The flattened ConfigObject