Package net.solarnetwork.central.support
Class CacheUtils
java.lang.Object
net.solarnetwork.central.support.CacheUtils
Utilities for JCache.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceListener API for "eviction" events. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> void deregisterCacheEvictionListener(javax.cache.Cache<K, V> cache, CacheUtils.CacheEvictionListener<K, V> listener) Remove a previously registered cache eviction listener.static <K,V> void registerCacheEvictionListener(javax.cache.Cache<K, V> cache, CacheUtils.CacheEvictionListener<K, V> listener) Register a cache eviction listener if possible.
-
Constructor Details
-
CacheUtils
public CacheUtils()
-
-
Method Details
-
registerCacheEvictionListener
public static <K,V> void registerCacheEvictionListener(javax.cache.Cache<K, V> cache, CacheUtils.CacheEvictionListener<K, V> listener) Register a cache eviction listener if possible.- Type Parameters:
K- the cache key typeV- the cache value type- Parameters:
cache- the cache to register the listener onlistener- the listener to register
-
deregisterCacheEvictionListener
public static <K,V> void deregisterCacheEvictionListener(javax.cache.Cache<K, V> cache, CacheUtils.CacheEvictionListener<K, V> listener) Remove a previously registered cache eviction listener.- Type Parameters:
K- the cache key typeV- the cache value type- Parameters:
cache- the cache to remove the listener fromlistener- the listener to remove
-