Class MainTreeMenuCacheService

java.lang.Object
fr.paris.lutece.portal.service.cache.AbstractCacheableService<String,MenuItem>
fr.paris.lutece.plugins.menus.service.cache.MainTreeMenuCacheService
All Implemented Interfaces:
fr.paris.lutece.portal.service.cache.CacheableService<String,MenuItem>, fr.paris.lutece.portal.service.cache.Lutece107Cache<String,MenuItem>, fr.paris.lutece.portal.service.util.LuteceService, Closeable, Serializable, AutoCloseable, Iterable<javax.cache.Cache.Entry<String,MenuItem>>, javax.cache.Cache<String,MenuItem>

@ApplicationScoped public class MainTreeMenuCacheService extends fr.paris.lutece.portal.service.cache.AbstractCacheableService<String,MenuItem>
Get the instance of the cache service
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface javax.cache.Cache

    javax.cache.Cache.Entry<K extends Object,V extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the cache key for a given main menu
    getMenuTreeCacheKey(int nCurrentPageId)
    Get the cache key for a given menu tree
    void
     
    void
    initializedService(jakarta.servlet.ServletContext context)
    This method observes the initialization of the ApplicationScoped context.
    void
    processPageEvent(fr.paris.lutece.portal.service.page.PageEvent event)
    Resets the cached menus when a page is created, modified or removed.

    Methods inherited from class fr.paris.lutece.portal.service.cache.AbstractCacheableService

    clear, close, containsKey, deregisterCacheEntryListener, enableCache, get, getAll, getAndPut, getAndRemove, getAndReplace, getCache, getCacheManager, getCacheSize, getConfiguration, getFromCache, getInfos, getKeys, initCache, initCache, initCache, invoke, invokeAll, isCacheEnable, isClosed, isPreventGlobalReset, isPreventReset, isRequired, iterator, loadAll, put, putAll, putIfAbsent, putInCache, registerCacheEntryListener, remove, remove, removeAll, removeAll, removeKey, replace, replace, resetCache, setCache, unwrap

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface fr.paris.lutece.portal.service.cache.CacheableService

    getMaxElements, getMemorySize, getTimeToLive

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • MainTreeMenuCacheService

      public MainTreeMenuCacheService()
  • Method Details

    • init

      @PostConstruct public void init()
    • getMainMenuCacheKey

      public String getMainMenuCacheKey()
      Get the cache key for a given main menu
      Returns:
      The cache key for the main
    • getMenuTreeCacheKey

      public String getMenuTreeCacheKey(int nCurrentPageId)
      Get the cache key for a given menu tree
      Parameters:
      nCurrentPageId - The id of the menu tree
      Returns:
      The cache key for the menu tree
    • getName

      public String getName()
    • initializedService

      public void initializedService(@Observes @Initialized(jakarta.enterprise.context.ApplicationScoped.class) jakarta.servlet.ServletContext context)
      This method observes the initialization of the ApplicationScoped context. It ensures that this CDI beans are instantiated at the application startup.

      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.
    • processPageEvent

      public void processPageEvent(@Observes fr.paris.lutece.portal.service.page.PageEvent event)
      Resets the cached menus when a page is created, modified or removed.
      Parameters:
      event - the page event