Package com.microstrategy.utils.cache
Class CacheRegistry
- java.lang.Object
-
- com.microstrategy.utils.cache.CacheRegistry
-
public class CacheRegistry extends java.lang.Object
SingletonCacheRegistry
class keeps track of all caches in the JVM.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configureCache(java.lang.String name, java.util.Properties prop)
void
destroy()
Destroy the HashSet and other caches, will be called when destroying the sevletvoid
disableSoftRef()
Cache
getCache(java.lang.String name)
Returns cache by its name.java.util.Collection<Cache>
getCaches()
Returns all the caches in the registry.int
getCleanupTime()
Gets cleanup time in seconds.int
getDefaultFileRefreshTime()
Returns the interval of time to be used by default to refresh a Cache that caches file contents.int
getDefaultRefreshTime()
Gets default refreshing time in seconds.int
getDefaultStatisticTime()
Gets default statistic time in seconds.int
getDefaultSysTimeout()
Returns default cache timeout in seconds.int
getDefaultUserTimeout()
Returns fefault cache timeout in seconds.static CacheRegistry
getInstance()
Returns the singleton instance.static void
init(java.lang.String fileName)
Initializes the cache framework from the specified properties file.boolean
isCacheAvailable(java.lang.String name)
Returns whether the cache with the specified name is available.boolean
isSoftRefEnabled()
void
setCleanupTime(int value)
Sets cleanup time in seconds.void
setDefaultFileRefreshTime(int value)
Sets the interval of time to be used by default to refresh a Cache that caches file contents.void
setDefaultRefreshTime(int value)
Sets default refreshing time in seconds.void
setDefaultStatisticTime(int value)
Sets default statistic time in seconds.void
setDefaultSysTimout(int value)
Sets default cache timeout in seconds.void
setDefaultUserTimout(int value)
Sets default cache timeout in seconds.
-
-
-
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, otherwisefalse
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
-
-