public interface CacheStorage
| Modifier and Type | Interface and Description |
|---|---|
static interface |
CacheStorage.EntryFilter |
static interface |
CacheStorage.EntryVisitor |
static interface |
CacheStorage.MultiThreadedContext |
static interface |
CacheStorage.VisitContext |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove all entries from the cache and free resources.
|
void |
close()
Free all resources and stop operations immediately.
|
boolean |
contains(Object key)
Returns true if there is a mapping for the key.
|
StorageEntry |
get(Object key)
Retrieve the entry from the storage.
|
int |
getEntryCount() |
void |
put(StorageEntry e)
Stores the entry in the storage.
|
boolean |
remove(Object key) |
void |
visit(CacheStorage.VisitContext ctx,
CacheStorage.EntryFilter f,
CacheStorage.EntryVisitor v)
Iterate over all stored entries and call the entry visitor.
|
StorageEntry get(Object key) throws Exception
Depending on the cache configuration, an exception on get is not severe. The cache will try other sources or return null.
Exceptionvoid put(StorageEntry e) throws Exception
IOException - may be thrown if hope is lostExceptionboolean contains(Object key) throws Exception
An exception on contains is not severe. The cache will try other sources or return null.
Exceptionvoid clear() throws Exception
Exceptionvoid close() throws Exception
Exceptionvoid visit(CacheStorage.VisitContext ctx, CacheStorage.EntryFilter f, CacheStorage.EntryVisitor v) throws Exception
PurgeableStorage is not
implemented, returning expired entries is a must, to support the generic purge
algorithm.
If the ExecutorService is used, the method may return immediately without
the waiting for all threads to finish. This is done by the caller, when needed.Exceptionint getEntryCount()
cache2k API documentation. Copyright © 2000–2015 headissue GmbH, Munich.