Top Description Fields Constructors Methods
org.aspectj.weaver.tools.cache

public Class ZippedFileCacheBacking

extends AsynchronousFileCacheBacking
Class Inheritance
Imports
java.io.BufferedOutputStream, .ByteArrayOutputStream, .File, .FileOutputStream, .IOException, .InputStream, .StreamCorruptedException, java.util.Collection, .Collections, .Enumeration, .Map, .TreeMap, .TreeSet, java.util.zip.ZipEntry, .ZipFile, .ZipOutputStream, org.aspectj.util.FileUtil, .LangUtil

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...)

Field Summary

Modifier and TypeField and Description
private static final AsynchronousFileCacheBacking.AsynchronousFileCacheBackingCreator<ZippedFileCacheBacking>
public static final String
private final File
Inherited from org.aspectj.weaver.tools.cache.AsynchronousFileCacheBacking:
bytesMapexposedBytesexposedIndexindex

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final ZippedFileCacheBacking
createBacking(File cacheDir)

public File
protected Map<String, byte[]>
public static final Map<String, byte[]>
protected void
removeClassBytes(String
The key representing the class whose bytes are to be removed
key
)

Implements abstract org.aspectj.weaver.tools.cache.AsynchronousFileCacheBacking.removeClassBytes.

Helper for executeRemoveCommand(RemoveCommand)
protected AbstractIndexedFileCacheBacking.IndexEntry
protected boolean
protected Collection<String>
protected void
public static final void
writeZipClassBytes(File file, Map<String, byte[]> entriesMap)

Inherited from org.aspectj.weaver.tools.cache.AsynchronousFileCacheBacking:
clearcreateBackingexecuteClearCommandexecuteCommandexecuteInsertCommandexecuteRemoveCommandexecuteUpdateIndexCommandgetgetBytesMapgetIndexgetIndexEntriesgetIndexMappostCacheCommandputremoveremovetoString

Field Detail

defaultCreatorback to summary
private static final AsynchronousFileCacheBacking.AsynchronousFileCacheBackingCreator<ZippedFileCacheBacking> defaultCreator
ZIP_FILEback to summary
public static final String ZIP_FILE
zipFileback to summary
private final File zipFile

Constructor Detail

ZippedFileCacheBackingback to summary
public ZippedFileCacheBacking(File cacheDir)

Method Detail

createBackingback to summary
public static final ZippedFileCacheBacking createBacking(File cacheDir)
getZipFileback to summary
public File getZipFile()
readClassBytesback to summary
protected Map<String, byte[]> readClassBytes(Map<String, AbstractIndexedFileCacheBacking.IndexEntry> indexMap, File cacheDir)

Implements abstract org.aspectj.weaver.tools.cache.AsynchronousFileCacheBacking.readClassBytes.

Annotations
@Override
readZipClassBytesback to summary
public static final Map<String, byte[]> readZipClassBytes(File file) throws IOException
removeClassBytesback to summary
protected void removeClassBytes(String key) throws Exception

Implements abstract org.aspectj.weaver.tools.cache.AsynchronousFileCacheBacking.removeClassBytes.

Doc from org.aspectj.weaver.tools.cache.AsynchronousFileCacheBacking.removeClassBytes.

Helper for executeRemoveCommand(RemoveCommand)

Parameters
key:String

The key representing the class whose bytes are to be removed

Annotations
@Override
Exceptions
Exception:
if failed to remove class bytes
resolveIndexMapEntryback to summary
protected AbstractIndexedFileCacheBacking.IndexEntry resolveIndexMapEntry(File cacheDir, AbstractIndexedFileCacheBacking.IndexEntry ie)

Overrides org.aspectj.weaver.tools.cache.AbstractIndexedFileCacheBacking.resolveIndexMapEntry.

Annotations
@Override
syncClassBytesEntriesback to summary
protected boolean syncClassBytesEntries(File dataFile, Map<String, AbstractIndexedFileCacheBacking.IndexEntry> indexMap, Map<String, byte[]> entriesMap)
syncIndexEntriesback to summary
protected Collection<String> syncIndexEntries(File dataFile, Map<String, AbstractIndexedFileCacheBacking.IndexEntry> indexMap, Map<String, byte[]> entriesMap)
writeClassBytesback to summary
protected void writeClassBytes(String key, byte[] bytes) throws Exception

Overrides org.aspectj.weaver.tools.cache.AbstractFileCacheBacking.writeClassBytes.

Annotations
@Override
writeZipClassBytesback to summary
public static final void writeZipClassBytes(File file, Map<String, byte[]> entriesMap) throws IOException