Constructor and Description |
---|
EHCacheCore() |
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
|
static net.sf.ehcache.CacheManager |
getCacheManager() |
net.sf.ehcache.Cache |
getEhcache() |
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
|
public static net.sf.ehcache.CacheManager getCacheManager()
public void destroy() throws CacheException
CacheCore
destroy
in interface CacheCore
CacheException
public void flushAll() throws CacheException
CacheCore
flushAll
in interface CacheCore
CacheException
public void flushEntry(java.io.Serializable key) throws CacheException
CacheCore
flushEntry
in interface CacheCore
key
- The cache keyCacheException
public void flushGroup(java.lang.String group)
CacheCore
flushGroup
in interface CacheCore
group
- The group to be flushedpublic long getMaxSize()
CacheCore
getMaxSize
in interface CacheCore
public long getSize() throws CacheException
CacheCore
getSize
in interface CacheCore
CacheException
public int getUtilisation()
CacheCore
getUtilisation
in interface CacheCore
public void init(java.lang.String name, int capacity, java.util.Map<java.lang.String,java.lang.Object> params) throws CacheException
CacheCore
init
in interface CacheCore
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
CacheException
public java.lang.Object readEntry(java.io.Serializable key)
CacheCore
public void writeEntry(java.io.Serializable key, java.lang.Object obj, CacheEntryParams params)
CacheCore
writeEntry
in interface CacheCore
key
- The key of the entryobj
- The entry valueparams
- Parameters for the cache entry to writepublic java.util.Set<java.io.Serializable> getEntryKeys()
CacheCore
getEntryKeys
in interface CacheCore
public void touchEntry(java.io.Serializable key) throws CacheException
CacheCore
touchEntry
in interface CacheCore
key
- The key of the cache entryCacheException
public net.sf.ehcache.Cache getEhcache()