public class ByReferenceHeapStorageImpl extends Object implements CacheStorage
| Modifier and Type | Class and Description |
|---|---|
static class |
ByReferenceHeapStorageImpl.Provider |
CacheStorage.EntryFilter, CacheStorage.EntryVisitor, CacheStorage.MultiThreadedContext, CacheStorage.VisitContext| Constructor and Description |
|---|
ByReferenceHeapStorageImpl() |
| 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 |
open(CacheStorageContext ctx,
StorageConfiguration<Void> cfg) |
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.
|
public ByReferenceHeapStorageImpl()
public void open(CacheStorageContext ctx, StorageConfiguration<Void> cfg)
public StorageEntry get(Object key) throws Exception
CacheStorageDepending on the cache configuration, an exception on get is not severe. The cache will try other sources or return null.
get in interface CacheStorageExceptionpublic void put(StorageEntry e) throws Exception
CacheStorageput in interface CacheStorageIOException - may be thrown if hope is lostExceptionpublic boolean remove(Object key) throws Exception
remove in interface CacheStorageExceptionpublic boolean contains(Object key) throws Exception
CacheStorageAn exception on contains is not severe. The cache will try other sources or return null.
contains in interface CacheStorageExceptionpublic void clear() throws Exception
CacheStorageclear in interface CacheStorageExceptionpublic void close() throws Exception
CacheStorageclose in interface CacheStorageExceptionpublic void visit(CacheStorage.VisitContext ctx, CacheStorage.EntryFilter f, CacheStorage.EntryVisitor v) throws Exception
CacheStoragePurgeableStorage 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.visit in interface CacheStorageExceptionpublic int getEntryCount()
getEntryCount in interface CacheStoragecache2k API documentation. Copyright © 2000–2015 headissue GmbH, Munich.