com.arsdigita.acs
Class MemoizeCache
java.lang.Object
|
+--com.arsdigita.acs.MemoizeCache
- public class MemoizeCache
- extends 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).
Method Summary |
(package private) static void |
()
|
static void |
cache(String key,
Object value)
Cache a value with no expiration time--i.e., forever |
static void |
cache(String key,
Object value,
int dur)
Cache a value with a duration, in seconds. |
static void |
flush(String key)
Flush a value from the cache. |
static Object |
lookup(String key)
Returns the cached value for key ; returns null if
key is unmapped or if the mapping has expired. |
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MemoizeCache
public MemoizeCache()
static void ()
lookup
public static Object lookup(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(String key)
- Flush a value from the cache.
cache
public static void cache(String key,
Object value)
- Cache a value with no expiration time--i.e., forever
cache
public static void cache(String key,
Object value,
int dur)
- Cache a value with a duration, in seconds.
main
public static void main(String[] args)