public interface CacheCore
Cache
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Callback function used, when the cache is no longer needed.
|
void |
flushAll()
Flushes the complete cache
|
void |
flushEntry(java.io.Serializable key)
Flushes a single entry of the cache
|
void |
flushGroup(java.lang.String group)
Flushes the entries of the cache that belong to the given group
|
java.util.Set<java.io.Serializable> |
getEntryKeys()
Returns a set of the keys of the currently stored entries
May throw a CacheException if this is not supported
|
long |
getMaxSize()
Returns the maximum number of entries allowed in the cache
|
long |
getSize()
Returns the current number of entries in the cache
|
int |
getUtilisation()
Returns a percent value, describing how many cache retrieval operations actually could return a cache value.
|
void |
init(java.lang.String name,
int capacity,
java.util.Map<java.lang.String,java.lang.Object> params)
Initialisation method.
|
java.lang.Object |
readEntry(java.io.Serializable key)
Reads a cache entry.
|
void |
touchEntry(java.io.Serializable key)
Mark an existing cache entry as updated, so the eviction policy regards it as new
This method does nothing if there is no entry under the given key.
|
void |
writeEntry(java.io.Serializable key,
java.lang.Object obj,
CacheEntryParams params)
Writes a cache entry
|
void init(java.lang.String name, int capacity, java.util.Map<java.lang.String,java.lang.Object> params) throws CacheException
name
- An application-wide unique name of the cache (if the implementation needs this)capacity
- Maximum capacity (entries) of the cacheparams
- Optional parameters. Keys are Constants PARAM_... at class Cache
java.lang.Exception
CacheException
void destroy() throws CacheException
CacheException
void writeEntry(java.io.Serializable key, java.lang.Object obj, CacheEntryParams params) throws CacheException
key
- The key of the entryobj
- The entry valueparams
- Parameters for the cache entry to writeCacheException
java.lang.Object readEntry(java.io.Serializable key) throws CacheException
key
- The key of the cache entryCacheException
void touchEntry(java.io.Serializable key) throws CacheException
key
- The key of the cache entryCacheException
void flushEntry(java.io.Serializable key) throws CacheException
key
- The cache keyCacheException
void flushGroup(java.lang.String group) throws CacheException
group
- The group to be flushedCacheException
void flushAll() throws CacheException
CacheException
long getSize() throws CacheException
CacheException
long getMaxSize() throws CacheException
CacheException
int getUtilisation() throws CacheException
CacheException
java.util.Set<java.io.Serializable> getEntryKeys() throws CacheException
CacheException