Class EhcacheCacheAdapter<K,V>
java.lang.Object
io.leandev.appfuse.cache.adapter.ehcache.EhcacheCacheAdapter<K,V>
- Type Parameters:
K- 鍵的型別V- 值的型別
- All Implemented Interfaces:
Cache<K,V>
-
Constructor Summary
ConstructorsConstructorDescriptionEhcacheCacheAdapter(org.ehcache.Cache<K, V> ehcache, CacheConfiguration<K, V> configuration, org.ehcache.CacheManager cacheManager) 建構子 -
Method Summary
-
Constructor Details
-
EhcacheCacheAdapter
public EhcacheCacheAdapter(org.ehcache.Cache<K, V> ehcache, CacheConfiguration<K, V> configuration, org.ehcache.CacheManager cacheManager) 建構子- Parameters:
ehcache- Ehcache 快取實例configuration- 快取配置cacheManager- Ehcache 管理器(保留供未來擴充)
-
-
Method Details
-
get
-
put
-
remove
-
remove
Description copied from interface:Cache僅在目前值等於預期值時原子移除快取項目
安全狀態機(例如一次性 token)不可用
get後再remove,兩個請求可能同時讀到 同一筆資料。實作須把「比對 + 移除」交給同一個 backing store 的原子操作。 -
clear
-
containsKey
-
disable
-
enable
-
isEnabled
-
getStatistics
Description copied from interface:Cache取得快取統計資訊- Specified by:
getStatisticsin interfaceCache<K,V> - Returns:
- 統計資訊
-
getStatus
-
getName
-
getConfiguration
Description copied from interface:Cache取得快取配置- Specified by:
getConfigurationin interfaceCache<K,V> - Returns:
- 配置資訊
-
getEhcache
-