Class XmlTransformerCacheService

java.lang.Object
fr.paris.lutece.portal.service.html.XmlTransformerCacheService
All Implemented Interfaces:
CacheableService<String,String>, LuteceService

@ApplicationScoped public class XmlTransformerCacheService extends Object implements CacheableService<String,String>
XmlTransformerCacheService
Since:
v 3.0
  • Constructor Details

    • XmlTransformerCacheService

      public XmlTransformerCacheService()
  • Method Details

    • getName

      public String getName()
      Returns the Service name
      Specified by:
      getName in interface LuteceService
      Returns:
      The name as a String
    • isCacheEnable

      public boolean isCacheEnable()
      Gets the current cache status.
      Specified by:
      isCacheEnable in interface CacheableService<String,String>
      Returns:
      true if the cache is enabled, otherwise false
    • getCacheSize

      public int getCacheSize()
      Gets the number of items currently in the cache.
      Specified by:
      getCacheSize in interface CacheableService<String,String>
      Returns:
      the number of items currently in the cache
    • resetCache

      public void resetCache()
      Resets the cache.
      Specified by:
      resetCache in interface CacheableService<String,String>
    • enableCache

      public void enableCache(boolean bEnable)
      Enables or disables the cache.
      Specified by:
      enableCache in interface CacheableService<String,String>
      Parameters:
      bEnable - true to enable, false to disable
    • getKeys

      public List<String> getKeys()
      Gets all keys in the cache.
      Specified by:
      getKeys in interface CacheableService<String,String>
      Returns:
      a list of all keys in the cache
    • getInfos

      public String getInfos()
      Returns cache information.
      Specified by:
      getInfos in interface CacheableService<String,String>
      Returns:
      cache information
    • initializedService

      public void initializedService(@Observes @Initialized(jakarta.enterprise.context.ApplicationScoped.class) jakarta.servlet.ServletContext context)
      This method observes the initialization of the ApplicationScoped context and registers an instance of XmlTransformerCacheService with the CacheService.

      This method is triggered automatically by CDI when the ApplicationScoped context is initialized, which typically occurs during the startup of the application server.

      Parameters:
      context - the ServletContext that is initialized. This parameter is observed and injected automatically by CDI when the ApplicationScoped context is initialized.
    • isPreventGlobalReset

      public boolean isPreventGlobalReset()
      Description copied from interface: CacheableService
      Can the cache be reset by automatic caches resets
      Specified by:
      isPreventGlobalReset in interface CacheableService<String,String>
      Returns:
      true is the cache can be reset by automatic / massive caches resets, false otherwise