public class ExpiringCache
extends java.lang.Object
Note:
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_EXPIRATION_TIME_IN_MILLIS |
static long |
DEFAULT_PURGE_INTERVAL_IN_MILLIS |
Constructor and Description |
---|
ExpiringCache()
Purge and expiration times defaulted.
|
ExpiringCache(long expirationTimeMillis,
long purgeIntervalMillis) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all entries in cache.
|
static void |
clearAll()
Clears all content for all expiring caches.
|
java.lang.Object |
get(java.lang.Object key)
Retrieves an object from the cache.
|
long |
getExpirationTimeInMillis() |
protected void |
purgeExpiredContent()
Iterate through content and purge all expiring entries.
|
void |
put(java.lang.Object key,
java.lang.Object value)
Puts an object in cache.
|
void |
remove(java.lang.Object key)
Removes an object from cache.
|
int |
size() |
public static final long DEFAULT_PURGE_INTERVAL_IN_MILLIS
public static final long DEFAULT_EXPIRATION_TIME_IN_MILLIS
public ExpiringCache()
public ExpiringCache(long expirationTimeMillis, long purgeIntervalMillis)
protected void purgeExpiredContent()
public java.lang.Object get(java.lang.Object key)
key
- public void put(java.lang.Object key, java.lang.Object value)
key
- value
- public void remove(java.lang.Object key)
key
- public int size()
public void clear()
public static void clearAll()
Warning: Should only be called for administrative and testing purposes.
public long getExpirationTimeInMillis()
Copyright © 2015 The Admin4J Project. All Rights Reserved.