public class DefaultCacheRepository extends Object implements CacheRepository
| Constructor and Description |
|---|
DefaultCacheRepository(File userHomeDir,
File projectCacheDir,
CacheUsage cacheUsage,
CacheFactory factory) |
| 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.
|
public DefaultCacheRepository(File userHomeDir, File projectCacheDir, CacheUsage cacheUsage, CacheFactory factory)
public DirectoryCacheBuilder store(String key)
CacheRepositoryA 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.
store in interface CacheRepositorykey - The cache key.public DirectoryCacheBuilder cache(String key)
CacheRepositoryA 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.
cache in interface CacheRepositorykey - The cache key.public <E> ObjectCacheBuilder<E,PersistentStateCache<E>> stateCache(Class<E> elementType, String key)
CacheRepositoryA state cache is always opened with an exclusive lock, so that it can be accessed only by this process.
stateCache in interface CacheRepositoryelementType - The type of element kept in the cache.key - The cache key.public <K,V> ObjectCacheBuilder<V,PersistentIndexedCache<K,V>> indexedCache(Class<K> keyType, Class<V> elementType, String key)
CacheRepositoryAn indexed cache is always opened with an exclusive lock, so that it can be accessed only by this process.
indexedCache in interface CacheRepositorykeyType - The type of key kept in the cache.elementType - The type of element kept in the cache.key - The cache key.Copyright © 2013. All rights reserved