Search in sources :

Example 1 with CachedMap

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;
        }
    }
}
Also used : CachedMap(j.cache.CachedMap)

Example 2 with CachedMap

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);
        }
    }
}
Also used : JCacheParams(j.cache.JCacheParams) CachedMap(j.cache.CachedMap) List(java.util.List) RemoteException(java.rmi.RemoteException)

Aggregations

CachedMap (j.cache.CachedMap)2 JCacheParams (j.cache.JCacheParams)1 RemoteException (java.rmi.RemoteException)1 List (java.util.List)1