⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cachefactory.java

📁 java网上考试系统
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -