public class EHCache2 extends AbstractCache
Constructor and Description |
---|
EHCache2(int cacheSizeMB,
java.lang.String path) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the cache
|
void |
end()
Call it when you're done with the cache (release resources and cleanup)
|
java.lang.Object |
get(java.lang.Integer key)
Get an object from cache from its key
|
java.util.Collection<java.lang.Integer> |
getAllKeys()
Get all element keys in the cache
|
java.lang.String |
getName() |
net.sf.ehcache.statistics.StatisticsGateway |
getStats() |
boolean |
isEnabled()
Returns true if the cache is enabled
|
boolean |
isInCache(java.lang.Integer key)
Test presence of a key in the cache
|
boolean |
isOnDiskCache(java.lang.Integer key)
Test presence of a key in the cache
|
boolean |
isOnMemoryCache(java.lang.Integer key)
Test presence of a key in the cache
|
void |
remove(java.lang.Integer key)
Remove an object from the cache from its key
|
void |
set(java.lang.Integer key,
java.lang.Object object,
boolean eternal)
Put an object in cache with its associated key
|
long |
usedDisk()
Return used disk space for cache (in bytes)
|
long |
usedMemory()
Return used memory for cache (in bytes)
|
getProfilingTime, resetProfiling, setProfiling
public EHCache2(int cacheSizeMB, java.lang.String path)
public boolean isEnabled()
AbstractCache
isEnabled
in class AbstractCache
public long usedMemory()
AbstractCache
usedMemory
in class AbstractCache
public long usedDisk()
AbstractCache
usedDisk
in class AbstractCache
public boolean isOnMemoryCache(java.lang.Integer key)
AbstractCache
isOnMemoryCache
in class AbstractCache
public boolean isOnDiskCache(java.lang.Integer key)
AbstractCache
isOnDiskCache
in class AbstractCache
public boolean isInCache(java.lang.Integer key)
AbstractCache
isInCache
in class AbstractCache
public java.util.Collection<java.lang.Integer> getAllKeys() throws CacheException
AbstractCache
getAllKeys
in class AbstractCache
CacheException
public java.lang.Object get(java.lang.Integer key) throws CacheException
AbstractCache
get
in class AbstractCache
CacheException
public void set(java.lang.Integer key, java.lang.Object object, boolean eternal) throws CacheException
AbstractCache
set
in class AbstractCache
CacheException
public void clear() throws CacheException
AbstractCache
clear
in class AbstractCache
CacheException
public void remove(java.lang.Integer key) throws CacheException
AbstractCache
remove
in class AbstractCache
CacheException
public net.sf.ehcache.statistics.StatisticsGateway getStats()
public void end()
AbstractCache
end
in class AbstractCache
public java.lang.String getName()
getName
in class AbstractCache