Class Default107Cache<K,V>

java.lang.Object
fr.paris.lutece.portal.service.cache.AbstractCacheableService<K,V>
fr.paris.lutece.portal.service.cache.Default107Cache<K,V>
Type Parameters:
K - the type of keys maintained by the cache
V - the type of cached values
All Implemented Interfaces:
CacheableService<K,V>, Lutece107Cache<K,V>, LuteceService, Closeable, Serializable, AutoCloseable, Iterable<javax.cache.Cache.Entry<K,V>>, javax.cache.Cache<K,V>

public class Default107Cache<K,V> extends AbstractCacheableService<K,V>
Default Lutece implementation of the Cache using JCache (JSR-107). This class implements the JCache (JSR-107) cache API and provides the service for enabling and disabling caches from an administration interface. Retrieves a cache instance using this ILuteceCacheManager or LuteceCache annotation.

Example:

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

    • Default107Cache

      public Default107Cache(String name)
      Constructor that initializes the cache with the given name.
      Parameters:
      name - the name of the cache
    • Default107Cache

      public Default107Cache(String name, Class<K> k, Class<V> v)
      Constructor that initializes the cache with the given name and types for keys and values.
      Parameters:
      name - the name of the cache
      k - the class type of the keys
      v - the class type of the values
    • Default107Cache

      public Default107Cache(String name, Class<K> k, Class<V> v, boolean enable, boolean preventGlobalReset)
      Constructor that initializes the cache with the given name and types for keys and values.
      Parameters:
      name - the name of the cache
      k - the class type of the keys
      v - the class type of the values
      enable - the enable the cache
      preventGlobalReset - prevent the cache to be reset by global cache resets
    • Default107Cache

      public Default107Cache(String name, C configuration, boolean enable, boolean preventGlobalReset)
      Constructor that initializes the cache with the given name and configuration.
      Type Parameters:
      C - the type of the configuration
      Parameters:
      name - the name of the cache
      configuration - the configuration of the cache
      enable - the enable cache
      preventGlobalReset - prevent the cache to be reset by global cache resets
  • Method Details

    • getName

      public String getName()
      Returns the name of the cache.
      Returns:
      the name of the cache