Class AbstractIndexedFileCacheBacking
java.lang.Object
org.aspectj.weaver.tools.cache.AbstractCacheBacking
org.aspectj.weaver.tools.cache.AbstractFileCacheBacking
org.aspectj.weaver.tools.cache.AbstractIndexedFileCacheBacking
- All Implemented Interfaces:
CacheBacking
- Direct Known Subclasses:
AsynchronousFileCacheBacking, DefaultFileCacheBacking
Uses an
index file to keep track of the cached entries-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe default index entry in the index file -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final AbstractIndexedFileCacheBacking.IndexEntry[]protected static final String[]static final StringDefault name of cache index file - assumed to containAbstractIndexedFileCacheBacking.IndexEntry-sFields inherited from class AbstractFileCacheBacking
WEAVED_CLASS_CACHE_DIRModifier and TypeFieldDescriptionstatic final StringDefault property used to specify a default weaving cache dir locationFields inherited from class AbstractCacheBacking
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final AbstractIndexedFileCacheBacking.IndexEntrycreateIndexEntry(CachedClassEntry classEntry, byte[] originalBytes) protected abstract Map<String, AbstractIndexedFileCacheBacking.IndexEntry> getIndex()String[]Return a list of keys which match the given regex.protected Map<String, AbstractIndexedFileCacheBacking.IndexEntry> protected Map<String, AbstractIndexedFileCacheBacking.IndexEntry> protected voidprotected voidwriteIndex(File file) protected voidwriteIndex(File indexFile, Collection<? extends AbstractIndexedFileCacheBacking.IndexEntry> entries) protected voidwriteIndex(File indexFile, Map<String, ? extends AbstractIndexedFileCacheBacking.IndexEntry> index) protected voidwriteIndex(File indexFile, AbstractIndexedFileCacheBacking.IndexEntry... entries) Methods inherited from class AbstractFileCacheBacking
close, close, delete, getCacheDirectory, writeClassBytesModifier and TypeMethodDescriptionprotected voidclose(InputStream in, File file) protected voidclose(OutputStream out, File file) protected voidprotected voidwriteClassBytes(String key, byte[] bytes) Methods inherited from class AbstractCacheBacking
crcModifier and TypeMethodDescriptionstatic final longcrc(byte[] bytes) Calculates CRC32 on the provided bytesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CacheBacking
clear, get, put, removeModifier and TypeMethodDescriptionvoidclear()Clear the entire cacheget(CachedClassReference ref, byte[] originalBytes) Get a cache entryvoidput(CachedClassEntry entry, byte[] originalBytes) Put an entry in the cachevoidRemove an entry from the cache
-
Field Details
-
INDEX_FILE
Default name of cache index file - assumed to containAbstractIndexedFileCacheBacking.IndexEntry-s- See Also:
-
EMPTY_INDEX
-
EMPTY_KEYS
-
-
Constructor Details
-
AbstractIndexedFileCacheBacking
-
-
Method Details
-
getIndexFile
-
getKeys
Description copied from interface:CacheBackingReturn a list of keys which match the given regex.- Parameters:
regex-- Returns:
-
readIndex
-
writeIndex
protected void writeIndex() -
writeIndex
-
getIndex
-
readIndex
protected Map<String, AbstractIndexedFileCacheBacking.IndexEntry> readIndex(File cacheDir, File cacheFile) -
resolveIndexMapEntry
protected AbstractIndexedFileCacheBacking.IndexEntry resolveIndexMapEntry(File cacheDir, AbstractIndexedFileCacheBacking.IndexEntry ie) -
readIndex
-
writeIndex
protected void writeIndex(File indexFile, Map<String, ? extends AbstractIndexedFileCacheBacking.IndexEntry> index) throws IOException - Throws:
IOException
-
writeIndex
protected void writeIndex(File indexFile, AbstractIndexedFileCacheBacking.IndexEntry... entries) throws IOException - Throws:
IOException
-
writeIndex
protected void writeIndex(File indexFile, Collection<? extends AbstractIndexedFileCacheBacking.IndexEntry> entries) throws IOException - Throws:
IOException
-
createIndexEntry
public static final AbstractIndexedFileCacheBacking.IndexEntry createIndexEntry(CachedClassEntry classEntry, byte[] originalBytes)
-