public class DefaultCacheLockingManager extends Object implements CacheLockingManager
| Modifier and Type | Field and Description |
|---|---|
static int |
CACHE_LAYOUT_VERSION |
| Constructor and Description |
|---|
DefaultCacheLockingManager(CacheRepository cacheRepository) |
| Modifier and Type | Method and Description |
|---|---|
<K,V> PersistentIndexedCache<K,V> |
createCache(File cacheFile,
Class<K> keyType,
Class<V> valueType)
Creates a cache implementation that is managed by this locking manager.
|
File |
getCacheDir() |
<T> T |
longRunningOperation(String operationDisplayName,
Factory<? extends T> action)
Performs some long running operation within an action invoked by
CacheAccess.useCache(String, org.gradle.internal.Factory). |
void |
longRunningOperation(String operationDisplayName,
Runnable action)
Performs some long running operation within an action invoked by
CacheAccess.useCache(String, org.gradle.internal.Factory). |
<T> T |
useCache(String operationDisplayName,
Factory<? extends T> action)
Performs some work against the cache.
|
void |
useCache(String operationDisplayName,
Runnable action)
Performs some work against the cache.
|
public static final int CACHE_LAYOUT_VERSION
public DefaultCacheLockingManager(CacheRepository cacheRepository)
public File getCacheDir()
getCacheDir in interface ArtifactCacheMetaDatapublic void longRunningOperation(String operationDisplayName, Runnable action)
CacheAccessCacheAccess.useCache(String, org.gradle.internal.Factory). Releases all
locks while the operation is running, and reacquires the locks at the end of the long running operation.
This method is re-entrant, so that an action can call back into this method.
longRunningOperation in interface CacheAccesspublic <T> T useCache(String operationDisplayName, Factory<? extends T> action)
CacheAccessThis method is re-entrant, so that an action can call back into this method.
useCache in interface CacheAccesspublic void useCache(String operationDisplayName, Runnable action)
CacheAccessThis method is re-entrant, so that an action can call back into this method.
useCache in interface CacheAccesspublic <T> T longRunningOperation(String operationDisplayName, Factory<? extends T> action)
CacheAccessCacheAccess.useCache(String, org.gradle.internal.Factory). Releases all
locks while the operation is running, and reacquires the locks at the end of the long running operation.
This method is re-entrant, so that an action can call back into this method.
longRunningOperation in interface CacheAccesspublic <K,V> PersistentIndexedCache<K,V> createCache(File cacheFile, Class<K> keyType, Class<V> valueType)
CacheLockingManagerThe 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).
createCache in interface CacheLockingManagerCopyright © 2013. All rights reserved