|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface SCache<T>
Basic persistent cache support.
| Method Summary | |
|---|---|
void |
destroy()
Destroy all cache elements for this cache |
T |
fetch(java.lang.String key,
Calculator<T> dataFetcher)
Get data from cache, if available. |
void |
flush()
Flush all the cache data to the disk |
java.lang.String |
getName()
Name of the cache, as specified upon cache creation |
void |
invalidate(java.lang.String key)
Delete cache value for particular key |
T |
read(java.lang.String key)
Read cache value |
void |
write(java.lang.String key,
T value)
Put a value to cache without timeout |
void |
write(java.lang.String key,
T value,
int ttlSecs)
Put a value to cache with timeout (time to live) |
| Method Detail |
|---|
java.lang.String getName()
void write(@NotNull
java.lang.String key,
@Nullable
T value)
key - cache keyvalue - serializable value. If null, cached value is removed
void write(@NotNull
java.lang.String key,
@Nullable
T value,
int ttlSecs)
key - cache keyvalue - serializable value. If null, cached value is removedttlSecs - Time to live for cached value in seconds. 0 means no TTL (eternal)
@Nullable
T read(@NotNull
java.lang.String key)
T fetch(java.lang.String key,
Calculator<T> dataFetcher)
key - cache keydataFetcher - a procegure to obtain data if it is not found in the cache (data is put to the cache in this case)
void invalidate(@NotNull
java.lang.String key)
void flush()
void destroy()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||