public class CacheUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static org.ehcache.Cache<String,String> |
cacheDefault |
static org.ehcache.CacheManager |
cacheManager |
static org.ehcache.config.CacheConfiguration |
configuration |
private static Class<String> |
keyType |
private static org.slf4j.Logger |
logger |
private static String |
preConfigured |
private static Class<String> |
valueType |
| 构造器和说明 |
|---|
CacheUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <K,V> org.ehcache.Cache<K,V> |
createCache(String cacheName,
org.ehcache.config.CacheConfiguration<K,V> cacheConfiguration)
创建缓存对象
|
static <K,V> org.ehcache.Cache<K,V> |
createCache(String cacheName,
Class<K> keyType,
Class<V> valueType)
创建缓存对象
|
static String |
get(String key)
获取缓存值(默认缓存对象)
|
static org.ehcache.CacheManager |
getManager()
获取 CacheManager ,并设置默认缓存对象的 Cache 参数
|
static org.ehcache.CacheManager |
getManager(String xmlConfigPath)
获取 CacheManager ,并设置默认缓存对象的 Cache 参数
|
static void |
put(String key,
String value)
设置缓存值(默认缓存对象)
|
private static org.slf4j.Logger logger
private static String preConfigured
public static org.ehcache.config.CacheConfiguration configuration
public static org.ehcache.CacheManager cacheManager
public static org.ehcache.CacheManager getManager()
public static org.ehcache.CacheManager getManager(String xmlConfigPath)
xmlConfigPath - ehcache.xmlpublic static <K,V> org.ehcache.Cache<K,V> createCache(String cacheName, org.ehcache.config.CacheConfiguration<K,V> cacheConfiguration)
cacheName - 缓存名称cacheConfiguration - 缓存配置Copyright © 2023. All rights reserved.