public class CacheService extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private static org.springframework.cloud.bus.BusProperties |
busProperties |
private static Map<String,com.github.benmanes.caffeine.cache.LoadingCache<Object,Object>> |
cacheMap |
private static org.springframework.context.ApplicationEventPublisher |
eventPublisher |
private static String |
serverName |
| 构造器和说明 |
|---|
CacheService(org.springframework.context.ApplicationEventPublisher eventPublisher,
org.springframework.cloud.bus.BusProperties busProperties,
String serverName) |
| 限定符和类型 | 方法和说明 |
|---|---|
(专用程序包) static <T> T |
get(String cacheName,
Object cacheKey) |
(专用程序包) static <T> T |
getIfPresent(String cacheName,
Object cacheKey) |
private static void |
invalid(String cacheName,
Object cacheKey) |
(专用程序包) static void |
invalidate(String cacheName,
Object cacheKey) |
void |
invalidateCache(CacheInvalidateEvent event) |
private static void |
publish(String cacheName,
Object cacheKey) |
(专用程序包) static void |
put(String cacheName,
Object cacheKey,
Object cacheValue) |
(专用程序包) static void |
putAll(String cacheName,
Map map) |
(专用程序包) static void |
registerCache(String cacheName,
com.github.benmanes.caffeine.cache.LoadingCache cache)
注册缓存
|
private static org.springframework.context.ApplicationEventPublisher eventPublisher
private static org.springframework.cloud.bus.BusProperties busProperties
private static String serverName
public CacheService(org.springframework.context.ApplicationEventPublisher eventPublisher,
org.springframework.cloud.bus.BusProperties busProperties,
String serverName)
static void registerCache(String cacheName, com.github.benmanes.caffeine.cache.LoadingCache cache)
cacheName - 缓存名称cache - 缓存public void invalidateCache(CacheInvalidateEvent event)
Copyright © 2021. All rights reserved.