public interface PersistentCache extends CacheAccess
By default, a shared lock is held on this cache by this process, to prevent it being removed or rebuilt by another process
while it is in use. You can change this use DirectoryCacheBuilder.withLockMode(org.gradle.cache.internal.FileLockManager.LockMode).
You can use DirectoryCacheBuilder.withInitializer(org.gradle.api.Action) to provide an action to initialize the contents
of the cache, for building a read-only cache. An exclusive lock is held by this process while the initializer is running.
You can also use CacheAccess.useCache(String, org.gradle.internal.Factory) to perform some action on the cache while holding an exclusive
lock on the cache.
| Modifier and Type | Method and Description |
|---|---|
<K,V> PersistentIndexedCache<K,V> |
createCache(File cacheFile,
Class<K> keyType,
Class<V> valueType)
Creates an indexed cache implementation that is contained within this cache.
|
<K,V> PersistentIndexedCache<K,V> |
createCache(File cacheFile,
Class<K> keyType,
Serializer<V> valueSerializer)
Creates an indexed cache implementation that is contained within this cache.
|
File |
getBaseDir()
Returns the base directory for this cache.
|
longRunningOperation, longRunningOperation, useCache, useCacheFile getBaseDir()
<K,V> PersistentIndexedCache<K,V> createCache(File cacheFile, Class<K> keyType, Class<V> valueType)
The returned cache may only be used by an action being run from CacheAccess.useCache(String, org.gradle.internal.Factory).
In this instance, an exclusive lock will be held on the cache.
The returned cache may not be used by an action being run from CacheAccess.longRunningOperation(String, org.gradle.internal.Factory).
<K,V> PersistentIndexedCache<K,V> createCache(File cacheFile, Class<K> keyType, Serializer<V> valueSerializer)
The returned cache may only be used by an action being run from CacheAccess.useCache(String, org.gradle.internal.Factory).
In this instance, an exclusive lock will be held on the cache.
The returned cache may not be used by an action being run from CacheAccess.longRunningOperation(String, org.gradle.internal.Factory).
Copyright © 2013. All rights reserved