クラス CacheController<K,V>
java.lang.Object
org.iplass.mtp.impl.cache.CacheController<K,V>
- 型パラメータ:
K- keyの型V- valueの型
Read-Throughなキャッシュを簡単に実現するためのキャッシュコントローラ。
-
コンストラクタの概要
コンストラクタコンストラクタ説明CacheController(CacheStore store, boolean hasVersion, int indexCount, LoadingAdapter<K, V> adapter, boolean useNegativeCacheOnSharedCache) CacheController(CacheStore store, boolean hasVersion, int indexCount, LoadingAdapter<K, V> adapter, boolean useNegativeCacheOnSharedCache, boolean isStrictUpdate) -
メソッドの概要
修飾子とタイプメソッド説明voidclearAll()キャッシュを全てクリアする。指定のkeyのキャッシュの値を取得。getByIndex(int indexType, Object indexVal) 指定のindexTypeのindexValにてキャッシュの値を取得。getListByIndex(int indexType, Object indexVal) 現時点でキャッシュに格納されているデータのみが対象。getStore()このCacheControllerが管理するCacheStoreを取得。voidvoidmaintenance(Consumer<CacheController<K, V>> maintenanceFunction) voidnotifyCreate(V value) 指定の値が作成されたことをCacheControllerに通知する。voidnotifyDelete(V value) 指定の値が削除されたことをCacheControllerに通知する。voidnotifyDeleteByKey(K key) 指定のkeyの値が削除されたことをCacheControllerに通知する。voidnotifyInvalid(V value) 指定の値を無効にするよう通知する。voidnotifyInvalidByKey(K key) 指定のkeyの値を無効にするよう通知する。voidnotifyUpdate(V value) 指定の値が更新されたことをCacheControllerに通知する。voidremoveByIndex(int indexType, Object indexVal) trace()
-
コンストラクタの詳細
-
CacheController
public CacheController(CacheStore store, boolean hasVersion, int indexCount, LoadingAdapter<K, V> adapter, boolean useNegativeCacheOnSharedCache) -
CacheController
public CacheController(CacheStore store, boolean hasVersion, int indexCount, LoadingAdapter<K, V> adapter, boolean useNegativeCacheOnSharedCache, boolean isStrictUpdate)
-
-
メソッドの詳細
-
get
指定のkeyのキャッシュの値を取得。 キャッシュにない場合、LoadingAdapterを利用して バックエンドのデータストアよりデータをロードしてキャッシュする。- パラメータ:
key-- 戻り値:
-
getByIndex
指定のindexTypeのindexValにてキャッシュの値を取得。 キャッシュにない場合、LoadingAdapterを利用して バックエンドのデータストアよりデータをロードしてキャッシュする。- パラメータ:
indexType-indexVal-- 戻り値:
-
getStore
このCacheControllerが管理するCacheStoreを取得。- 戻り値:
-
getListByIndex
現時点でキャッシュに格納されているデータのみが対象。Read-Throughはしない。- パラメータ:
indexType-indexVal-- 戻り値:
-
removeByIndex
-
notifyCreate
指定の値が作成されたことをCacheControllerに通知する。- パラメータ:
value-
-
notifyUpdate
指定の値が更新されたことをCacheControllerに通知する。- パラメータ:
value-
-
notifyDeleteByKey
指定のkeyの値が削除されたことをCacheControllerに通知する。- パラメータ:
value-
-
notifyInvalidByKey
指定のkeyの値を無効にするよう通知する。- パラメータ:
value-
-
notifyDelete
指定の値が削除されたことをCacheControllerに通知する。- パラメータ:
value-
-
notifyInvalid
指定の値を無効にするよう通知する。- パラメータ:
value-
-
clearAll
public void clearAll()キャッシュを全てクリアする。 -
refreshTransactionLocalStore
-
maintenance
-
invalidateCacheStore
public void invalidateCacheStore() -
trace
-