|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.store.cachingtier.OnHeapCachingTier<K,V>
K
- The key typeV
- the value typepublic class OnHeapCachingTier<K,V>
An instance of this class will delegate the storage to the backing HeapCacheBackEnd.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.sf.ehcache.store.CachingTier |
---|
CachingTier.Listener<K,V> |
Constructor Summary | |
---|---|
OnHeapCachingTier(HeapCacheBackEnd<K,Object> backEnd)
A Constructor |
Method Summary | |
---|---|
void |
addListener(CachingTier.Listener<K,V> listener)
Adds a CachingTier.Listener to the cache |
void |
clear()
Clears the cache... |
void |
clearAndNotify()
Clears the cache notifying listeners |
boolean |
contains(K key)
This should go away once the stats are in As the method is only there to know what tier the key is going to be fetched from |
static OnHeapCachingTier<Object,Element> |
createOnHeapCache(Ehcache cache,
Pool onHeapPool)
Factory method |
V |
get(K key,
Callable<V> source,
boolean updateStats)
Returns the value associated with the key, or populates the mapping using the Callable instance |
Policy |
getEvictionPolicy()
queries the potential eviction policy for the heap caching tier |
int |
getInMemorySize()
Can we avoid having this somehow ? |
long |
getInMemorySizeInBytes()
CacheTier could keep hold of the PoolAccessors for each tier... |
int |
getOffHeapSize()
Can we avoid having this somehow ? |
long |
getOffHeapSizeInBytes()
CacheTier could keep hold of the PoolAccessors for each tier... |
long |
getOnDiskSizeInBytes()
CacheTier could keep hold of the PoolAccessors for each tier... |
boolean |
loadOnPut()
Returns true if values should be loaded to this cache on put. |
void |
recalculateSize(K key)
This is evil! Don't call this! |
V |
remove(K key)
Removes the mapping associated to the key passed in |
void |
setEvictionPolicy(Policy policy)
sets the eviction policy on the heap caching tier |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OnHeapCachingTier(HeapCacheBackEnd<K,Object> backEnd)
backEnd
- the HeapCacheBackEnd that will back this CachingTierMethod Detail |
---|
public static OnHeapCachingTier<Object,Element> createOnHeapCache(Ehcache cache, Pool onHeapPool)
cache
- the cache we're planning to backonHeapPool
- the pool, if any, to use
public boolean loadOnPut()
CachingTier
true
if values should be loaded to this cache on put.
This may be a dynamic decision, based for example on the occupancy of the cache.
loadOnPut
in interface CachingTier<K,V>
true
if values should be loaded on putpublic V get(K key, Callable<V> source, boolean updateStats)
CachingTier
get
in interface CachingTier<K,V>
key
- the key to look upsource
- the source to use, in the case of no mapping presentupdateStats
- true to update the stats, false otherwise
public V remove(K key)
CachingTier
remove
in interface CachingTier<K,V>
key
- the key to the mapping to remove
public void clear()
CachingTier
clear
in interface CachingTier<K,V>
public void clearAndNotify()
CachingTier
clearAndNotify
in interface CachingTier<K,V>
public void addListener(CachingTier.Listener<K,V> listener)
CachingTier
CachingTier.Listener
to the cache
addListener
in interface CachingTier<K,V>
listener
- the listener to addpublic int getInMemorySize()
CachingTier
getInMemorySize
in interface CachingTier<K,V>
public int getOffHeapSize()
CachingTier
getOffHeapSize
in interface CachingTier<K,V>
public boolean contains(K key)
CachingTier
contains
in interface CachingTier<K,V>
public long getInMemorySizeInBytes()
CachingTier
getInMemorySizeInBytes
in interface CachingTier<K,V>
public long getOffHeapSizeInBytes()
CachingTier
getOffHeapSizeInBytes
in interface CachingTier<K,V>
public long getOnDiskSizeInBytes()
CachingTier
getOnDiskSizeInBytes
in interface CachingTier<K,V>
public void recalculateSize(K key)
CachingTier
recalculateSize
in interface CachingTier<K,V>
key
- the key to perform the recalculation forpublic Policy getEvictionPolicy()
CachingTier
getEvictionPolicy
in interface CachingTier<K,V>
public void setEvictionPolicy(Policy policy)
CachingTier
setEvictionPolicy
in interface CachingTier<K,V>
policy
- the policy to use
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |