Class CacheRegistry


  • public class CacheRegistry
    extends java.lang.Object
    Singleton CacheRegistry class keeps track of all caches in the JVM.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Method Detail

      • getInstance

        public static CacheRegistry getInstance()
        Returns the singleton instance.
        Returns:
        one and only one instance.
      • init

        public static void init​(java.lang.String fileName)
        Initializes the cache framework from the specified properties file.
        Parameters:
        fileName - properties file
        Since:
        MicroStrategy Web 8.0.0
      • getCache

        public Cache getCache​(java.lang.String name)
                       throws java.lang.IllegalArgumentException
        Returns cache by its name.
        Parameters:
        name - cache name
        Returns:
        cache
        Throws:
        java.lang.IllegalArgumentException - If cache with the specified name can not be found.
      • isCacheAvailable

        public boolean isCacheAvailable​(java.lang.String name)
        Returns whether the cache with the specified name is available.
        Parameters:
        name - cache name
        Returns:
        true when it is available, otherwise false will be returned.
        Since:
        MicroStrategy Web 7.5.1
      • getCaches

        public java.util.Collection<Cache> getCaches()
        Returns all the caches in the registry.
        Returns:
        Colleciton of Cache objects.
      • configureCache

        public void configureCache​(java.lang.String name,
                                   java.util.Properties prop)
      • getDefaultUserTimeout

        public int getDefaultUserTimeout()
        Returns fefault cache timeout in seconds.
        Returns:
        default cache timeout in seconds.
      • setDefaultUserTimout

        public void setDefaultUserTimout​(int value)
        Sets default cache timeout in seconds.
        Parameters:
        value - new default cache timeout in seconds.
      • getDefaultSysTimeout

        public int getDefaultSysTimeout()
        Returns default cache timeout in seconds.
        Returns:
        default cache timeout in seconds.
      • setDefaultSysTimout

        public void setDefaultSysTimout​(int value)
        Sets default cache timeout in seconds.
        Parameters:
        value - new default cache timeout in seconds.
      • getDefaultRefreshTime

        public int getDefaultRefreshTime()
        Gets default refreshing time in seconds.
        Returns:
        default refreshing time in seconds.
      • setDefaultRefreshTime

        public void setDefaultRefreshTime​(int value)
        Sets default refreshing time in seconds.
        Parameters:
        value - new default refreshing time in seconds.
      • getDefaultFileRefreshTime

        public int getDefaultFileRefreshTime()
        Returns the interval of time to be used by default to refresh a Cache that caches file contents.
        Returns:
        default file refreshing time in seconds.
        Since:
        MicroStrategy Web 9.0.0
      • setDefaultFileRefreshTime

        public void setDefaultFileRefreshTime​(int value)
        Sets the interval of time to be used by default to refresh a Cache that caches file contents.
        Parameters:
        value - new default refreshing time in seconds.
        Since:
        MicroStrategy Web 9.0.0
      • getDefaultStatisticTime

        public int getDefaultStatisticTime()
        Gets default statistic time in seconds.
        Returns:
        default statistic time in seconds.
      • setDefaultStatisticTime

        public void setDefaultStatisticTime​(int value)
        Sets default statistic time in seconds.
        Parameters:
        value - new default statistic time in seconds.
      • getCleanupTime

        public int getCleanupTime()
        Gets cleanup time in seconds. This property controls how often the cache registry will send onTimer event to all registered caches.
        Returns:
        cleanup time in seconds.
      • setCleanupTime

        public void setCleanupTime​(int value)
        Sets cleanup time in seconds. This property controls how often the cache registry will send onTimer event to all registered caches.
        Parameters:
        value - new cleanup time in seconds.
      • disableSoftRef

        public void disableSoftRef()
      • isSoftRefEnabled

        public boolean isSoftRefEnabled()
      • destroy

        public void destroy()
        Destroy the HashSet and other caches, will be called when destroying the sevlet