public interface CacheRepository
--cache rebuild will invalidate the contents of all caches, but not the contents of any stores.
There are 3 types of caches and stores:
PersistentCache. The caller is responsible for managing the contents of this directory.Map, represented by PersistentIndexedCache.AtomicReference, represented by PersistentStateCache.| Modifier and Type | Method and Description |
|---|---|
DirectoryCacheBuilder |
cache(String key)
Returns a builder for the cache with the given key.
|
<K,V> ObjectCacheBuilder<V,PersistentIndexedCache<K,V>> |
indexedCache(Class<K> keyType,
Class<V> elementType,
String key)
Returns a builder for the indexed cache with the given key.
|
<E> ObjectCacheBuilder<E,PersistentStateCache<E>> |
stateCache(Class<E> elementType,
String key)
Returns a builder for the state cache with the given key.
|
DirectoryCacheBuilder |
store(String key)
Returns a builder for the store with the given key.
|
DirectoryCacheBuilder store(String key)
A store is always opened with a shared lock, so that it can be accessed by multiple processes. It is the caller's responsibility to coordinate access to the cache.
key - The cache key.DirectoryCacheBuilder cache(String key)
A state cache is always opened with a shared lock, so that it can be accessed by multiple processes. It is the caller's responsibility to coordinate access to the cache.
key - The cache key.<E> ObjectCacheBuilder<E,PersistentStateCache<E>> stateCache(Class<E> elementType, String key)
A state cache is always opened with an exclusive lock, so that it can be accessed only by this process.
key - The cache key.elementType - The type of element kept in the cache.<K,V> ObjectCacheBuilder<V,PersistentIndexedCache<K,V>> indexedCache(Class<K> keyType, Class<V> elementType, String key)
An indexed cache is always opened with an exclusive lock, so that it can be accessed only by this process.
key - The cache key.keyType - The type of key kept in the cache.elementType - The type of element kept in the cache.Copyright © 2013. All rights reserved