You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
530 B
22 lines
530 B
|
1 year ago
|
package com.ynxbd.common.service.cache;
|
||
|
|
|
||
|
|
import com.ynxbd.common.bean.his.HisArea;
|
||
|
|
import com.ynxbd.common.config.EhCacheConfig;
|
||
|
|
import org.ehcache.Cache;
|
||
|
|
|
||
|
|
public class AreaCache {
|
||
|
|
|
||
|
|
static {
|
||
|
|
createHisAreaCache();
|
||
|
|
}
|
||
|
|
|
||
|
|
private static Cache<String, HisArea> AREA_CACHE;
|
||
|
|
|
||
|
|
private synchronized static void createHisAreaCache() {
|
||
|
|
if (AREA_CACHE == null) {
|
||
|
|
AREA_CACHE = EhCacheConfig.createCacheTTL(String.class, HisArea.class, "his_area_cache", (7100L)); // 一个半小时
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|