AsyncCommands
to signal to a background thread various actions required to "synchronize"
the in-memory cache with the persisted copy. Whenever there is a cache miss
from the get(CachedClassReference, byte[]) call, the weaver issues a
put(CachedClassEntry, byte[]) call. This call has 2 side-effects:
get(CachedClassReference, byte[])
will not return the mapped value.
AsyncCommand is posted to the background
thread so that the newly mapped value will be persisted (eventually)
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | |
| public static interface | AsynchronousFileCacheBacking.AsyncCommand
Represents an asynchronous command that can be sent to the
|
| public static interface | |
| public static class | |
| public static class | |
| public abstract static class | AsynchronousFileCacheBacking.KeyedCommand
Base class for |
| public static class | |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| protected final Map | |
| private static final BlockingQueue | |
| private static Future | |
| private static final ExecutorService | |
| protected final Map | |
| protected final Map | |
| protected final Map |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| protected static final <T extends AsynchronousFileCacheBacking> T | createBacking(File cacheDir, AsynchronousFileCacheBacking.
|
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public CachedClassEntry | get(CachedClassReference
entry to retrieve ref, byte[] Pre-weaving class bytes - required in order to
ensure that the cached entry refers to the same original class originalBytes)Implements org. |
| public Map | |
| protected Map | getIndex()
Implements abstract org. |
| public List | |
| public Map | |
| public static final boolean | |
| public void | put(CachedClassEntry
key of the entry entry, byte[] Pre-weaving class bytes - required in order to
ensure that the cached entry refers to the same original class originalBytes)Implements org. |
| protected abstract Map | |
| public void | remove(CachedClassReference ref)
Implements org. |
| protected AbstractIndexedFileCacheBacking. | |
| protected abstract void | removeClassBytes(String
The key representing the class whose bytes are to be removed key)Helper for |
| public String |
| bytesMap | back to summary |
|---|---|
| protected final Map<String, byte[]> bytesMap | |
| commandsQ | back to summary |
|---|---|
| private static final BlockingQueue<AsynchronousFileCacheBacking. | |
| commandsRunner | back to summary |
|---|---|
| private static Future<?> commandsRunner | |
| execService | back to summary |
|---|---|
| private static final ExecutorService execService | |
| exposedBytes | back to summary |
|---|---|
| protected final Map<String, byte[]> exposedBytes | |
| exposedIndex | back to summary |
|---|---|
| protected final Map<String, AbstractIndexedFileCacheBacking. | |
| index | back to summary |
|---|---|
| protected final Map<String, AbstractIndexedFileCacheBacking. | |
| AsynchronousFileCacheBacking | back to summary |
|---|---|
| protected AsynchronousFileCacheBacking(File cacheDir) | |
| clear | back to summary |
|---|---|
| public void clear() Implements org. Doc from org. Clear the entire cache | |
| createBacking | back to summary |
|---|---|
| protected static final <T extends AsynchronousFileCacheBacking> T createBacking(File cacheDir, AsynchronousFileCacheBacking. | |
| executeClearCommand | back to summary |
|---|---|
| protected void executeClearCommand() throws Exception | |
| executeCommand | back to summary |
|---|---|
| protected void executeCommand(AsynchronousFileCacheBacking. | |
| executeInsertCommand | back to summary |
|---|---|
| protected void executeInsertCommand(AsynchronousFileCacheBacking. | |
| executeRemoveCommand | back to summary |
|---|---|
| protected void executeRemoveCommand(AsynchronousFileCacheBacking. | |
| executeUpdateIndexCommand | back to summary |
|---|---|
| protected void executeUpdateIndexCommand() throws Exception | |
| get | back to summary |
|---|---|
| public CachedClassEntry get(CachedClassReference ref, byte[] originalBytes) Implements org. Doc from org. Get a cache entry
| |
| getBytesMap | back to summary |
|---|---|
| public Map | |
| getIndex | back to summary |
|---|---|
| protected Map Implements abstract org.
| |
| getIndexEntries | back to summary |
|---|---|
| public List | |
| getIndexMap | back to summary |
|---|---|
| public Map | |
| postCacheCommand | back to summary |
|---|---|
| public static final boolean postCacheCommand(AsynchronousFileCacheBacking. | |
| put | back to summary |
|---|---|
| public void put(CachedClassEntry entry, byte[] originalBytes) Implements org. Doc from org. Put an entry in the cache
| |
| readClassBytes | back to summary |
|---|---|
| protected abstract Map | |
| remove | back to summary |
|---|---|
| public void remove(CachedClassReference ref) Implements org. Doc from org. Remove an entry from the cache | |
| remove | back to summary |
|---|---|
| protected AbstractIndexedFileCacheBacking. | |
| removeClassBytes | back to summary |
|---|---|
| protected abstract void removeClassBytes(String key) throws Exception Helper for | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| private final AsynchronousFileCacheBacking |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final AsynchronousFileCacheBacking | |
| public String |
| cache | back to summary |
|---|---|
| private final AsynchronousFileCacheBacking cache | |
| AbstractCommand | back to summary |
|---|---|
| protected AbstractCommand(AsynchronousFileCacheBacking backing) | |
| getCache | back to summary |
|---|---|
| public final AsynchronousFileCacheBacking getCache() Implements org.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
AsynchronousFileCacheBacking instance to be executed
on it asynchronously
| Modifier and Type | Method and Description |
|---|---|
| public AsynchronousFileCacheBacking | Returns: TheAsynchronousFileCacheBacking on which
this command is supposed to be executed
|
| getCache | back to summary |
|---|---|
public AsynchronousFileCacheBacking getCache()
| |
| create | back to summary |
|---|---|
| public T create(File cacheDir) | |
| Access | Constructor and Description |
|---|---|
| public |
| ClearCommand | back to summary |
|---|---|
| public ClearCommand(AsynchronousFileCacheBacking cache) | |
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final byte[] |
| bytes | back to summary |
|---|---|
| private final byte[] bytes | |
| InsertCommand | back to summary |
|---|---|
| public InsertCommand(AsynchronousFileCacheBacking cache, String keyValue, byte[] classBytes) | |
| getClassBytes | back to summary |
|---|---|
| public final byte[] getClassBytes() | |
AbstractCommands that refer to a cache key
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final String | |
| public String | toString()
Overrides org. |
| key | back to summary |
|---|---|
| private final String key | |
| KeyedCommand | back to summary |
|---|---|
| protected KeyedCommand(AsynchronousFileCacheBacking cache, String keyValue) | |
| getKey | back to summary |
|---|---|
| public final String getKey() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object. | |
| Access | Constructor and Description |
|---|---|
| public |
| RemoveCommand | back to summary |
|---|---|
| public RemoveCommand(AsynchronousFileCacheBacking cache, String keyValue) | |
| Access | Constructor and Description |
|---|---|
| public |
| UpdateIndexCommand | back to summary |
|---|---|
| public UpdateIndexCommand(AsynchronousFileCacheBacking cache) | |