Top Description Inners Methods
net.sf.ehcache.store

public Interface CachingTier<K, V>

Known Direct Implementers
net.sf.ehcache.store.cachingtier.OnHeapCachingTier
Imports
java.util.concurrent.Callable

This interface is to be implemented by CachingTier that sit above the AuthoritativeTier. An important contract here is that a value being faulted in get is to be entirely faulted in before it can become an eviction candidate, i.e. this cache can never evict mappings being faulted in
Author
Alex Snaps

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
CachingTier.Listener<K, V>

A listener that will be notified when eviction of a mapping happens

Method Summary

Modifier and TypeMethod and Description
public void
addListener(CachingTier.Listener<K, V>
the listener to add
listener
)

Adds a Listener to the cache

public void
clear()

Clears the cache...

public void
clearAndNotify()

Clears the cache notifying listeners

public boolean
contains(K key)

Deprecated
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
public V

Returns:

the value mapped to the key
get
(K
the key to look up
key
,
Callable<V>
the source to use, in the case of no mapping present
source
,
boolean
true to update the stats, false otherwise
updateStats
)

Returns the value associated with the key, or populates the mapping using the Callable instance

public Policy

Returns:

the policy
getEvictionPolicy
()

Deprecated
queries the potential eviction policy for the heap caching tier
public int

Returns:

the count of entries held in heap
getInMemorySize
()

Deprecated
Can we avoid having this somehow ?
public long
getInMemorySizeInBytes()

Deprecated
CacheTier could keep hold of the PoolAccessors for each tier...
public int

Returns:

the count of entries held off heap
getOffHeapSize
()

Deprecated
Can we avoid having this somehow ?
public long
getOffHeapSizeInBytes()

Deprecated
CacheTier could keep hold of the PoolAccessors for each tier...
public long
getOnDiskSizeInBytes()

Deprecated
CacheTier could keep hold of the PoolAccessors for each tier...
public boolean

Returns:

true if values should be loaded on put
loadOnPut
()

Returns true if values should be loaded to this cache on put.

public void
recalculateSize(K
the key to perform the recalculation for
key
)

Deprecated
This is evil!
public V

Returns:

the value removed, null if none
remove
(K
the key to the mapping to remove
key
)

Removes the mapping associated to the key passed in

public void
setEvictionPolicy(Policy
the policy to use
policy
)

Deprecated
sets the eviction policy on the heap caching tier

Method Detail

addListenerback to summary
public void addListener(CachingTier.Listener<K, V> listener)

Adds a Listener to the cache

Parameters
listener:CachingTier.Listener<K, V>

the listener to add

clearback to summary
public void clear()

Clears the cache... Doesn't notify any listeners

clearAndNotifyback to summary
public void clearAndNotify()

Clears the cache notifying listeners

containsback to summary
public boolean contains(K key)

Deprecated

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

Annotations
@Deprecated
getback to summary
public V get(K key, Callable<V> source, boolean updateStats)

Returns the value associated with the key, or populates the mapping using the Callable instance

Parameters
key:K

the key to look up

source:Callable<V>

the source to use, in the case of no mapping present

updateStats:boolean

true to update the stats, false otherwise

Returns:V

the value mapped to the key

getEvictionPolicyback to summary
public Policy getEvictionPolicy()

Deprecated

queries the potential eviction policy for the heap caching tier

Returns:Policy

the policy

Annotations
@Deprecated
getInMemorySizeback to summary
public int getInMemorySize()

Deprecated

Can we avoid having this somehow ?

Returns:int

the count of entries held in heap

Annotations
@Deprecated
getInMemorySizeInBytesback to summary
public long getInMemorySizeInBytes()

Deprecated

CacheTier could keep hold of the PoolAccessors for each tier... But what about non pooled resources ?

Annotations
@Deprecated
getOffHeapSizeback to summary
public int getOffHeapSize()

Deprecated

Can we avoid having this somehow ?

Returns:int

the count of entries held off heap

Annotations
@Deprecated
getOffHeapSizeInBytesback to summary
public long getOffHeapSizeInBytes()

Deprecated

CacheTier could keep hold of the PoolAccessors for each tier... But what about non pooled resources ?

Annotations
@Deprecated
getOnDiskSizeInBytesback to summary
public long getOnDiskSizeInBytes()

Deprecated

CacheTier could keep hold of the PoolAccessors for each tier... But what about non pooled resources ?

Annotations
@Deprecated
loadOnPutback to summary
public boolean loadOnPut()

Returns 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.

Returns:boolean

true if values should be loaded on put

recalculateSizeback to summary
public void recalculateSize(K key)

Deprecated

This is evil! Don't call this!

Parameters
key:K

the key to perform the recalculation for

Annotations
@Deprecated
removeback to summary
public V remove(K key)

Removes the mapping associated to the key passed in

Parameters
key:K

the key to the mapping to remove

Returns:V

the value removed, null if none

setEvictionPolicyback to summary
public void setEvictionPolicy(Policy policy)

Deprecated

sets the eviction policy on the heap caching tier

Parameters
policy:Policy

the policy to use

Annotations
@Deprecated
net.sf.ehcache.store back to summary

public Interface CachingTier.Listener<K, V>


A listener that will be notified when eviction of a mapping happens

Method Summary

Modifier and TypeMethod and Description
public void
evicted(K
the key evicted
key
,
V
the value evicted
value
)

Invoked when a mapping is evicted.

Method Detail

evictedback to summary
public void evicted(K key, V value)

Invoked when a mapping is evicted.

Parameters
key:K

the key evicted

value:V

the value evicted