Class LuteceCacheProducer

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

@ApplicationScoped public class LuteceCacheProducer extends Object
Producer of Lutece107Cache instance Retrieves a cache instance using @LuteceCache(cacheName = "cacheName", keyType = keyType, ValueType = keyType, enable = enable).

Example:

 @Inject @LuteceCache(cacheName = "cacheName", keyType = Integer.class, valueType = String.class, enable = true)
 Lutece107Cache<Integer, String> cacheInstance;
 
  • Constructor Details

    • LuteceCacheProducer

      public LuteceCacheProducer()
  • Method Details

    • produceLuteceCache

      @Produces public <K, V> Lutece107Cache<K,V> produceLuteceCache(jakarta.enterprise.inject.spi.InjectionPoint injectionPoint) throws IllegalArgumentException
      Retrieves a cache instance using @LuteceCache(cacheName = "cacheName", keyType = keyType, ValueType = keyType, enable=enable).

      Example:

       @Inject @LuteceCache(cacheName = "cacheName", keyType = Integer.class, valueType = String.class, enable=true)
       Lutece107Cache<Integer, String> cacheInstance;
       
      Type Parameters:
      K - the type of keys maintained the cache
      V - the type of cached values
      Parameters:
      injectionPoint - the injectionPoint
      Returns:
      The Lutece107Cache instance
      Throws:
      IllegalArgumentException
    • produceLuteceCache

      @Produces public <K, V> Lutece107Cache<K,V> produceLuteceCache(LuteceCacheParameterHolder parameterHolder) throws IllegalArgumentException
      Retrieves a cache instance using luteceCacheManager.createcache(cacheName cacheName, Configuration c ,enable enable).
      Type Parameters:
      K - the type of keys maintained the cache
      V - the type of cached values
      Parameters:
      parameterHolder - the luteceCacheParameterHolder
      Returns:
      The Lutece107Cache instance
      Throws:
      IllegalArgumentException