public abstract class AbstractEhcacheCache extends Object implements org.apache.ibatis.cache.Cache
| Modifier and Type | Field and Description |
|---|---|
protected net.sf.ehcache.Ehcache |
cache
The cache instance
|
protected static net.sf.ehcache.CacheManager |
CACHE_MANAGER
The cache manager reference.
|
protected String |
id
The cache id (namespace)
|
| Constructor and Description |
|---|
AbstractEhcacheCache(String id) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
equals(Object obj) |
String |
getId() |
Object |
getObject(Object key) |
ReadWriteLock |
getReadWriteLock() |
int |
getSize() |
int |
hashCode() |
void |
putObject(Object key,
Object value) |
Object |
removeObject(Object key) |
void |
setMaxEntriesLocalDisk(long maxEntriesLocalDisk)
Sets the maximum number elements on Disk.
|
void |
setMaxEntriesLocalHeap(long maxEntriesLocalHeap)
Sets the maximum objects to be held in memory (0 = no limit).
|
void |
setMemoryStoreEvictionPolicy(String memoryStoreEvictionPolicy)
Sets the eviction policy.
|
void |
setTimeToIdleSeconds(long timeToIdleSeconds)
Sets the time to idle for an element before it expires.
|
void |
setTimeToLiveSeconds(long timeToLiveSeconds)
Sets the time to idle for an element before it expires.
|
String |
toString() |
void |
unlock(Object key) |
protected static net.sf.ehcache.CacheManager CACHE_MANAGER
protected final String id
protected net.sf.ehcache.Ehcache cache
public AbstractEhcacheCache(String id)
id - public void clear()
clear in interface org.apache.ibatis.cache.Cachepublic String getId()
getId in interface org.apache.ibatis.cache.Cachepublic Object getObject(Object key)
getObject in interface org.apache.ibatis.cache.Cachepublic int getSize()
getSize in interface org.apache.ibatis.cache.Cachepublic void putObject(Object key, Object value)
putObject in interface org.apache.ibatis.cache.Cachepublic Object removeObject(Object key)
removeObject in interface org.apache.ibatis.cache.Cachepublic void unlock(Object key)
public ReadWriteLock getReadWriteLock()
getReadWriteLock in interface org.apache.ibatis.cache.Cachepublic void setTimeToIdleSeconds(long timeToIdleSeconds)
timeToIdleSeconds - the default amount of time to live for an element from its last accessed or modified datepublic void setTimeToLiveSeconds(long timeToLiveSeconds)
timeToLiveSeconds - the default amount of time to live for an element from its creation datepublic void setMaxEntriesLocalHeap(long maxEntriesLocalHeap)
maxElementsInMemory - The maximum number of elements in memory, before they are evicted (0 == no limit)public void setMaxEntriesLocalDisk(long maxEntriesLocalDisk)
maxElementsOnDisk - the maximum number of Elements to allow on the disk. 0 means unlimited.public void setMemoryStoreEvictionPolicy(String memoryStoreEvictionPolicy)
memoryStoreEvictionPolicy - a String representation of the policy. One of "LRU", "LFU" or "FIFO".Copyright © 2010–2016 MyBatis.org. All rights reserved.