|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.spy.SpyObject
net.spy.cache.SpyCache
public class SpyCache
Spy in-memory cache object.
If the system properties net.spy.cache.multi.addr and net.spy.cache.multi.port are both set, requests may be sent as ASCII strings on that multicast group and port to clear cache entries based on prefix.
| Constructor Summary | |
|---|---|
protected |
SpyCache()
Construct a new instance of SpyCache. |
| Method Summary | |
|---|---|
Object |
get(String key)
Get an object from the cache, returns null if there's not a valid object in the cache with this key. |
static SpyCache |
getInstance()
Get the instance of SpyCache. |
void |
setDelegate(CacheDelegate del)
Set the delegate for this SpyCache. |
static void |
shutdown()
Shut down the cache. |
void |
store(String key,
Cachable value)
Store a Cachable object in the cache. |
void |
store(String key,
Object value,
long cacheTime)
Store an object in the cache with the specified timeout. |
void |
uncache(String key)
Manually remove an object from the cache. |
void |
uncacheLike(String keystart)
Remove all objects from the cache that begin with the passed in string. |
| Methods inherited from class net.spy.SpyObject |
|---|
getLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SpyCache()
| Method Detail |
|---|
public static SpyCache getInstance()
public static void shutdown()
public void setDelegate(CacheDelegate del)
del -
public void store(String key,
Cachable value)
key - the key for storing this objectvalue - the object to store
public void store(String key,
Object value,
long cacheTime)
Objects will be wrapped in a private subclass of Cachable
that expires based on the time.
key - Cache keyvalue - Object to cachecacheTime - Amount of time (in milliseconds) to store object.public Object get(String key)
key - key of the object to return
public void uncache(String key)
key - key to removepublic void uncacheLike(String keystart)
keystart - string to match in the key name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||