cache.java

来自「java网上考试系统」· Java 代码 · 共 55 行

JAVA
55
字号
package com.qrsx.exam.cache;

import java.io.Serializable;
import java.util.Properties;

/**
 * Defina a common Cache interface
 * 
 * @author galaxy
 * 
 */
public interface Cache {
    /**
     * The method of initialize the cache This method may be auto invoked by the
     * DAOFactory after create the cache instance.
     * 
     * @param props
     *            The initial parameters
     */
    public void initialize(Properties props);

    /**
     * The method of put a Object into the cache
     * 
     * @param name
     *            The key of the object
     * @param obj
     *            The Object that was to be putted into the cache
     */
    public void put(String name, Serializable obj);

    /**
     * Get a Object that was putted into the cache
     * 
     * @param name
     *            the key of the object
     * @return the object that has been putted in the cache
     */
    public Object get(String name);

    /**
     * Remove a Object from the cache
     * 
     * @param name
     *            the key of the object
     */
    public void clear(String name);

    /**
     * Remove all the Objects from the cache
     * 
     */
    public void clearAll();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?