public class

ConfigurationFilesCache

extends CustomizationsAwareCache
java.lang.Object
   ↳ com.microstrategy.utils.cache.CacheBase
     ↳ com.microstrategy.utils.cache.CustomizationsAwareCache
       ↳ com.microstrategy.utils.config.ConfigurationFilesCache

Class Overview

This is the Cache of configuration files. To read the settings from a configuration file, clients create a class that implements ConfigurationFile capable of loading and parsing the file contents, and pass a ConfigurationFilesCache.ConfigurationFileCacheHint to this cache with their class and file location information, for example:
CacheHint hint = new ConfigurationFileCacheHint("/WEB-INF/xml/myConfigFile.xml", MyConfigClass.class); MyConfigClass config = ConfigurationFilesCache.getInstance().get(hint);
It provides a static helper method to accomplish the same:
MyConfigClass config = ConfigurationFilesCache.getConfiguration("/WEB-INF/xml/myConfigFile.xml", MyConfigClass.class);
Typically the configuration class simply extends AbstractConfigurationElement, which already provides the logic to parse the structure of an xml-based configuration file.

Summary

Nested Classes
class ConfigurationFilesCache.ConfigurationFileCacheHint This is the CacheHint for the ConfigurationFilesCache. 
[Expand]
Inherited Constants
From class com.microstrategy.utils.cache.CacheBase
[Expand]
Inherited Fields
From class com.microstrategy.utils.cache.CacheBase
Public Methods
static ConfigurationFile getConfiguration(String filePath, Class configClass)
static ConfigurationFilesCache getInstance()
static void removeConfiguration(String filePath, Class configClass)
This method when called will remove the ConfigurationFileCacheHint from the ConfigurationFileCache
Protected Methods
Object getKey(CacheHint hint)
Overridable.
Object load(CacheHint hint)
Overridable.
Object reLoad(CacheHint hint, Object ob)
Overridable.
[Expand]
Inherited Methods
From class com.microstrategy.utils.cache.CustomizationsAwareCache
From class com.microstrategy.utils.cache.CacheBase
From class java.lang.Object
From interface com.microstrategy.utils.cache.Cache
From interface java.util.Observer

Public Methods

public static ConfigurationFile getConfiguration (String filePath, Class configClass)

public static ConfigurationFilesCache getInstance ()

public static void removeConfiguration (String filePath, Class configClass)

This method when called will remove the ConfigurationFileCacheHint from the ConfigurationFileCache

Protected Methods

protected Object getKey (CacheHint hint)

Overridable. Extracts from the hint object the key that shall be used to identify the cached object.

Parameters
hint the hint object.
Returns
  • the key

protected Object load (CacheHint hint)

Overridable. Creates a new cached object instance and populates it with data from the persistent storage. In case the object not found in the persistent storage the implementation can return either null or a dummy object.

Parameters
hint the hint object.
Returns
  • the object or null.

protected Object reLoad (CacheHint hint, Object ob)

Overridable. Re-populates cached object with data from persistent storage. Implementation of this method can re-load the object “in-place” or it can create another object.

Parameters
hint the hint object.
Returns
  • the object or null.