|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.constructs.EhcacheDecoratorAdapter net.sf.ehcache.constructs.refreshahead.RefreshAheadCache
public class RefreshAheadCache
A cache decorator which implements read ahead refreshing. Read ahead occurs when a cache entry is accessed prior to its expiration, and triggers a reload of the value in the background.
A significant attempt is made to ensure only one node of the cache works on a specific key at a time. There is no guarantee that every triggered refresh ahead case will be processed. As the maximum number of backlog entries is reached, refresh ahead requests will be dropped silently.
Provided the Number of threads per node * Number of nodes < the maximum backlog, only one node in the cluster will refresha given key at a time.
Field Summary |
---|
Fields inherited from class net.sf.ehcache.constructs.EhcacheDecoratorAdapter |
---|
underlyingCache |
Constructor Summary | |
---|---|
RefreshAheadCache(Ehcache adaptedCache,
RefreshAheadCacheConfiguration refreshConfig)
Create a Refresh Ahead Cache Adaptor with the specified configuration. |
Method Summary | |
---|---|
static Set<ExtendedStatistics.Statistic<Number>> |
findBacklogStatistic(Ehcache cache)
Find backlog statistic. |
static Set<ExtendedStatistics.Statistic<Number>> |
findDroppedStatistic(Ehcache cache)
Find dropped statistic. |
static Set<ExtendedStatistics.Statistic<Number>> |
findOfferStatistic(Ehcache cache)
Find offer statistic. |
static Set<ExtendedStatistics.Statistic<Number>> |
findProcessedStatistic(Ehcache cache)
Find processed statistic. |
static Set<ExtendedStatistics.Statistic<Number>> |
findRefreshedStatistic(Ehcache cache)
Find refreshed counter statistic. |
Element |
get(Object key)
Gets an element from the cache. |
Element |
get(Serializable key)
Gets an element from the cache. |
long |
getBacklogCount()
Gets backlog count. |
long |
getDroppedCount()
Gets dropped count. |
String |
getName()
Gets the cache name. |
long |
getOfferCount()
Gets offer count. |
long |
getProcessedCount()
Gets processed count. |
long |
getRefreshSuccessCount()
number of refreshes processed locally. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RefreshAheadCache(Ehcache adaptedCache, RefreshAheadCacheConfiguration refreshConfig)
adaptedCache
- refreshConfig
- Method Detail |
---|
public Element get(Object key) throws IllegalStateException, CacheException
EhcacheDecoratorAdapter
Ehcache.getQuiet(Object)
to peek into the Element to see its last access time with get
get
in interface Ehcache
get
in class EhcacheDecoratorAdapter
key
- an Object value
IllegalStateException
- if the cache is not Status.STATUS_ALIVE
CacheException
Ehcache.isExpired(net.sf.ehcache.Element)
public Element get(Serializable key) throws IllegalStateException, CacheException
EhcacheDecoratorAdapter
Ehcache.getQuiet(Object)
to peak into the Element to see its last access time with get
get
in interface Ehcache
get
in class EhcacheDecoratorAdapter
key
- a serializable value
IllegalStateException
- if the cache is not Status.STATUS_ALIVE
CacheException
Ehcache.isExpired(net.sf.ehcache.Element)
public long getRefreshSuccessCount()
public String getName()
EhcacheDecoratorAdapter
getName
in interface Ehcache
getName
in class EhcacheDecoratorAdapter
public long getOfferCount()
public long getDroppedCount()
public long getProcessedCount()
public long getBacklogCount()
public static Set<ExtendedStatistics.Statistic<Number>> findRefreshedStatistic(Ehcache cache)
cache
- the cache this statistic is attached to.
public static Set<ExtendedStatistics.Statistic<Number>> findOfferStatistic(Ehcache cache)
cache
- the cache this statistic is attached to.
public static Set<ExtendedStatistics.Statistic<Number>> findDroppedStatistic(Ehcache cache)
cache
- the cache
public static Set<ExtendedStatistics.Statistic<Number>> findProcessedStatistic(Ehcache cache)
cache
- the cache
public static Set<ExtendedStatistics.Statistic<Number>> findBacklogStatistic(Ehcache cache)
cache
- the cache
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |