|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.anthonyeden.lib.cache.AbstractCache
com.anthonyeden.lib.cache.InMemoryCache
Cache implementation which stores the cached values in memory.
| Field Summary |
| Fields inherited from class com.anthonyeden.lib.cache.AbstractCache |
DEFAULT_TTL, ttl |
| Constructor Summary | |
InMemoryCache()
Construct a new InMemoryCache. |
|
| Method Summary | |
java.lang.Object |
get(java.lang.Object key)
Get the value for the given key from the cache. |
void |
loadConfiguration(Configuration configuration)
Load the Cache's configuration from the given Configuration object. |
void |
put(java.lang.Object key,
java.lang.Object value)
Insert a value into the cache. |
void |
put(java.lang.Object key,
java.lang.Object value,
int ttl)
Insert a value into the cache with the specified time to live. |
void |
remove(java.lang.Object key)
Remove a value from the cache. |
| Methods inherited from class com.anthonyeden.lib.cache.AbstractCache |
getTTL, isExpired, setTTL, setTTL |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public InMemoryCache()
| Method Detail |
public java.lang.Object get(java.lang.Object key)
key - The key
public void put(java.lang.Object key,
java.lang.Object value)
key - The keyvalue - The value
public void put(java.lang.Object key,
java.lang.Object value,
int ttl)
key - The keyvalue - The valuettl - The time to livepublic void remove(java.lang.Object key)
key - The key
public void loadConfiguration(Configuration configuration)
throws ConfigurationException
loadConfiguration in interface CacheloadConfiguration in class AbstractCacheconfiguration - The Configuration object
ConfigurationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||