com.googlecode.ehcache.annotations
Class RefreshingSelfPopulatingCache
java.lang.Object
net.sf.ehcache.constructs.EhcacheDecoratorAdapter
net.sf.ehcache.constructs.blocking.BlockingCache
net.sf.ehcache.constructs.blocking.SelfPopulatingCache
com.googlecode.ehcache.annotations.RefreshingSelfPopulatingCache
- All Implemented Interfaces:
- java.lang.Cloneable, Ehcache
public class RefreshingSelfPopulatingCache
- extends SelfPopulatingCache
Extension of SelfPopulatingCache that schedules a periodic call of SelfPopulatingCache.refresh() via the specified
TaskSchedulerAdapter. Also overrides refreshElement(Element, Ehcache, boolean) to allow for
asynchronous refresh of elements iff an Executor was provided to the constructor.
|
Field Summary |
protected org.slf4j.Logger |
logger
|
| Methods inherited from class net.sf.ehcache.constructs.blocking.BlockingCache |
get, getAllWithLoader, getCache, getLockForKey, getTimeoutMillis, getWithLoader, liveness, load, loadAll, put, registerCacheLoader, setTimeoutMillis, unregisterCacheLoader |
| Methods inherited from class net.sf.ehcache.constructs.EhcacheDecoratorAdapter |
acquireReadLockOnKey, acquireWriteLockOnKey, addPropertyChangeListener, bootstrap, calculateInMemorySize, calculateOffHeapSize, clearStatistics, clone, createQuery, disableDynamicFeatures, dispose, evictExpiredElements, flush, getAverageGetTime, getAverageSearchTime, getBootstrapCacheLoader, getCacheConfiguration, getCacheEventNotificationService, getCacheExceptionHandler, getCacheManager, getDiskStoreSize, getGuid, getInternalContext, getKeys, getKeysNoDuplicateCheck, getKeysWithExpiryCheck, getLiveCacheStatistics, getMemoryStoreSize, getName, getOffHeapStoreSize, getQuiet, getQuiet, getRegisteredCacheExtensions, getRegisteredCacheLoaders, getRegisteredCacheWriter, getSampledCacheStatistics, getSearchAttribute, getSearchesPerSecond, getSize, getSizeBasedOnAccuracy, getStatistics, getStatisticsAccuracy, getStatus, getWriterManager, initialise, isClusterBulkLoadEnabled, isClusterCoherent, isDisabled, isElementInMemory, isElementInMemory, isElementOnDisk, isElementOnDisk, isExpired, isKeyInCache, isNodeBulkLoadEnabled, isNodeCoherent, isReadLockedByCurrentThread, isSampledStatisticsEnabled, isSearchable, isStatisticsEnabled, isValueInCache, isWriteLockedByCurrentThread, put, putIfAbsent, putQuiet, putWithWriter, registerCacheExtension, registerCacheUsageListener, registerCacheWriter, releaseReadLockOnKey, releaseWriteLockOnKey, remove, remove, remove, remove, removeAll, removeAll, removeCacheUsageListener, removeElement, removePropertyChangeListener, removeQuiet, removeQuiet, removeWithWriter, replace, replace, setBootstrapCacheLoader, setCacheExceptionHandler, setCacheManager, setDisabled, setDiskStorePath, setName, setNodeBulkLoadEnabled, setNodeCoherent, setSampledStatisticsEnabled, setStatisticsAccuracy, setStatisticsEnabled, setTransactionManagerLookup, toString, tryReadLockOnKey, tryWriteLockOnKey, unregisterCacheExtension, unregisterCacheWriter, waitUntilClusterBulkLoadComplete, waitUntilClusterCoherent |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
logger
protected final org.slf4j.Logger logger
RefreshingSelfPopulatingCache
public RefreshingSelfPopulatingCache(Ehcache cache,
CacheEntryFactory cacheEntryFactory,
TaskSchedulerAdapter scheduler,
TaskExecutor executer,
long refreshInterval)
getRefreshInterval
public long getRefreshInterval()
scheduleRefreshTask
protected void scheduleRefreshTask()
refreshElement
protected Element refreshElement(Element element,
Ehcache backingCache,
boolean quiet)
throws java.lang.Exception
- Overrides:
refreshElement in class SelfPopulatingCache
- Throws:
java.lang.Exception
Copyright © 2011. All Rights Reserved.