com.arsdigita.acs
Class MemoizeCache
java.lang.Object
|
+--com.arsdigita.acs.MemoizeCache
- public class MemoizeCache
- extends java.lang.Object
Cache for memoized values. A value can be memoized with a time limit,
after which it expires.
All the public methods and private members of MemoizeCache are static,
since there should be only one instance of the cache for each web
service instance (i.e., one per webapp context).
|
Field Summary |
static java.lang.String |
cvsId
|
|
Method Summary |
static void |
cache(java.lang.String key,
java.lang.Object value)
Cache a value with no expiration time--i.e., forever |
static void |
cache(java.lang.String key,
java.lang.Object value,
int dur)
Cache a value with a duration, in seconds. |
static void |
flush(java.lang.String key)
Flush a value from the cache. |
static java.lang.Object |
lookup(java.lang.String key)
Returns the cached value for key; returns null if
key is unmapped or if the mapping has expired. |
static void |
main(java.lang.String[] args)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cvsId
public static final java.lang.String cvsId
MemoizeCache
public MemoizeCache()
lookup
public static java.lang.Object lookup(java.lang.String key)
- Returns the cached value for
key; returns null if
key is unmapped or if the mapping has expired.
flush
public static void flush(java.lang.String key)
- Flush a value from the cache.
cache
public static void cache(java.lang.String key,
java.lang.Object value)
- Cache a value with no expiration time--i.e., forever
cache
public static void cache(java.lang.String key,
java.lang.Object value,
int dur)
- Cache a value with a duration, in seconds.
main
public static void main(java.lang.String[] args)