Class ZippedFileCacheBacking
java.lang.Object
org.aspectj.weaver.tools.cache.AbstractCacheBacking
org.aspectj.weaver.tools.cache.AbstractFileCacheBacking
org.aspectj.weaver.tools.cache.AbstractIndexedFileCacheBacking
org.aspectj.weaver.tools.cache.AsynchronousFileCacheBacking
org.aspectj.weaver.tools.cache.ZippedFileCacheBacking
- All Implemented Interfaces:
CacheBacking
Uses a ZIP file to store the instrumented classes/aspects - each one as a
separate
ZipEntry. This mechanism is suitable for relatively
large numbers of instrumented classes/aspects (100's and more) since it
holds all of them in a single (ZIP) file. The down side is that any
modifications to the cache require re-writing the entire ZIP file. This
can cause the ZIP file to become corrupted if interrupted in mid-update,
thus requiring the re-population of the cache on next application activation
(though the overhead in this case is not prohibitvely high...)-
Nested Class Summary
Nested classes/interfaces inherited from class AsynchronousFileCacheBacking
AsynchronousFileCacheBacking.AbstractCommand, AsynchronousFileCacheBacking.AsyncCommand, AsynchronousFileCacheBacking.AsynchronousFileCacheBackingCreator<T>, AsynchronousFileCacheBacking.ClearCommand, AsynchronousFileCacheBacking.InsertCommand, AsynchronousFileCacheBacking.KeyedCommand, AsynchronousFileCacheBacking.RemoveCommand, AsynchronousFileCacheBacking.UpdateIndexCommandNested classes/interfaces inherited from class AbstractIndexedFileCacheBacking
AbstractIndexedFileCacheBacking.IndexEntry -
Field Summary
FieldsFields inherited from class AsynchronousFileCacheBacking
bytesMap, exposedBytes, exposedIndex, indexFields inherited from class AbstractIndexedFileCacheBacking
EMPTY_INDEX, EMPTY_KEYS, INDEX_FILEFields inherited from class AbstractFileCacheBacking
WEAVED_CLASS_CACHE_DIRFields inherited from class AbstractCacheBacking
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final ZippedFileCacheBackingcreateBacking(File cacheDir) readClassBytes(Map<String, AbstractIndexedFileCacheBacking.IndexEntry> indexMap, File cacheDir) readZipClassBytes(File file) protected voidremoveClassBytes(String key) protected booleansyncClassBytesEntries(File dataFile, Map<String, AbstractIndexedFileCacheBacking.IndexEntry> indexMap, Map<String, byte[]> entriesMap) protected Collection<String> syncIndexEntries(File dataFile, Map<String, AbstractIndexedFileCacheBacking.IndexEntry> indexMap, Map<String, byte[]> entriesMap) protected voidwriteClassBytes(String key, byte[] bytes) static final voidwriteZipClassBytes(File file, Map<String, byte[]> entriesMap) Methods inherited from class AsynchronousFileCacheBacking
clear, createBacking, executeClearCommand, executeCommand, executeInsertCommand, executeRemoveCommand, executeUpdateIndexCommand, get, getBytesMap, getIndex, getIndexEntries, getIndexMap, postCacheCommand, put, remove, remove, toStringMethods inherited from class AbstractIndexedFileCacheBacking
createIndexEntry, getIndexFile, getKeys, readIndex, readIndex, readIndex, writeIndex, writeIndex, writeIndex, writeIndex, writeIndexMethods inherited from class AbstractFileCacheBacking
close, close, delete, getCacheDirectoryMethods inherited from class AbstractCacheBacking
crc
-
Field Details
-
ZIP_FILE
- See Also:
-
-
Constructor Details
-
ZippedFileCacheBacking
-
-
Method Details
-
getZipFile
-
createBacking
-
writeClassBytes
- Overrides:
writeClassBytesin classAbstractFileCacheBacking- Throws:
Exception
-
removeClassBytes
Description copied from class:AsynchronousFileCacheBacking- Specified by:
removeClassBytesin classAsynchronousFileCacheBacking- Parameters:
key- The key representing the class whose bytes are to be removed- Throws:
Exception- if failed to remove class bytes
-
readClassBytes
protected Map<String,byte[]> readClassBytes(Map<String, AbstractIndexedFileCacheBacking.IndexEntry> indexMap, File cacheDir) - Specified by:
readClassBytesin classAsynchronousFileCacheBacking
-
syncIndexEntries
protected Collection<String> syncIndexEntries(File dataFile, Map<String, AbstractIndexedFileCacheBacking.IndexEntry> indexMap, Map<String, byte[]> entriesMap) -
syncClassBytesEntries
-
resolveIndexMapEntry
protected AbstractIndexedFileCacheBacking.IndexEntry resolveIndexMapEntry(File cacheDir, AbstractIndexedFileCacheBacking.IndexEntry ie) - Overrides:
resolveIndexMapEntryin classAbstractIndexedFileCacheBacking
-
readZipClassBytes
- Throws:
IOException
-
writeZipClassBytes
public static final void writeZipClassBytes(File file, Map<String, byte[]> entriesMap) throws IOException- Throws:
IOException
-