|
EchoPoint API - 3.0.0b5 App Webcontainer |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectechopoint.util.collections.ExpiryCache
echopoint.util.collections.TimerExpiryCache
public class TimerExpiryCache
TimerExpiryCache is an a implementation
of ExpiryCache that can contain
objects that "expire". A shared background task will
periodically "reap" objects that have "expired".
By default, soft references are used to the cached data so that they can be reclaimed in low memory conditions regardless of whether they have expired or not.
The time-to-live and access-timeout is used to decide when an object has expired and needs to be removed from the cache.
Time-to-live is simple. Once the specified period elapses, the object is removed from the cache, regardless of how many times its been accessed.
Access-timeout is a little more complicated. Each time the object is taken from the cache, its lastAccessTime is tracked. If the access-timeout has expired (since its last access) then the object is taken from the cache.
If both the time-to-live and access-timeout is -1, then the object will never expire from the cache.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Field Summary | |
|---|---|
static long |
DEFAULT_REAPER_INTERVAL
The reaper interval is 2 minutes. |
| Fields inherited from class echopoint.util.collections.ExpiryCache |
|---|
DEFAULT_ACCESS_TIMEOUT, DEFAULT_TIME_TO_LIVE |
| Constructor Summary | |
|---|---|
TimerExpiryCache()
Constructs a default TimerExpiryCache |
|
TimerExpiryCache(long timeToLive,
long accessTimeout)
Constructs a TimerExpiryCache |
|
TimerExpiryCache(long timeToLive,
long accessTimeout,
boolean softReferences)
Constructs a TimerExpiryCache with all the parameters |
|
| Method Summary |
|---|
| Methods inherited from class echopoint.util.collections.ExpiryCache |
|---|
clear, containsKey, containsValue, entrySet, get, get, hasExpired, howManyTimesAccessed, isEmpty, isSoftReferences, keySet, onExpiredObject, put, put, put, put, putAll, remove, setAccessTimeout, setSoftReferences, setTimeToLive, size, values, whenCached, whenLastAccessed, whenVersion |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Field Detail |
|---|
public static final long DEFAULT_REAPER_INTERVAL
| Constructor Detail |
|---|
public TimerExpiryCache()
TimerExpiryCache
public TimerExpiryCache(long timeToLive,
long accessTimeout)
TimerExpiryCache
timeToLive - - the default time-to-live for a cache entryaccessTimeout - - the default access timeout for a cache entry
public TimerExpiryCache(long timeToLive,
long accessTimeout,
boolean softReferences)
TimerExpiryCache with all the parameters
timeToLive - - the default time-to-live for a cache entryaccessTimeout - - the default access timeout for a cache entrysoftReferences - - whether soft refernces are used to cached data
|
EchoPoint API - 3.0.0b5 App Webcontainer |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||