Package com.microstrategy.utils.cache
Class CustomizationsAwareCache
- java.lang.Object
-
- com.microstrategy.utils.cache.CacheBase
-
- com.microstrategy.utils.cache.CustomizationsAwareCache
-
- All Implemented Interfaces:
Cache
,java.util.Observer
- Direct Known Subclasses:
ConfigurationFilesCache
,FileCacheBase
,PropertiesCache
,ResourceBundleCache
public abstract class CustomizationsAwareCache extends CacheBase implements java.util.Observer
This is an abstract base class for those Caches whose content can be affected by a customization. Typically, it is used by file-caches like the configuration files or resource bundles caches.
The constructor register this Cache as an observer of the
Customizations
class. When customization changes (for example, when customizations are added/removed at runtime), theCustomization
class will inform to all its observers about the change through theupdate(java.util.Observable, java.lang.Object)
method. If the observed object has changed, the cache will simply be cleared.- Since:
- MicroStrategy Web 9.0.0
-
-
Field Summary
-
Fields inherited from class com.microstrategy.utils.cache.CacheBase
alias, DEFAULT_FILE_REFRESH_TIME, DEFAULT_REFRESH_TIME, DEFAULT_STATISTIC_TIME, DEFAULT_SYS_TIMEOUT, DEFAULT_USER_TIMEOUT, NO_KEY, NO_REFRESH, NO_STATISTIC, NO_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description CustomizationsAwareCache(java.lang.String cacheName, int timeOut, int refreshTime)
Base constructor, will register the Cache in theCacheRegistry
and will add itself as an observer of the Customizations class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
update(java.util.Observable o, java.lang.Object arg)
When the observer changes, this method simply clears the cache.-
Methods inherited from class com.microstrategy.utils.cache.CacheBase
canUpdate, clear, close, configure, contains, delete, get, getKey, getName, getRefreshTime, getStatisticTime, getTimeout, getWithoutRefresh, load, logStatistic, onHintClose, onTimer, put, refresh, reLoad, remove, save, setRefreshTime, setStatisticTime, setTimeout, size, store, unLoad
-
-
-
-
Constructor Detail
-
CustomizationsAwareCache
public CustomizationsAwareCache(java.lang.String cacheName, int timeOut, int refreshTime)
Base constructor, will register the Cache in theCacheRegistry
and will add itself as an observer of the Customizations class.- Parameters:
cacheName
- The name (id) of the Cache.timeOut
- Time (in seconds) after which the cache expires.refreshTime
- Time (in seconds) before after which the cache needs to be refreshed.
-
-
Method Detail
-
update
public void update(java.util.Observable o, java.lang.Object arg)
When the observer changes, this method simply clears the cache.- Specified by:
update
in interfacejava.util.Observer
- See Also:
CustomizationsAwareCache
-
-