@Component(value="blJCacheUtil") @ConditionalOnEhCacheMissing public class DefaultJCacheUtil extends Object implements JCacheUtil
CacheManager
.
Note that this has limited features and functionality based on the fact that the generic JCache (JSR 107) APIs have limited
ability to specify max elements, overflow, etc.Modifier and Type | Field and Description |
---|---|
protected JCacheConfigurationBuilder |
builder |
protected javax.cache.CacheManager |
cacheManager |
Constructor and Description |
---|
DefaultJCacheUtil(javax.cache.CacheManager cacheManager) |
DefaultJCacheUtil(String uri) |
DefaultJCacheUtil(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.
|
protected void |
enableManagement(javax.cache.Cache<?,?> cache)
By default this disables management of each cache that is created here.
|
protected void |
enableStatistics(javax.cache.Cache<?,?> cache)
By default this enables statistics for each cache that is created here.
|
<K,V> javax.cache.Cache<K,V> |
getCache(String cacheName)
Returns the cache associated with the name or null if no cache exists.
|
javax.cache.CacheManager |
getCacheManager() |
@Autowired protected JCacheConfigurationBuilder builder
protected javax.cache.CacheManager cacheManager
@Autowired public DefaultJCacheUtil(javax.cache.CacheManager cacheManager)
public DefaultJCacheUtil(String uri)
public DefaultJCacheUtil(URI uri)
public javax.cache.CacheManager getCacheManager()
getCacheManager
in interface JCacheUtil
public javax.cache.Cache<Object,Object> createCache(String cacheName, int ttlSeconds, int maxElementsInMemory)
JCacheUtil
createCache
in interface JCacheUtil
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
public <K,V> javax.cache.Cache<K,V> getCache(String cacheName)
JCacheUtil
getCache
in interface JCacheUtil
protected void enableManagement(javax.cache.Cache<?,?> cache)
cache
- protected void enableStatistics(javax.cache.Cache<?,?> cache)
cache
- Copyright © 2022. All rights reserved.