use of j.cache.CachedMap in project JFramework by gugumall.
the class JObject method getStaticCachedMap.
/**
* @param key
* @return
*/
public static CachedMap getStaticCachedMap(String key) {
if (statics.containsKey(key)) {
return (CachedMap) statics.get(key);
} else {
try {
CachedMap s = new CachedMap(key);
statics.put(key, s);
return s;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
use of j.cache.CachedMap in project JFramework by gugumall.
the class VerifyCodeServiceImpl method run.
/*
* (non-Javadoc)
* @see java.lang.Runnable#run()
*/
public void run() {
while (true) {
try {
Thread.sleep(5000);
} catch (Exception e) {
}
try {
List cs = caches.listValues();
for (int i = 0; i < cs.size(); i++) {
CachedMap c = (CachedMap) cs.get(i);
c.remove(new JCacheParams(new VerifyCodeRemover()));
}
} catch (Exception e) {
log.log(e, Logger.LEVEL_ERROR);
}
}
}
Aggregations