Class CacheService

java.lang.Object
fr.paris.lutece.portal.service.cache.CacheService

public class CacheService extends Object
Provides cache management services for cacheable components.
  • 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

      public static void registerCacheableService(CacheableService<?,?> cs)
      Registers a new cacheable service.
      Parameters:
      cs - The cacheable service to register
    • isCacheExist

      public static boolean isCacheExist(String cacheName)
      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

      public static List<CacheableService<?,?>> getCacheableServicesList()
      Returns all registered cacheable services.
      Returns:
      A list containing all registered cacheable services
    • getCache

      public static <K, V> CacheableService<K,V> getCache(String cacheName)
      Retrieves a cacheable service by its cache name.
      Type Parameters:
      K - The type of keys maintained by the cache
      V - 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

      public static void updateCacheStatus(CacheableService<?,?> cs)
      Updates the cache status in the database.
      Parameters:
      cs - The cacheable service whose status is to be updated