public class DefaultFileCacheBacking extends AbstractIndexedFileCacheBacking
AbstractIndexedFileCacheBacking.IndexEntryEMPTY_INDEX, EMPTY_KEYS, INDEX_FILEWEAVED_CLASS_CACHE_DIRlogger| Modifier | Constructor and Description |
|---|---|
protected |
DefaultFileCacheBacking(java.io.File cacheDir) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the entire cache
|
static DefaultFileCacheBacking |
createBacking(java.io.File cacheDir) |
static CacheBacking |
createBacking(java.lang.String scope) |
protected void |
delete(java.io.File file) |
CachedClassEntry |
get(CachedClassReference ref,
byte[] originalBytes)
Get a cache entry
|
protected java.util.Map<java.lang.String,AbstractIndexedFileCacheBacking.IndexEntry> |
getIndex() |
java.lang.String[] |
getKeys(java.lang.String regex)
Return a list of keys which match the given
regex.
|
void |
put(CachedClassEntry entry,
byte[] originalBytes)
Put an entry in the cache
|
protected byte[] |
read(java.io.File file,
long expectedCRC) |
protected java.util.Map<java.lang.String,AbstractIndexedFileCacheBacking.IndexEntry> |
readIndex() |
void |
remove(CachedClassReference ref)
Remove an entry from the cache
|
protected AbstractIndexedFileCacheBacking.IndexEntry |
resolveIndexMapEntry(java.io.File cacheDir,
AbstractIndexedFileCacheBacking.IndexEntry ie) |
protected long |
write(java.io.File file,
byte[] bytes) |
protected void |
writeIndex() |
createIndexEntry, getIndexFile, readIndex, readIndex, writeIndex, writeIndex, writeIndex, writeIndexclose, close, getCacheDirectory, writeClassBytescrcpublic static final DefaultFileCacheBacking createBacking(java.io.File cacheDir)
protected java.util.Map<java.lang.String,AbstractIndexedFileCacheBacking.IndexEntry> getIndex()
getIndex in class AbstractIndexedFileCacheBackingprotected AbstractIndexedFileCacheBacking.IndexEntry resolveIndexMapEntry(java.io.File cacheDir, AbstractIndexedFileCacheBacking.IndexEntry ie)
resolveIndexMapEntry in class AbstractIndexedFileCacheBackingprotected java.util.Map<java.lang.String,AbstractIndexedFileCacheBacking.IndexEntry> readIndex()
readIndex in class AbstractIndexedFileCacheBackingprotected void writeIndex()
writeIndex in class AbstractIndexedFileCacheBackingpublic void clear()
CacheBackingpublic static CacheBacking createBacking(java.lang.String scope)
public java.lang.String[] getKeys(java.lang.String regex)
CacheBackinggetKeys in interface CacheBackinggetKeys in class AbstractIndexedFileCacheBackingpublic CachedClassEntry get(CachedClassReference ref, byte[] originalBytes)
CacheBackingref - entry to retrieveoriginalBytes - Pre-weaving class bytes - required in order to
ensure that the cached entry refers to the same original classpublic void put(CachedClassEntry entry, byte[] originalBytes)
CacheBackingentry - key of the entryoriginalBytes - Pre-weaving class bytes - required in order to
ensure that the cached entry refers to the same original classpublic void remove(CachedClassReference ref)
CacheBackingprotected void delete(java.io.File file)
delete in class AbstractFileCacheBackingprotected byte[] read(java.io.File file,
long expectedCRC)
protected long write(java.io.File file,
byte[] bytes)