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 cacheV- 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>
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:
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDefault107Cache(String name) Constructor that initializes the cache with the given name.Default107Cache(String name, C configuration, boolean enable, boolean preventGlobalReset) Constructor that initializes the cache with the given name and configuration.Constructor that initializes the cache with the given name and types for keys and values.Constructor that initializes the cache with the given name and types for keys and values.Default107Cache(String name, Class<K> k, Class<V> v, boolean enable, boolean preventGlobalReset, boolean required, boolean preventReset) Constructor of a cache the webapp cannot run without: it can be required (never disabled) and protected from any reset. -
Method Summary
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, unwrapMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface fr.paris.lutece.portal.service.cache.CacheableService
getMaxElements, getMemorySize, getTimeToLiveMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Default107Cache
Constructor that initializes the cache with the given name.- Parameters:
name- the name of the cache
-
Default107Cache
Constructor that initializes the cache with the given name and types for keys and values.- Parameters:
name- the name of the cachek- the class type of the keysv- 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 cachek- the class type of the keysv- the class type of the valuesenable- the enable the cachepreventGlobalReset- prevent the cache to be reset by global cache resets
-
Default107Cache
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 cacheconfiguration- the configuration of the cacheenable- the enable cachepreventGlobalReset- prevent the cache to be reset by global cache resets
-
Default107Cache
public Default107Cache(String name, Class<K> k, Class<V> v, boolean enable, boolean preventGlobalReset, boolean required, boolean preventReset) Constructor of a cache the webapp cannot run without: it can be required (never disabled) and protected from any reset.- Parameters:
name- the name of the cachek- the class type of the keysv- the class type of the valuesenable- the status of the cache when no status is savedpreventGlobalReset- prevent the cache to be reset by global cache resetsrequired- the cache is always enabled (seeCacheableService.isRequired())preventReset- the cache is never emptied (seeCacheableService.isPreventReset())
-
-
Method Details
-
getName
Returns the name of the cache.- Returns:
- the name of the cache
-