Interface CacheableService<K,V>
- Type Parameters:
K- the type of keys maintained by the cacheV- the type of cached values
- All Superinterfaces:
LuteceService
- All Known Subinterfaces:
Lutece107Cache<K,V>
- All Known Implementing Classes:
AbstractCacheableService,BaseUserPreferencesCacheService,Default107Cache,LinksIncludeCacheService,LuteceUserCacheService,PageCacheService,PathCacheService,PortletCacheService,ResourceService,XmlTransformerCacheService
Base interface of Lutece services that provide a cache.
Uses the JCache API to make cache statistics available via the
CacheStatisticsMXBean.-
Method Summary
Modifier and TypeMethodDescriptionvoidenableCache(boolean bEnable) Enables or disables the cache.intGets the number of items currently in the cache.getInfos()Returns cache information.getKeys()Gets all keys in the cache.default intDeprecated.default longDeprecated.default longDeprecated.booleanGets the current cache status.booleanCan the cache be reset by automatic caches resetsvoidResets the cache.Methods inherited from interface fr.paris.lutece.portal.service.util.LuteceService
getName
-
Method Details
-
isCacheEnable
boolean isCacheEnable()Gets the current cache status.- Returns:
- true if the cache is enabled, otherwise false
-
getCacheSize
int getCacheSize()Gets the number of items currently in the cache.- Returns:
- the number of items currently in the cache
-
resetCache
void resetCache()Resets the cache. -
enableCache
void enableCache(boolean bEnable) Enables or disables the cache.- Parameters:
bEnable- true to enable, false to disable
-
getKeys
Gets all keys in the cache.- Returns:
- a list of all keys in the cache
-
getMaxElements
Deprecated.Returns the maximum number of elements accepted into the cache. This method will be removed in the next version: Use the JCache API to make cache statistics available via theCacheStatisticsMXBean.- Returns:
- the maximum number of elements
-
getTimeToLive
Deprecated.Returns the time to live for objects in the cache. This method will be removed in the next version: Use the JCache API to make cache statistics available via theCacheStatisticsMXBean.- Returns:
- the time to live in seconds
-
getMemorySize
Deprecated.Returns the memory size of the cache. This method will be removed in the next version: Use the JCache API to make cache statistics available via theCacheStatisticsMXBean.- Returns:
- the memory size
-
getInfos
String getInfos()Returns cache information.- Returns:
- cache information
-
isPreventGlobalReset
boolean isPreventGlobalReset()Can the cache be reset by automatic caches resets- Returns:
- true is the cache can be reset by automatic / massive caches resets, false otherwise
-