org.aspectj.weaver.tools.cache
Interface CacheBacking

All Known Implementing Classes:
AbstractCacheBacking, AbstractFileCacheBacking, AbstractIndexedFileCacheBacking, AsynchronousFileCacheBacking, DefaultFileCacheBacking, FlatFileCacheBacking, ZippedFileCacheBacking

public interface CacheBacking

Interface for the backing to the cache; usually a file, but could be an in-memory backing for testing.

aspectj and jvmti provide no suitable guarantees on locking for class redefinitions, so every implementation must have a some locking mechanism to prevent invalid reads.


Method Summary
 void clear()
          Clear the entire cache
 CachedClassEntry get(CachedClassReference ref, byte[] originalBytes)
          Get a cache entry
 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
 void remove(CachedClassReference ref)
          Remove an entry from the cache
 

Method Detail

getKeys

java.lang.String[] getKeys(java.lang.String regex)
Return a list of keys which match the given regex.

Parameters:
regex -
Returns:

remove

void remove(CachedClassReference ref)
Remove an entry from the cache

Parameters:
ref -

clear

void clear()
Clear the entire cache


get

CachedClassEntry get(CachedClassReference ref,
                     byte[] originalBytes)
Get a cache entry

Parameters:
ref - entry to retrieve
originalBytes - Pre-weaving class bytes - required in order to ensure that the cached entry refers to the same original class
Returns:
the cached bytes or null, if the entry does not exist

put

void put(CachedClassEntry entry,
         byte[] originalBytes)
Put an entry in the cache

Parameters:
entry - key of the entry
originalBytes - Pre-weaving class bytes - required in order to ensure that the cached entry refers to the same original class