Class CacheService
java.lang.Object
fr.paris.lutece.portal.service.cache.CacheService
Provides cache management services for cacheable components.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordEvent to be fired during the shutdown process. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> CacheableService<K, V> Retrieves a cacheable service by its cache name.static List<CacheableService<?,?>> Returns all registered cacheable services.static booleanisCacheExist(String cacheName) Checks if a cache with the given name exists.static voidregisterCacheableService(CacheableService<?, ?> cs) Registers a new cacheable service.static voidResets all caches managed by the service.static voidshutdown()Shuts down the cache service and the cache manager.static voidupdateCacheStatus(CacheableService<?, ?> cs) Updates the cache status in the database.
-
Constructor Details
-
CacheService
public CacheService()
-
-
Method Details
-
resetCaches
public static void resetCaches()Resets all caches managed by the service. -
shutdown
public static void shutdown()Shuts down the cache service and the cache manager. This method should be called when the web application is stopped. -
registerCacheableService
Registers a new cacheable service.- Parameters:
cs- The cacheable service to register
-
isCacheExist
Checks if a cache with the given name exists.- Parameters:
cacheName- The name of the cache to check- Returns:
- true if the cache exists, false otherwise
-
getCacheableServicesList
Returns all registered cacheable services.- Returns:
- A list containing all registered cacheable services
-
getCache
Retrieves a cacheable service by its cache name.- Type Parameters:
K- The type of keys maintained by the cacheV- The type of cached values- Parameters:
cacheName- The name of the cache to retrieve- Returns:
- The cacheable service associated with the specified cache name
-
updateCacheStatus
Updates the cache status in the database.- Parameters:
cs- The cacheable service whose status is to be updated
-