|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rythmengine.cache.SimpleCacheService
public class SimpleCacheService
A simple cache service implementation
Field Summary | |
---|---|
static SimpleCacheService |
INSTANCE
|
Method Summary | |
---|---|
void |
clear()
Remove all cached items |
boolean |
contains(String key)
Check if the cache contains key |
protected void |
finalize()
|
Serializable |
get(String key)
Return an item from the cache service by key |
void |
put(String key,
Serializable value)
Store an item into the cache by key and use default ttl |
void |
put(String key,
Serializable value,
int ttl)
Store an item into the cache service by key and set ttl value |
Serializable |
remove(String key)
Remove an item from cache service by key |
void |
setDefaultTTL(int ttl)
Set default ttl value which will be used if user pass 0 as ttl or not specified ttl |
void |
shutdown()
Shutdown the cache service |
void |
startup()
Restart the cache service after shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final SimpleCacheService INSTANCE
Method Detail |
---|
public void put(String key, Serializable value, int ttl)
ICacheService
put
in interface ICacheService
ttl
- time to live of the cached item. Time unit is second.
If set to negative number, then it will never expire.
If set to zero then the default ttl value will be usedpublic void put(String key, Serializable value)
ICacheService
put
in interface ICacheService
public Serializable remove(String key)
ICacheService
remove
in interface ICacheService
public void clear()
ICacheService
clear
in interface ICacheService
public Serializable get(String key)
ICacheService
get
in interface ICacheService
public boolean contains(String key)
ICacheService
contains
in interface ICacheService
public void setDefaultTTL(int ttl)
ICacheService
setDefaultTTL
in interface ICacheService
public void shutdown()
ICacheService
shutdown
in interface ICacheService
public void startup()
ICacheService
Note, by default the cache service should be started after initialized
startup
in interface ICacheService
protected void finalize() throws Throwable
finalize
in class Object
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |