@Component(value="blJCacheUtil") @ConditionalOnEhCache public class DefaultEhCacheUtil extends DefaultJCacheUtil
CacheManager
.
The standard APIs do not provide enough control, so we encapsulate those details here.builder, cacheManager
Constructor and Description |
---|
DefaultEhCacheUtil(javax.cache.CacheManager cacheManager) |
DefaultEhCacheUtil(String uri) |
DefaultEhCacheUtil(URI uri) |
Modifier and Type | Method and Description |
---|---|
javax.cache.Cache<Object,Object> |
createCache(String cacheName,
int ttlSeconds,
int maxElementsInMemory)
Returns a new Cache with the appropriate cache name, TTL, and maxElements.
|
<K,V> javax.cache.Cache<K,V> |
createCache(String cacheName,
int ttlSeconds,
int maxElementsInMemory,
Class<K> key,
Class<V> value)
Returns a new Cache with the appropriate cache name, TTL, and maxElements.
|
<K,V> javax.cache.Cache<K,V> |
getCache(String cacheName)
Returns the cache associated with the name or null if no cache exists.
|
enableManagement, enableStatistics, getCacheManager
public DefaultEhCacheUtil(String uri)
@Autowired public DefaultEhCacheUtil(javax.cache.CacheManager cacheManager)
public DefaultEhCacheUtil(URI uri)
public <K,V> javax.cache.Cache<K,V> getCache(String cacheName)
JCacheUtil
getCache
in interface JCacheUtil
getCache
in class DefaultJCacheUtil
public javax.cache.Cache<Object,Object> createCache(String cacheName, int ttlSeconds, int maxElementsInMemory)
JCacheUtil
createCache
in interface JCacheUtil
createCache
in class DefaultJCacheUtil
public <K,V> javax.cache.Cache<K,V> createCache(String cacheName, int ttlSeconds, int maxElementsInMemory, Class<K> key, Class<V> value)
JCacheUtil
createCache
in interface JCacheUtil
createCache
in class DefaultJCacheUtil
Copyright © 2022. All rights reserved.