org.kuali.rice.core.api.config.property
Class ConfigContext

java.lang.Object
  extended by org.kuali.rice.core.api.config.property.ConfigContext

public class ConfigContext
extends Object

Singleton that holds references to global engine objects.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Method Summary
static void destroy()
          Destroy method (mostly to aid testing, as core needs to be torn down appropriately).
static Config getConfig(ClassLoader cl)
          Returns the Config which is bound to the given class loader.
static Set<Map.Entry<ClassLoader,Config>> getConfigs()
           
static Config getCurrentContextConfig()
          Utility method that all code should call to obtain its appropriate Config object.
static void init(ClassLoader classLoader, Config config)
          Initializes the ConfigContext with the given Config and binds it to the given ClassLoader.
static void init(Config rootCfg)
          Perform a one-time initialization of the Config system.
static boolean isInitialized()
           
static void overrideConfig(ClassLoader cl, Config config)
          Overrides any existing Config for the classloader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static void init(Config rootCfg)
Perform a one-time initialization of the Config system. This should only be performed by the applicable LifeCycle implementation.

Parameters:
rootCfg - the root config

init

public static void init(ClassLoader classLoader,
                        Config config)
Initializes the ConfigContext with the given Config and binds it to the given ClassLoader.


isInitialized

public static boolean isInitialized()

destroy

public static void destroy()
Destroy method (mostly to aid testing, as core needs to be torn down appropriately).


getCurrentContextConfig

public static Config getCurrentContextConfig()
Utility method that all code should call to obtain its appropriate Config object. The Config object which is associated with the caller's context classloader will be returned, being created first if it does not yet exist.

Returns:
the Config object which is associated with the caller's context classloader

getConfig

public static Config getConfig(ClassLoader cl)
Returns the Config which is bound to the given class loader. If no configuration is bound to the given class loader this method will return null;

Parameters:
cl - the classloader whose Config to return
Returns:
the Config of a particular class loader, or null if no config is bound to the given class loader

getConfigs

public static Set<Map.Entry<ClassLoader,Config>> getConfigs()
Returns:
an immutable view of the Configs entry set

overrideConfig

public static void overrideConfig(ClassLoader cl,
                                  Config config)
Overrides any existing Config for the classloader

Parameters:
cl - the classloader whose Config should be overridden
config - the config


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.