Class 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), the Customization class will inform to all its observers about the change through the update(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
    • Constructor Detail

      • CustomizationsAwareCache

        public CustomizationsAwareCache​(java.lang.String cacheName,
                                        int timeOut,
                                        int refreshTime)
        Base constructor, will register the Cache in the CacheRegistry 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 interface java.util.Observer
        See Also:
        CustomizationsAwareCache