public class DefaultPersistentDirectoryStore extends Object implements PersistentCache
| Constructor and Description |
|---|
DefaultPersistentDirectoryStore(File dir,
String displayName,
FileLockManager.LockMode lockMode,
FileLockManager fileLockManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<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.
|
protected FileLock |
getLock() |
protected File |
getLockTarget() |
protected void |
init() |
<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). |
DefaultPersistentDirectoryStore |
open() |
String |
toString() |
<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 DefaultPersistentDirectoryStore(File dir, String displayName, FileLockManager.LockMode lockMode, FileLockManager fileLockManager)
public DefaultPersistentDirectoryStore open()
protected File getLockTarget()
protected void init()
throws IOException
IOExceptionpublic void close()
protected FileLock getLock()
public File getBaseDir()
PersistentCachegetBaseDir in interface PersistentCachepublic <K,V> PersistentIndexedCache<K,V> createCache(File cacheFile, Class<K> keyType, Class<V> valueType)
PersistentCacheThe 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 PersistentCachepublic <K,V> PersistentIndexedCache<K,V> createCache(File cacheFile, Class<K> keyType, Serializer<V> valueSerializer)
PersistentCacheThe 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 PersistentCachepublic <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 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 CacheAccessCopyright © 2013. All rights reserved