cachefactory.java
来自「java网上考试系统」· Java 代码 · 共 31 行
JAVA
31 行
package com.qrsx.exam.cache;
import com.qrsx.exam.config.CacheConfig;
import com.qrsx.exam.config.ExamConfigUtil;
import com.qrsx.exam.util.ClassUtils;
/**
* The Cache Factory
*
* @author galaxy
*
*/
public class CacheFactory {
/**
* Get the Cache instance
*
* @return the cache instance
*/
public static Cache getCache() {
// 得到缓存对象的配置信息
CacheConfig cacheconfig = ExamConfigUtil.getCacheConfig();
// 得到缓存对象的实例
Cache cache = ClassUtils
.getInstance(Cache.class, cacheconfig.getType());
// 缓存对象初始化
cache.initialize(cacheconfig.getProperties());
return cache;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?