public abstract class

FileCacheBase

extends CustomizationsAwareCache
java.lang.Object
   ↳ com.microstrategy.utils.cache.CacheBase
     ↳ com.microstrategy.utils.cache.CustomizationsAwareCache
       ↳ com.microstrategy.utils.cache.FileCacheBase
Known Direct Subclasses

Class Overview

The FileCacheBase is the base class for cached objects that depend on a single file, that is, the file they depend on cannot be customized through the plug-ins infrastructure, nor can it internally depend on other configuration files.

It's load method will call the doLoad(CacheHint) and save the file's ModificationTime in a table. When reload is call it will compare the current file's ModificationTime against the value in the table and only if different will call load(CacheHint) again.

Summary

[Expand]
Inherited Constants
From class com.microstrategy.utils.cache.CacheBase
[Expand]
Inherited Fields
From class com.microstrategy.utils.cache.CacheBase
Protected Constructors
FileCacheBase(String cacheName)
Base constructor, it will register the Cache in the CacheRegistry and set is refresh time to DEFAULT_FILE_REFRESH_TIME
Protected Methods
abstract Object doLoad(CacheHint hint)
This abstract method is called by the load method to perform the actual loading.
Object getKey(CacheHint hint)
Returns the key of the cache element based on the hint.
String getPath(CacheHint hint)
Returns the path for the given hint.
Object load(CacheHint hint)
Loads an element from a file and keeps track of its last modification time.
Object reLoad(CacheHint hint, Object ob)
Checks if the file corresponding to the hint has changed (by comparing its last modification time with the value stored by the load method), and if the same, just returns the same object, otherwise it will call delegate tot he load(CacheHint) method.
[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

Protected Constructors

protected FileCacheBase (String cacheName)

Base constructor, it will register the Cache in the CacheRegistry and set is refresh time to DEFAULT_FILE_REFRESH_TIME

Parameters
cacheName The name (id) of the Cache.

Protected Methods

protected abstract Object doLoad (CacheHint hint)

This abstract method is called by the load method to perform the actual loading. In this method, subclasses needs to load the file and parse it, and return the object they actually want cached.

protected Object getKey (CacheHint hint)

Returns the key of the cache element based on the hint. In this scenario, the hint itself is the key.

Parameters
hint the hint object.
Returns
  • the key

protected String getPath (CacheHint hint)

Returns the path for the given hint. This implementation simply uses the hint value.

protected Object load (CacheHint hint)

Loads an element from a file and keeps track of its last modification time. The actual loading of the element is delegated to the doLoad(CacheHint) method.

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

protected Object reLoad (CacheHint hint, Object ob)

Checks if the file corresponding to the hint has changed (by comparing its last modification time with the value stored by the load method), and if the same, just returns the same object, otherwise it will call delegate tot he load(CacheHint) method.

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