public abstract class ScheduledCacheEngine extends AbstractCacheEngine implements Runnable
This abstract engine is able to clear its cache in a particular interval.
AbstractCacheEngine.CacheResult
Constructor and Description |
---|
ScheduledCacheEngine(int timeToLiveSeconds,
Boolean cache,
Boolean bestEffort)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
clearCache()
Clears this cache.
|
void |
run() |
void |
setTimeToLive(int timeToLiveSeconds)
Schedules the time to live for this cache.
|
getEngineType, getFromCache, internalParse, parse, putToCache, removeFromCache, works
parse, runChains
public final void setTimeToLive(int timeToLiveSeconds)
Schedules the time to live for this cache. If the specified value is a positive number, a thread will be executed at the specified interval to clear the cache. Otherwise, any scheduled operation will be canceled.
timeToLiveSeconds
- new time to live of cache in secondsprotected abstract void clearCache()
Clears this cache.
Copyright © 2012-2015. All Rights Reserved.