public class LRUCache<K,V> extends SimpleCache<K,V>
AbstractCache
caching values using Cache
GenericService.StartCommand, GenericService.StopCommand
CLASS_VERSION
mLogger, state
Modifier and Type | Method and Description |
---|---|
Map<K,CacheItem<K,V>> |
getCacheItems() |
Iterable<K> |
getKeys()
Returns all the keys in the cache
|
int |
getSize()
Returns the current size of the cache.
|
protected void |
startService()
Is called by
AbstractNurseryService.doStartService() when the NurseryService is being started. |
protected void |
stopService()
Is called by
AbstractNurseryService.doStopService() when the service is being shut down. |
addObject, expireObject, flushCache, getAdds, getAges, getAverageIdleTimeSinceLastThrow, getAverageIdleTimeWhenThrown, getCacheStatistics, getCacheType, getClears, getExpires, getHitRatio, getHits, getLastThrow, getMaxSize, getMisses, getObject, getPushes, getRemoves, getReport, getStatistic, getStatisticKeys, getTimeSinceLastThrow, getTotalTime, getValidSeconds, hasObject, remove, reset, setCacheType, setMaxSize, setValidSeconds, toString
doStartService, doStopService, stopIdleService
assertServiceRunning, getServiceDescription, getServiceMessage, getServiceState, isServiceEnabled, isServiceFailed, isServiceIdle, isServiceRunning, isServiceShutdownFailed, isServiceStopped, setServiceDescription, setServiceEnabled, start, stop, validateIsTrue, validateNotNull
protected void startService() throws Exception
AbstractNurseryService
Is called by AbstractNurseryService.doStartService()
when the NurseryService
is being started. Exceptions thrown by this
method are logged by AbstractNurseryService.doStartService()
.
Subclasses must implement this method to bootstrap the service.
startService
in class AbstractCache<K,V>
Exception
- when something goes wrong during startup. GenericService.isServiceRunning()
will return false
and GenericService.isServiceFailed()
will return true
.IllegalArgumentException
- when the configuration of the service
is invalid. GenericService.isServiceRunning()
will return false
and GenericService.isServiceFailed()
will return true
.IllegalStateException
- when this service is in the wrong state for startup. Used to signal to AbstractNurseryService.doStartService()
that it is OK to try to starting
this service
later. GenericService.isServiceRunning()
returns false
and GenericService.isServiceIdle()
returns true
.AbstractNurseryService.doStartService()
protected void stopService() throws Exception
AbstractNurseryService
Is called by AbstractNurseryService.doStopService()
when the service
is being shut down. Exceptions thrown by this
method are logged by AbstractNurseryService.doStopService()
.
Subclasses must implement this method to shut down the service.
stopService
in class AbstractCache<K,V>
IllegalStateException
- when this service is in the wrong state for shutdown. Used to signal to AbstractNurseryService.doStopService()
that
it is OK to try stopping this service
later. GenericService.isServiceRunning()
returns true
.Exception
- when something goes during shutdown. GenericService.isServiceRunning()
returns false
and
GenericService.isServiceShutdownFailed()
returns true
.AbstractNurseryService.doStopService()
public Iterable<K> getKeys()
Cache
public Map<K,CacheItem<K,V>> getCacheItems()
getCacheItems
in class SimpleCache<K,V>
© 1998- 2018 Stibo DX